mirror of
https://github.com/cemu-project/Cemu.git
synced 2026-04-02 19:07:44 -06:00
- Fix target_precompile_headers() usage; the CemuCommon target exposes the src/Common/precompiled.h precompiled header as part of its public interface with target_precompile_headers(CemuCommon PUBLIC precompiled.h), so all the other targets wanting to use the precompiled header have to link to the CemuCommon target with target_precompile_headers(TargetName PRIVATE CemuCommon). - Set the project version to 2.0 - Set RUNTIME_OUTPUT_DIRECTORY instead of only their _DEBUG and _RELEASE variants, fixing the compilation when neither build types are defined - Use a consistent indentation style (tabs, like in the .cpp files) - Use "modern" variants of some functions, e.g. add_definitions -> add_compile_definitions
50 lines
1.2 KiB
CMake
50 lines
1.2 KiB
CMake
project(CemuCommon)
|
|
|
|
file(GLOB CPP_FILES *.cpp)
|
|
file(GLOB H_FILES *.h)
|
|
add_library(CemuCommon ${CPP_FILES} ${H_FILES})
|
|
|
|
set_property(TARGET CemuCommon PROPERTY MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
|
|
|
|
if(WIN32)
|
|
target_sources(CemuCommon PRIVATE
|
|
windows/platform.cpp
|
|
windows/platform.h
|
|
ExceptionHandler/ExceptionHandler_win32.cpp
|
|
)
|
|
else()
|
|
target_sources(CemuCommon
|
|
PRIVATE
|
|
unix/platform.cpp
|
|
unix/platform.h
|
|
ExceptionHandler/ExceptionHandler_posix.cpp
|
|
)
|
|
endif()
|
|
|
|
target_sources(CemuCommon PRIVATE
|
|
ExceptionHandler/ExceptionHandler.h
|
|
)
|
|
|
|
# All the targets wanting to use the precompiled.h header
|
|
# have to link to CemuCommon
|
|
target_precompile_headers(CemuCommon PUBLIC precompiled.h)
|
|
target_include_directories(CemuCommon PUBLIC "../")
|
|
|
|
target_link_libraries(CemuCommon PRIVATE
|
|
CemuCafe
|
|
CemuConfig
|
|
CemuComponents
|
|
Boost::nowide
|
|
Boost::filesystem
|
|
glm::glm
|
|
)
|
|
|
|
if (UNIX AND NOT APPLE)
|
|
target_link_libraries(CemuCommon PRIVATE X11::X11 X11::Xrender X11::Xutil)
|
|
endif()
|
|
|
|
# PUBLIC because:
|
|
# - boost/predef/os.h is included in platform.h
|
|
# - fmt/core.h is included in precompiled.h
|
|
target_link_libraries(CemuCommon PUBLIC Boost::headers fmt::fmt)
|