2010-11-17 05:49:11 +00:00
|
|
|
# Check that people use the good file
|
|
|
|
if(NOT TOP_CMAKE_WAS_SOURCED)
|
2021-07-04 05:24:21 +00:00
|
|
|
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")
|
2010-11-17 05:49:11 +00:00
|
|
|
endif(NOT TOP_CMAKE_WAS_SOURCED)
|
|
|
|
|
2021-09-02 16:36:36 +00:00
|
|
|
add_library(common)
|
2021-07-18 06:45:18 +00:00
|
|
|
|
2021-09-02 16:36:36 +00:00
|
|
|
# x86emitter sources
|
|
|
|
target_sources(common PRIVATE
|
2021-09-03 10:43:33 +00:00
|
|
|
AlignedMalloc.cpp
|
2015-11-17 17:30:20 +00:00
|
|
|
VirtualMemory.cpp
|
2021-09-02 16:36:36 +00:00
|
|
|
EventSource.inl
|
|
|
|
SafeArray.inl
|
2010-11-17 05:49:11 +00:00
|
|
|
Console.cpp
|
|
|
|
EventSource.cpp
|
|
|
|
Exceptions.cpp
|
|
|
|
FastFormatString.cpp
|
2021-09-21 10:05:20 +00:00
|
|
|
FastJmp.cpp
|
2010-11-17 05:49:11 +00:00
|
|
|
IniInterface.cpp
|
|
|
|
Mutex.cpp
|
|
|
|
PathUtils.cpp
|
|
|
|
PrecompiledHeader.cpp
|
2015-12-06 11:57:54 +00:00
|
|
|
Perf.cpp
|
2010-11-17 05:49:11 +00:00
|
|
|
pxStaticText.cpp
|
|
|
|
pxStreams.cpp
|
|
|
|
pxTranslate.cpp
|
|
|
|
pxWindowTextWriter.cpp
|
2017-02-16 18:50:33 +00:00
|
|
|
RwMutex.cpp
|
2021-09-02 16:36:36 +00:00
|
|
|
Semaphore.cpp
|
2010-11-17 05:49:11 +00:00
|
|
|
StringHelpers.cpp
|
|
|
|
ThreadTools.cpp
|
|
|
|
wxGuiTools.cpp
|
|
|
|
wxHelpers.cpp
|
2021-09-02 16:36:36 +00:00
|
|
|
emitter/bmi.cpp
|
|
|
|
emitter/cpudetect.cpp
|
|
|
|
emitter/fpu.cpp
|
|
|
|
emitter/groups.cpp
|
|
|
|
emitter/jmp.cpp
|
|
|
|
emitter/legacy.cpp
|
|
|
|
emitter/legacy_sse.cpp
|
|
|
|
emitter/movs.cpp
|
|
|
|
emitter/simd.cpp
|
2021-09-03 10:43:33 +00:00
|
|
|
emitter/LnxCpuDetect.cpp
|
2021-09-02 16:36:36 +00:00
|
|
|
emitter/WinCpuDetect.cpp
|
|
|
|
emitter/x86emitter.cpp
|
|
|
|
x86/MemcpyFast.cpp
|
2021-09-03 10:43:33 +00:00
|
|
|
Darwin/DarwinThreads.cpp
|
|
|
|
Darwin/DarwinMisc.cpp
|
|
|
|
Darwin/DarwinSemaphore.cpp
|
|
|
|
Linux/LnxHostSys.cpp
|
|
|
|
Linux/LnxThreads.cpp
|
|
|
|
Linux/LnxMisc.cpp
|
2021-09-02 16:36:36 +00:00
|
|
|
Windows/WinThreads.cpp
|
|
|
|
Windows/WinHostSys.cpp
|
|
|
|
Windows/WinMisc.cpp)
|
2010-11-17 05:49:11 +00:00
|
|
|
|
2021-09-02 16:36:36 +00:00
|
|
|
# x86emitter headers
|
|
|
|
target_sources(common PRIVATE
|
|
|
|
Assertions.h
|
|
|
|
boost_spsc_queue.hpp
|
|
|
|
Console.h
|
|
|
|
Dependencies.h
|
|
|
|
EventSource.h
|
|
|
|
Exceptions.h
|
2021-09-21 10:05:20 +00:00
|
|
|
FastJmp.h
|
2021-09-02 16:36:36 +00:00
|
|
|
General.h
|
|
|
|
MemcpyFast.h
|
|
|
|
MemsetFast.inl
|
|
|
|
Path.h
|
|
|
|
PageFaultSource.h
|
2015-11-17 17:30:20 +00:00
|
|
|
PrecompiledHeader.h
|
2021-09-02 16:36:36 +00:00
|
|
|
pxForwardDefs.h
|
|
|
|
pxStaticText.h
|
|
|
|
pxStreams.h
|
|
|
|
RedtapeWindows.h
|
|
|
|
RwMutex.h
|
|
|
|
SafeArray.h
|
|
|
|
ScopedAlloc.h
|
|
|
|
ScopedPtrMT.h
|
|
|
|
StringHelpers.h
|
|
|
|
Threading.h
|
|
|
|
TraceLog.h
|
|
|
|
wxBaseTools.h
|
|
|
|
wxGuiTools.h
|
|
|
|
emitter/cpudetect_internal.h
|
|
|
|
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/tools.h
|
|
|
|
emitter/x86emitter.h
|
|
|
|
emitter/x86types.h
|
2017-02-16 18:50:33 +00:00
|
|
|
)
|
2010-11-17 05:49:11 +00:00
|
|
|
|
2021-08-21 21:36:01 +00:00
|
|
|
if(USE_VTUNE)
|
2021-09-02 16:36:36 +00:00
|
|
|
target_link_libraries(common PUBLIC Vtune::Vtune)
|
2021-08-21 21:36:01 +00:00
|
|
|
endif()
|
|
|
|
|
2021-09-02 16:36:36 +00:00
|
|
|
if(WIN32)
|
2021-09-21 10:05:20 +00:00
|
|
|
enable_language(ASM_MASM)
|
|
|
|
target_sources(common PRIVATE FastJmp.asm)
|
2021-09-02 16:36:36 +00:00
|
|
|
target_link_libraries(common PUBLIC pthreads4w Winmm.lib)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
target_link_libraries(common PRIVATE ${LIBC_LIBRARIES} PUBLIC wxWidgets::all)
|
|
|
|
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}")
|
|
|
|
|
2021-07-18 06:45:18 +00:00
|
|
|
if(COMMAND target_precompile_headers)
|
2021-09-02 16:36:36 +00:00
|
|
|
target_precompile_headers(common PRIVATE PrecompiledHeader.h)
|
2021-07-18 06:45:18 +00:00
|
|
|
endif()
|