mirror of
https://github.com/cemu-project/Cemu.git
synced 2026-04-07 17:01:28 -06:00
build: Generate precompiled header only once (msvc only)
This commit is contained in:
parent
1a5546e4ad
commit
8e2e2c44bb
@ -55,6 +55,8 @@ add_executable(CemuBin
|
||||
mainLLE.cpp
|
||||
)
|
||||
|
||||
target_precompile_headers(CemuBin REUSE_FROM CemuCommon)
|
||||
|
||||
if(MSVC AND MSVC_VERSION EQUAL 1940)
|
||||
# workaround for an msvc issue on VS 17.10 where generated ILK files are too large
|
||||
# see https://developercommunity.visualstudio.com/t/After-updating-to-VS-1710-the-size-of-/10665511
|
||||
|
||||
@ -614,6 +614,8 @@ endif()
|
||||
|
||||
set_property(TARGET CemuCafe PROPERTY MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
|
||||
|
||||
target_precompile_headers(CemuCafe REUSE_FROM CemuCommon)
|
||||
|
||||
target_include_directories(CemuCafe PUBLIC "../")
|
||||
|
||||
if (glslang_VERSION VERSION_LESS "15.0.0")
|
||||
|
||||
@ -40,6 +40,8 @@ endif()
|
||||
|
||||
set_property(TARGET CemuComponents PROPERTY MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
|
||||
|
||||
target_precompile_headers(CemuComponents REUSE_FROM CemuCommon)
|
||||
|
||||
target_include_directories(CemuComponents PUBLIC "../")
|
||||
|
||||
target_link_libraries(CemuComponents PRIVATE
|
||||
|
||||
@ -53,14 +53,11 @@ if(LINUX)
|
||||
)
|
||||
endif()
|
||||
|
||||
# All the targets wanting to use the precompiled.h header
|
||||
# have to link to CemuCommon
|
||||
target_precompile_headers(CemuCommon PUBLIC precompiled.h)
|
||||
# the precompiled header is produced by CemuCommon and reused by all the other targets
|
||||
target_precompile_headers(CemuCommon PRIVATE precompiled.h)
|
||||
target_include_directories(CemuCommon PUBLIC "../")
|
||||
|
||||
target_link_libraries(CemuCommon PRIVATE
|
||||
Boost::nowide
|
||||
Boost::filesystem
|
||||
glm::glm
|
||||
)
|
||||
|
||||
@ -69,6 +66,11 @@ if (UNIX AND NOT APPLE)
|
||||
endif()
|
||||
|
||||
# PUBLIC because:
|
||||
# - boost/nowide/convert.hpp is included in precompiled.h
|
||||
# - 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)
|
||||
target_link_libraries(CemuCommon PUBLIC
|
||||
Boost::nowide
|
||||
Boost::headers
|
||||
fmt::fmt
|
||||
)
|
||||
|
||||
@ -7,6 +7,8 @@ add_library(CemuAudio
|
||||
|
||||
set_property(TARGET CemuAudio PROPERTY MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
|
||||
|
||||
target_precompile_headers(CemuAudio REUSE_FROM CemuCommon)
|
||||
|
||||
if(WIN32)
|
||||
target_sources(CemuAudio PRIVATE
|
||||
DirectSoundAPI.cpp
|
||||
|
||||
@ -13,6 +13,8 @@ add_library(CemuConfig
|
||||
|
||||
set_property(TARGET CemuConfig PROPERTY MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
|
||||
|
||||
target_precompile_headers(CemuConfig REUSE_FROM CemuCommon)
|
||||
|
||||
target_include_directories(CemuConfig PUBLIC "../")
|
||||
|
||||
target_link_libraries(CemuConfig PRIVATE
|
||||
|
||||
@ -132,6 +132,8 @@ endif()
|
||||
|
||||
set_property(TARGET CemuWxGui PROPERTY MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
|
||||
|
||||
target_precompile_headers(CemuWxGui REUSE_FROM CemuCommon)
|
||||
|
||||
|
||||
target_include_directories(CemuWxGui PUBLIC "../")
|
||||
# PUBLIC because rapidjson/document.h is included in ChecksumTool.h
|
||||
|
||||
@ -18,6 +18,8 @@ endif ()
|
||||
|
||||
set_property(TARGET imguiImpl PROPERTY MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
|
||||
|
||||
target_precompile_headers(imguiImpl REUSE_FROM CemuCommon)
|
||||
|
||||
target_include_directories(imguiImpl PUBLIC "../")
|
||||
|
||||
# imgui source files
|
||||
|
||||
@ -43,6 +43,8 @@ add_library(CemuInput
|
||||
|
||||
set_property(TARGET CemuInput PROPERTY MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
|
||||
|
||||
target_precompile_headers(CemuInput REUSE_FROM CemuCommon)
|
||||
|
||||
if(WIN32)
|
||||
# XInput
|
||||
target_sources(CemuInput PRIVATE
|
||||
|
||||
@ -2,6 +2,8 @@ add_library(CemuResource)
|
||||
|
||||
set_property(TARGET CemuResource PROPERTY MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
|
||||
|
||||
target_precompile_headers(CemuResource REUSE_FROM CemuCommon)
|
||||
|
||||
enable_language(ASM)
|
||||
|
||||
# icon resources
|
||||
|
||||
@ -89,6 +89,8 @@ endif()
|
||||
|
||||
set_property(TARGET CemuUtil PROPERTY MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
|
||||
|
||||
target_precompile_headers(CemuUtil REUSE_FROM CemuCommon)
|
||||
|
||||
target_include_directories(CemuUtil PUBLIC "../")
|
||||
|
||||
target_link_libraries(CemuUtil PRIVATE
|
||||
|
||||
Loading…
Reference in New Issue
Block a user