mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-26 11:52:32 +01:00
* Required for handling flags inherited by linked projects correctly in the corresponding precompiled header. * Reduces the maintenance effort for precompiled headers
18 lines
592 B
CMake
18 lines
592 B
CMake
include(cotire)
|
|
|
|
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})
|
|
|
|
# Workaround for cotire bug: https://github.com/sakra/cotire/issues/138
|
|
set_property(TARGET ${TARGET_NAME} PROPERTY CXX_STANDARD 14)
|
|
endforeach()
|
|
|
|
cotire(${TARGET_NAME_LIST})
|
|
endfunction(ADD_CXX_PCH)
|