From aa5a3bd725861161d6b713a5145729abe6115aec Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Mon, 10 Apr 2023 10:49:28 +0200 Subject: cmake: add precompiled header now unconditionally --- draw/CMakeLists.txt | 6 +++++ editor/CMakeLists.txt | 6 +++++ main/CMakeLists.txt | 6 +++++ serialize/CMakeLists.txt | 6 +++++ src/CMakeLists.txt | 2 ++ src/precomp.hpp | 58 ++++++++++++++++++++++++++++++++++++++++++++++++ test/CMakeLists.txt | 6 +++++ 7 files changed, 90 insertions(+) create mode 100644 src/precomp.hpp diff --git a/draw/CMakeLists.txt b/draw/CMakeLists.txt index 2c12289d..f12604ab 100644 --- a/draw/CMakeLists.txt +++ b/draw/CMakeLists.txt @@ -2,3 +2,9 @@ set(self floormat-draw) file(GLOB sources "*.cpp" CONFIGURE_ARGS) add_library(${self} OBJECT "${sources}") target_link_libraries(${self} PUBLIC Magnum::GL) + +if(NOT MSVC) + target_precompile_headers(${self} REUSE_FROM floormat) +else() + target_precompile_headers(${self} PRIVATE ../src/precomp.hpp) +endif() diff --git a/editor/CMakeLists.txt b/editor/CMakeLists.txt index 0eb7bcb7..372d9cd8 100644 --- a/editor/CMakeLists.txt +++ b/editor/CMakeLists.txt @@ -29,3 +29,9 @@ add_executable(${self} dummy.cc) target_link_libraries(${self} PRIVATE ${self}_o floormat-main floormat-serialize floormat-draw floormat) install(TARGETS ${self} RUNTIME DESTINATION bin) + +if(NOT MSVC) + target_precompile_headers(${self}_o REUSE_FROM floormat) +else() + target_precompile_headers(${self}_o PRIVATE ../src/precomp.hpp) +endif() diff --git a/main/CMakeLists.txt b/main/CMakeLists.txt index fe32d1d5..419043aa 100644 --- a/main/CMakeLists.txt +++ b/main/CMakeLists.txt @@ -10,3 +10,9 @@ target_link_libraries(${self} PUBLIC fmt::fmt tsl::robin_map ) + +if(NOT MSVC) + target_precompile_headers(${self} REUSE_FROM floormat) +else() + target_precompile_headers(${self} PRIVATE ../src/precomp.hpp) +endif() diff --git a/serialize/CMakeLists.txt b/serialize/CMakeLists.txt index bede6c6c..be65ccc3 100644 --- a/serialize/CMakeLists.txt +++ b/serialize/CMakeLists.txt @@ -23,3 +23,9 @@ endif() if(WIN32) target_link_libraries(${self} PUBLIC ntdll) endif() + +if(NOT MSVC) + target_precompile_headers(${self} REUSE_FROM floormat) +else() + target_precompile_headers(${self} PRIVATE ../src/precomp.hpp) +endif() diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 4aa9dbb4..714b4877 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -9,3 +9,5 @@ target_link_libraries( fmt::fmt tsl::robin_map ) + +target_precompile_headers(${self} PRIVATE precomp.hpp) diff --git a/src/precomp.hpp b/src/precomp.hpp new file mode 100644 index 00000000..40b231f8 --- /dev/null +++ b/src/precomp.hpp @@ -0,0 +1,58 @@ +#if 1 +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#endif diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 20b66a6d..e835c359 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -26,3 +26,9 @@ file(GLOB saves "save/*.dat" CONFIGURE_ARGS) foreach(file ${saves}) configure_file("${file}" "${save-dir}" COPYONLY) endforeach() + +if(NOT MSVC) + target_precompile_headers(${self}_o REUSE_FROM floormat) +else() + target_precompile_headers(${self}_o PRIVATE ../src/precomp.hpp) +endif() -- cgit v1.2.3