summaryrefslogtreecommitdiff
path: root/src/cmake/macros
diff options
context:
space:
mode:
authorKargatum <dowlandtop@yandex.com>2021-04-02 17:29:33 +0700
committerGitHub <noreply@github.com>2021-04-02 12:29:33 +0200
commite0b953b186df486ef999c51d58f71410fbd42853 (patch)
tree955ba28f2ed030a8f0dc326940b818dcc34d33ad /src/cmake/macros
parent9d4eebc61fec3b9701ae94292e8d40962804b676 (diff)
feat(Cmake/PCH): use target_precompile_headers instead of cotire (#5082)
Diffstat (limited to 'src/cmake/macros')
-rw-r--r--src/cmake/macros/FindPCHSupport.cmake23
1 files changed, 4 insertions, 19 deletions
diff --git a/src/cmake/macros/FindPCHSupport.cmake b/src/cmake/macros/FindPCHSupport.cmake
index d083d9ac57..50deadc9bf 100644
--- a/src/cmake/macros/FindPCHSupport.cmake
+++ b/src/cmake/macros/FindPCHSupport.cmake
@@ -1,24 +1,9 @@
-if (MSVC)
- # Specify the maximum PreCompiled Header memory allocation limit
- # Fixes a compiler-problem when using PCH - the /Ym flag is adjusted by the compiler in MSVC2012,
- # hence we need to set an upper limit with /Zm to avoid discrepancies)
- # (And yes, this is a verified, unresolved bug with MSVC... *sigh*)
- #
- # Note: This workaround was verified to be required on MSVC 2017 as well
- set(COTIRE_PCH_MEMORY_SCALING_FACTOR 500)
-endif()
-
-include(cotire)
+#
+# Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU AGPL v3 license: https://github.com/azerothcore/azerothcore-wotlk/blob/master/LICENSE-AGPL3
+#
function(ADD_CXX_PCH TARGET_NAME_LIST PCH_HEADER)
- # Use the header for every target
foreach(TARGET_NAME ${TARGET_NAME_LIST})
- # Disable unity builds
- set_target_properties(${TARGET_NAME} PROPERTIES COTIRE_ADD_UNITY_BUILD OFF)
-
- # Set the prefix header
- set_target_properties(${TARGET_NAME} PROPERTIES COTIRE_CXX_PREFIX_HEADER_INIT ${PCH_HEADER})
+ target_precompile_headers(${TARGET_NAME} PRIVATE ${PCH_HEADER})
endforeach()
-
- cotire(${TARGET_NAME_LIST})
endfunction(ADD_CXX_PCH)