From bd34d6ef65fed8d28be57a41f70bf2abada00c76 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Mon, 5 Dec 2022 07:48:36 +0100 Subject: cmake: remove transitive deps to speed up build Also build them out of order to make sure there are no dependencies remaining. --- test/CMakeLists.txt | 18 +++++++++--------- test/dummy.cc | 0 2 files changed, 9 insertions(+), 9 deletions(-) create mode 100644 test/dummy.cc (limited to 'test') diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 6eea9f5f..eae3ffd5 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -3,21 +3,21 @@ file(GLOB sources "*.cpp" CONFIGURE_ARGS) file(MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/test") -add_executable(${self} "${sources}") - -target_link_libraries(${self} PRIVATE floormat-serialize floormat) -target_link_libraries(${self} PRIVATE Magnum::GL Magnum::Trade nlohmann_json::nlohmann_json) +add_library(${self}_o OBJECT "${sources}") +target_link_libraries(${self}_o PUBLIC Magnum::GL Magnum::Trade nlohmann_json::nlohmann_json fmt::fmt) if(APPLE) - target_link_libraries(${self} PRIVATE Magnum::WindowlessCglApplication) + target_link_libraries(${self}_o PUBLIC Magnum::WindowlessCglApplication) elseif(WIN32) - target_link_libraries(${self} PRIVATE Magnum::WindowlessWglApplication) - target_link_libraries(${self} PRIVATE ntdll) + target_link_libraries(${self}_o PUBLIC Magnum::WindowlessWglApplication ntdll) else() - target_link_libraries(${self} PRIVATE Magnum::WindowlessGlxApplication) + target_link_libraries(${self}_o PUBLIC Magnum::WindowlessGlxApplication) endif() +add_executable(${self} dummy.cc) +target_link_libraries(${self} ${self}_o floormat-serialize 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) diff --git a/test/dummy.cc b/test/dummy.cc new file mode 100644 index 00000000..e69de29b -- cgit v1.2.3