Skip to content

Commit

Permalink
Use CMake built-in PCH when supported
Browse files Browse the repository at this point in the history
  • Loading branch information
k0zmo authored and kswierk committed Sep 5, 2020
1 parent beaef27 commit e82e072
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 199 deletions.
1 change: 0 additions & 1 deletion CMakeLists.txt
Expand Up @@ -31,7 +31,6 @@ if(kl_master_project)
include(Sanitizers)
endif()
include(SourceGroup)
include(PrecompileHeaders)

find_package(Boost 1.61.0 REQUIRED COMPONENTS)

Expand Down
178 changes: 0 additions & 178 deletions cmake/PrecompileHeaders.cmake

This file was deleted.

18 changes: 10 additions & 8 deletions external/CMakeLists.txt
Expand Up @@ -62,14 +62,16 @@ if(KL_ENABLE_YAML)
)
endif()
set_target_properties(yaml-cpp PROPERTIES FOLDER external)
kl_precompile_headers(yaml-cpp HEADERS
string
ostream
istream
ios
map
vector
)
if(COMMAND target_precompile_headers)
target_precompile_headers(yaml-cpp PRIVATE
<string>
<ostream>
<istream>
<ios>
<map>
<vector>
)
endif()
endif()
endif()

Expand Down
23 changes: 11 additions & 12 deletions tests/CMakeLists.txt
Expand Up @@ -77,15 +77,14 @@ elseif(KL_USE_OPENCPPCOVERAGE)
)
endif()

kl_precompile_headers(kl-tests
HEADERS
boost/optional.hpp
boost/variant.hpp
istream
ostream
ios
catch2/catch.hpp
EXCLUDE
main_test.cpp
SOURCE_GROUP pch
)
if(COMMAND target_precompile_headers)
target_precompile_headers(kl-tests PRIVATE
<boost/optional.hpp>
<boost/variant.hpp>
<istream>
<ostream>
<ios>
<catch2/catch.hpp>
)
set_source_files_properties(main_test.cpp PROPERTIES SKIP_PRECOMPILE_HEADERS ON)
endif()

0 comments on commit e82e072

Please sign in to comment.