diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2022-12-05 07:48:36 +0100 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2022-12-05 07:48:51 +0100 |
commit | bd34d6ef65fed8d28be57a41f70bf2abada00c76 (patch) | |
tree | 63d4899e781f3e5e1e10966aaf6f430e4d3b55b0 /editor/CMakeLists.txt | |
parent | 900d775c8f4f078dc7cba8557e3991e52d2d5f89 (diff) |
cmake: remove transitive deps to speed up build
Also build them out of order to make sure there are no dependencies
remaining.
Diffstat (limited to 'editor/CMakeLists.txt')
-rw-r--r-- | editor/CMakeLists.txt | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/editor/CMakeLists.txt b/editor/CMakeLists.txt index cb57e6e1..2119ee9e 100644 --- a/editor/CMakeLists.txt +++ b/editor/CMakeLists.txt @@ -9,8 +9,8 @@ else() set_property(SOURCE "${res}" APPEND PROPERTY COMPILE_OPTIONS "-w") endif() -add_executable(${self} "${res}" "${sources}") -target_link_libraries(${self} PRIVATE MagnumIntegration::ImGui fmt::fmt nlohmann_json::nlohmann_json) +add_library(${self}_o OBJECT "${res}" "${sources}") +target_link_libraries(${self}_o PUBLIC MagnumIntegration::ImGui fmt::fmt nlohmann_json::nlohmann_json) if(NOT SDL2_INCLUDE_DIRS) if(NOT TARGET SDL2::SDL2) @@ -19,16 +19,17 @@ if(NOT SDL2_INCLUDE_DIRS) get_target_property(SDL2_INCLUDE_DIRS SDL2::SDL2 INTERFACE_INCLUDE_DIRECTORIES) endif() endif() -target_include_directories(${self} SYSTEM PRIVATE "${SDL2_INCLUDE_DIRS}") - -target_link_libraries(${self} PRIVATE floormat-main floormat-serialize floormat-draw floormat) +target_include_directories(${self}_o SYSTEM PRIVATE "${SDL2_INCLUDE_DIRS}") if(WIN32) - target_sources(${self} PRIVATE "../main/floormat.rc") + target_sources(${self}_o PRIVATE "../main/floormat.rc") endif() +add_executable(${self} dummy.cc) +target_link_libraries(${self} PRIVATE ${self}_o floormat-main floormat-serialize floormat-draw floormat) + if(FLOORMAT_PRECOMPILED-HEADERS) - target_precompile_headers(${self} PRIVATE precomp.hpp) + target_precompile_headers(${self}_o PRIVATE precomp.hpp) endif() install(TARGETS ${self} RUNTIME DESTINATION bin) |