duckstation/src/common/CMakeLists.txt

110 lines
2.5 KiB
CMake
Raw Normal View History

2019-11-03 14:39:25 +00:00
add_library(common
2020-01-10 03:31:12 +00:00
align.h
assert.cpp
assert.h
2019-11-03 14:39:25 +00:00
bitfield.h
2020-04-26 07:21:33 +00:00
bitutils.h
2022-08-10 03:05:52 +00:00
build_timestamp.h
2020-01-10 03:31:12 +00:00
byte_stream.cpp
byte_stream.h
crash_handler.cpp
crash_handler.h
2020-06-17 12:46:13 +00:00
dimensional_array.h
2021-03-18 15:51:39 +00:00
error.cpp
error.h
fastjmp.cpp
fastjmp.h
2020-01-10 03:31:12 +00:00
fifo_queue.h
file_system.cpp
file_system.h
2020-06-30 14:34:22 +00:00
image.cpp
image.h
2023-10-01 04:12:25 +00:00
intrin.h
hash_combine.h
2020-01-10 03:31:12 +00:00
heap_array.h
2022-07-09 04:17:57 +00:00
heterogeneous_containers.h
2022-07-08 14:14:48 +00:00
layered_settings_interface.cpp
layered_settings_interface.h
2020-01-10 03:31:12 +00:00
log.cpp
log.h
memmap.cpp
memmap.h
2020-01-10 03:31:12 +00:00
md5_digest.cpp
md5_digest.h
2022-07-09 04:17:57 +00:00
memory_settings_interface.cpp
memory_settings_interface.h
minizip_helpers.cpp
minizip_helpers.h
2022-07-08 11:57:06 +00:00
path.h
perf_scope.cpp
perf_scope.h
2020-03-12 03:54:27 +00:00
progress_callback.cpp
progress_callback.h
rectangle.h
2022-07-26 08:37:16 +00:00
scoped_guard.h
2022-07-08 14:14:48 +00:00
settings_interface.h
2022-08-15 13:53:31 +00:00
sha1_digest.cpp
sha1_digest.h
2023-09-20 13:49:14 +00:00
small_string.cpp
small_string.h
2020-01-10 03:31:12 +00:00
string_util.cpp
string_util.h
2023-12-08 06:35:55 +00:00
thirdparty/SmallVector.cpp
thirdparty/SmallVector.h
2022-07-11 09:45:31 +00:00
threading.cpp
threading.h
2020-01-10 03:31:12 +00:00
timer.cpp
timer.h
2019-11-05 09:19:20 +00:00
types.h
2019-09-09 07:01:26 +00:00
)
target_include_directories(common PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/..")
target_include_directories(common PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/..")
2023-10-16 10:00:33 +00:00
target_link_libraries(common PUBLIC fmt Threads::Threads fast_float)
target_link_libraries(common PRIVATE stb ZLIB::ZLIB minizip "${CMAKE_DL_LIBS}")
2019-11-03 14:39:25 +00:00
if(WIN32)
target_sources(common PRIVATE
2022-03-26 12:55:01 +00:00
thirdparty/StackWalker.cpp
thirdparty/StackWalker.h
2020-01-10 03:31:12 +00:00
windows_headers.h
2019-11-03 14:39:25 +00:00
)
2023-11-06 09:59:02 +00:00
target_link_libraries(common PRIVATE OneCore.lib)
2023-09-02 03:41:41 +00:00
endif()
2023-09-02 03:41:41 +00:00
if(MSVC)
if(CPU_ARCH_X64)
enable_language(ASM_MASM)
target_sources(common PRIVATE fastjmp_x86.asm)
2023-09-02 03:41:41 +00:00
set_source_files_properties(fastjmp_x86.asm PROPERTIES COMPILE_FLAGS "/D_M_X86_64")
elseif(CPU_ARCH_ARM32 OR CPU_ARCH_ARM64)
enable_language(ASM_MARMASM)
target_sources(common PRIVATE fastjmp_arm.asm)
endif()
2019-11-03 14:39:25 +00:00
endif()
2020-01-10 03:31:12 +00:00
if(APPLE)
set(MAC_SOURCES
cocoa_tools.h
cocoa_tools.mm
)
target_sources(common PRIVATE ${MAC_SOURCES})
set_source_files_properties(${MAC_SOURCES} PROPERTIES SKIP_PRECOMPILE_HEADERS TRUE)
find_library(COCOA_LIBRARY Cocoa REQUIRED)
target_link_libraries(common PRIVATE ${COCOA_LIBRARY})
endif()
2023-11-06 09:59:02 +00:00
if(NOT WIN32 AND NOT ANDROID AND LIBBACKTRACE_FOUND)
target_compile_definitions(common PRIVATE "-DENABLE_LIBBACKTRACE=1")
target_link_libraries(common PRIVATE libbacktrace::libbacktrace)
2022-09-09 10:32:21 +00:00
endif()
2020-01-10 03:31:12 +00:00
if(ANDROID)
target_link_libraries(common PRIVATE log)
endif()
if(${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
# We need -lrt for shm_unlink
target_link_libraries(common PRIVATE rt)
endif()