Use target_precompile_headers for the most expensive headers

This commit is contained in:
elsid 2022-07-01 14:05:17 +00:00 committed by jvoisin
parent 8a13cde778
commit 7e6c13630a
22 changed files with 193 additions and 14 deletions

View file

@ -1,2 +1,6 @@
add_library(Base64 INTERFACE)
target_include_directories(Base64 INTERFACE .)
target_include_directories(Base64 INTERFACE .)
if (CMAKE_VERSION VERSION_GREATER_EQUAL 3.16 AND MSVC)
target_precompile_headers(Base64 INTERFACE <string>)
endif()

View file

@ -241,6 +241,10 @@ if (NOT OPENMW_USE_SYSTEM_YAML_CPP)
SOURCE_DIR fetched/yaml-cpp
)
FetchContent_MakeAvailableExcludeFromAll(yaml-cpp)
if (CMAKE_VERSION VERSION_GREATER_EQUAL 3.16 AND MSVC)
target_precompile_headers(yaml-cpp PRIVATE <algorithm>)
endif()
endif()
if (NOT OPENMW_USE_SYSTEM_ICU)

View file

@ -19,3 +19,7 @@ else()
)
target_link_libraries(oics local_tinyxml)
endif()
if (CMAKE_VERSION VERSION_GREATER_EQUAL 3.16 AND MSVC)
target_precompile_headers(oics PUBLIC <algorithm> <string>)
endif()

View file

@ -16,3 +16,13 @@ target_link_libraries(${OSG_FFMPEG_VIDEOPLAYER_LIBRARY} ${FFmpeg_LIBRARIES})
target_link_libraries(${OSG_FFMPEG_VIDEOPLAYER_LIBRARY} ${OSG_LIBRARIES})
link_directories(${CMAKE_CURRENT_BINARY_DIR})
if (CMAKE_VERSION VERSION_GREATER_EQUAL 3.16 AND MSVC)
target_precompile_headers(${OSG_FFMPEG_VIDEOPLAYER_LIBRARY} PUBLIC
<memory>
<string>
<vector>
)
target_precompile_headers(${OSG_FFMPEG_VIDEOPLAYER_LIBRARY} PRIVATE <algorithm>)
endif()