summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2023-04-10 10:49:28 +0200
committerStanislaw Halik <sthalik@misaki.pl>2023-04-10 11:36:01 +0200
commitaa5a3bd725861161d6b713a5145729abe6115aec (patch)
treecb0cad0ae94077c0e1f2794c85b5278e7e1bee82
parent10e5f3713cabab03da741743b43a4c7d98954500 (diff)
cmake: add precompiled header now unconditionally
-rw-r--r--draw/CMakeLists.txt6
-rw-r--r--editor/CMakeLists.txt6
-rw-r--r--main/CMakeLists.txt6
-rw-r--r--serialize/CMakeLists.txt6
-rw-r--r--src/CMakeLists.txt2
-rw-r--r--src/precomp.hpp58
-rw-r--r--test/CMakeLists.txt6
7 files changed, 90 insertions, 0 deletions
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 <algorithm>
+#include <array>
+#include <bit>
+#include <cerrno>
+#include <chrono>
+#include <cmath>
+#include <concepts>
+#include <cstddef>
+#include <cstdio>
+#include <cstdlib>
+#include <cstring>
+#include <exception>
+#include <iterator>
+#include <limits>
+#include <map>
+#include <memory>
+#include <stdlib.h>
+#include <string>
+#include <tuple>
+#include <type_traits>
+#include <unordered_map>
+#include <utility>
+#include <vector>
+
+#include <Corrade/Containers/Array.h>
+#include <Corrade/Containers/ArrayView.h>
+#include <Corrade/Containers/ArrayViewStl.h>
+#include <Corrade/Containers/BitArrayView.h>
+#include <Corrade/Containers/Optional.h>
+#include <Corrade/Containers/Pair.h>
+#include <Corrade/Containers/PairStl.h>
+#include <Corrade/Containers/StridedArrayView.h>
+#include <Corrade/Containers/String.h>
+#include <Corrade/Containers/StringIterable.h>
+#include <Corrade/Containers/StringStlView.h>
+#include <Corrade/Containers/StringView.h>
+#include <Corrade/Utility/Debug.h>
+#include <Corrade/Utility/Path.h>
+
+#include <Magnum/GL/Buffer.h>
+#include <Magnum/GL/Context.h>
+#include <Magnum/GL/Mesh.h>
+#include <Magnum/GL/MeshView.h>
+#include <Magnum/GL/Renderer.h>
+#include <Magnum/GL/Texture.h>
+#include <Magnum/GL/TextureFormat.h>
+#include <Magnum/ImageView.h>
+#include <Magnum/Magnum.h>
+#include <Magnum/Math/Color.h>
+#include <Magnum/Math/Range.h>
+#include <Magnum/Math/Vector.h>
+#include <Magnum/Math/Vector2.h>
+#include <Magnum/Math/Vector3.h>
+#include <Magnum/Math/Vector4.h>
+#include <Magnum/PixelFormat.h>
+#include <Magnum/Trade/ImageData.h>
+#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()