pcsx2/common/CMakeLists.txt

224 lines
4.7 KiB
CMake
Raw Permalink Normal View History

# Check that people use the good file
if(NOT TOP_CMAKE_WAS_SOURCED)
message(FATAL_ERROR "
You did not 'cmake' the good CMakeLists.txt file. Use the one in the top dir.
It is advice to delete all wrongly generated cmake stuff => CMakeFiles & CMakeCache.txt")
endif(NOT TOP_CMAKE_WAS_SOURCED)
2021-09-02 16:36:36 +00:00
add_library(common)
2021-09-02 16:36:36 +00:00
# x86emitter sources
target_sources(common PRIVATE
2021-09-03 10:43:33 +00:00
AlignedMalloc.cpp
Assertions.cpp
Console.cpp
CrashHandler.cpp
2022-12-18 13:04:48 +00:00
DynamicLibrary.cpp
2022-12-28 11:13:26 +00:00
Error.cpp
2021-09-21 10:05:20 +00:00
FastJmp.cpp
2021-09-21 09:52:13 +00:00
FileSystem.cpp
HostSys.cpp
2022-08-22 13:20:15 +00:00
Image.cpp
HTTPDownloader.cpp
2022-08-22 13:21:39 +00:00
MemorySettingsInterface.cpp
2021-10-21 06:57:10 +00:00
MD5Digest.cpp
PrecompiledHeader.cpp
Perf.cpp
2021-09-14 09:09:09 +00:00
ProgressCallback.cpp
2022-09-18 01:37:49 +00:00
ReadbackSpinManager.cpp
2021-09-02 16:36:36 +00:00
Semaphore.cpp
SettingsWrapper.cpp
2023-08-26 15:07:48 +00:00
SmallString.cpp
2021-09-14 09:09:09 +00:00
StringUtil.cpp
TextureDecompress.cpp
2021-09-14 09:09:09 +00:00
Timer.cpp
WAVWriter.cpp
2021-07-18 03:11:33 +00:00
WindowInfo.cpp
2021-11-06 06:53:01 +00:00
)
2021-09-02 16:36:36 +00:00
# x86emitter headers
target_sources(common PRIVATE
2021-11-14 01:21:17 +00:00
AlignedMalloc.h
2021-09-02 16:36:36 +00:00
Assertions.h
boost_spsc_queue.hpp
BitUtils.h
ByteSwap.h
2021-09-02 16:36:36 +00:00
Console.h
CrashHandler.h
2022-12-18 13:04:48 +00:00
DynamicLibrary.h
2022-08-22 13:20:15 +00:00
Easing.h
2022-01-28 04:46:22 +00:00
EnumOps.h
2022-12-28 11:13:26 +00:00
Error.h
FPControl.h
2021-09-21 10:05:20 +00:00
FastJmp.h
2021-09-21 09:52:13 +00:00
FileSystem.h
2021-12-20 13:48:13 +00:00
HashCombine.h
HostSys.h
2022-08-22 13:21:39 +00:00
HeterogeneousContainers.h
2022-08-22 13:20:15 +00:00
Image.h
2022-07-24 06:45:33 +00:00
LRUCache.h
2022-12-04 14:51:05 +00:00
HeapArray.h
HTTPDownloader.h
2022-08-22 13:21:39 +00:00
MemorySettingsInterface.h
2021-10-21 06:57:10 +00:00
MD5Digest.h
2021-11-16 11:17:30 +00:00
MRCHelpers.h
2021-09-02 16:36:36 +00:00
Path.h
PrecompiledHeader.h
2021-09-14 09:09:09 +00:00
ProgressCallback.h
2022-09-18 01:37:49 +00:00
ReadbackSpinManager.h
2022-12-25 05:56:43 +00:00
RedtapeWilCom.h
2021-09-02 16:36:36 +00:00
RedtapeWindows.h
2021-10-15 23:57:50 +00:00
ScopedGuard.h
SettingsInterface.h
SettingsWrapper.h
SingleRegisterTypes.h
2023-08-26 15:07:48 +00:00
SmallString.h
2021-09-14 09:09:09 +00:00
StringUtil.h
2021-09-14 09:09:09 +00:00
Timer.h
TextureDecompress.h
2021-09-02 16:36:36 +00:00
Threading.h
VectorIntrin.h
WAVWriter.h
2021-07-18 03:11:33 +00:00
WindowInfo.h
2023-06-24 07:46:36 +00:00
WrappedMemCopy.h
2021-11-06 06:53:01 +00:00
)
2024-03-21 06:19:17 +00:00
if(_M_X86)
target_sources(common PRIVATE
emitter/avx.cpp
emitter/bmi.cpp
emitter/fpu.cpp
emitter/groups.cpp
emitter/jmp.cpp
emitter/legacy.cpp
emitter/legacy_sse.cpp
emitter/movs.cpp
emitter/simd.cpp
emitter/x86emitter.cpp
)
target_sources(common PRIVATE
emitter/implement/dwshift.h
emitter/implement/group1.h
emitter/implement/group2.h
emitter/implement/group3.h
emitter/implement/helpers.h
emitter/implement/incdec.h
emitter/implement/jmpcall.h
emitter/implement/movs.h
emitter/implement/simd_arithmetic.h
emitter/implement/simd_comparisons.h
emitter/implement/simd_helpers.h
emitter/implement/simd_moremovs.h
emitter/implement/simd_shufflepack.h
emitter/implement/simd_templated_helpers.h
emitter/implement/test.h
emitter/implement/xchg.h
emitter/instructions.h
emitter/internal.h
emitter/legacy_instructions.h
emitter/legacy_internal.h
emitter/legacy_types.h
emitter/x86emitter.h
emitter/x86types.h
)
endif()
2021-09-02 16:36:36 +00:00
if(WIN32)
2021-09-21 10:05:20 +00:00
enable_language(ASM_MASM)
2021-07-08 13:35:21 +00:00
target_sources(common PRIVATE
FastJmp.asm
HTTPDownloaderWinHTTP.cpp
HTTPDownloaderWinHTTP.h
2022-04-18 14:58:13 +00:00
StackWalker.cpp
StackWalker.h
Windows/WinThreads.cpp
Windows/WinHostSys.cpp
Windows/WinMisc.cpp
2021-07-08 13:35:21 +00:00
)
target_link_libraries(common PUBLIC
WIL::WIL
winmm
pathcch
)
elseif(APPLE)
target_sources(common PRIVATE
CocoaTools.mm
CocoaTools.h
Darwin/DarwinThreads.cpp
Darwin/DarwinMisc.cpp
Darwin/DarwinMisc.h
)
target_compile_options(common PRIVATE -fobjc-arc)
target_link_options(common PRIVATE -fobjc-link-runtime)
target_link_libraries(common PRIVATE
"-framework Foundation"
"-framework IOKit"
)
else()
target_sources(common PRIVATE
Linux/LnxHostSys.cpp
Linux/LnxThreads.cpp
Linux/LnxMisc.cpp
)
target_include_directories(common PRIVATE
${DBUS_INCLUDE_DIRS}
)
target_link_libraries(common PRIVATE
${DBUS_LINK_LIBRARIES}
X11::X11
X11::Xrandr
)
if(USE_BACKTRACE)
target_compile_definitions(common PRIVATE "HAS_LIBBACKTRACE=1")
target_link_libraries(common PRIVATE libbacktrace::libbacktrace)
endif()
2024-07-11 14:57:28 +00:00
if(${CMAKE_SYSTEM_NAME} STREQUAL "FreeBSD")
target_link_libraries(common PRIVATE cpuinfo)
endif()
endif()
set_source_files_properties(PrecompiledHeader.cpp PROPERTIES HEADER_FILE_ONLY TRUE)
if(USE_VTUNE)
target_link_libraries(common PUBLIC Vtune::Vtune)
endif()
2021-07-08 13:35:21 +00:00
2021-10-24 20:11:38 +00:00
if (USE_GCC AND CMAKE_INTERPROCEDURAL_OPTIMIZATION)
# GCC LTO doesn't work with asm statements
set_source_files_properties(FastJmp.cpp PROPERTIES COMPILE_FLAGS -fno-lto)
endif()
2023-08-26 04:37:56 +00:00
if(NOT WIN32)
# libcurl-based HTTPDownloader
target_sources(common PRIVATE
HTTPDownloaderCurl.cpp
HTTPDownloaderCurl.h
)
target_link_libraries(common PRIVATE
CURL::libcurl
)
endif()
target_link_libraries(common PRIVATE
${LIBC_LIBRARIES}
JPEG::JPEG
2022-08-22 13:20:15 +00:00
PNG::PNG
2023-10-02 06:58:46 +00:00
WebP::libwebp
)
target_link_libraries(common PUBLIC
fmt::fmt
fast_float
)
fixup_file_properties(common)
2021-09-02 16:36:36 +00:00
target_compile_features(common PUBLIC cxx_std_17)
target_include_directories(common PUBLIC ../3rdparty/include ../)
target_compile_definitions(common PUBLIC "${PCSX2_DEFS}")
target_compile_options(common PRIVATE "${PCSX2_WARNINGS}")
if(COMMAND target_precompile_headers)
2021-09-02 16:36:36 +00:00
target_precompile_headers(common PRIVATE PrecompiledHeader.h)
endif()