diff options
author | Niall Douglas (s [underscore] sourceforge {at} nedprod [dot] com) <spamtrap@nedprod.com> | 2016-07-06 11:34:14 +0300 |
---|---|---|
committer | Niall Douglas (s [underscore] sourceforge {at} nedprod [dot] com) <spamtrap@nedprod.com> | 2016-07-06 11:34:14 +0300 |
commit | ab81a76cc6fbfb2ff551bd6fed9ecd6e26047238 (patch) | |
tree | df89fe485f32ed3f77f75df9c4bd6f4586a9f377 /CMakeLists.txt | |
parent | 8f2b0db372fdf0b43592120197dc6d9192b20e45 (diff) |
wip precompiled headers cmake support
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 28 |
1 files changed, 26 insertions, 2 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 04986976..81f9fa75 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -13,10 +13,34 @@ set(PROJECT_NAMESPACE boost::) # Update this header file with the current git SHA and last timestamp UpdateRevisionHppFromGit("${CMAKE_CURRENT_SOURCE_DIR}/include/boost/afio/revision.hpp") +# Make an interface only library so dependent CMakeLists can bring in this header-only library +include(BoostLiteMakeHeaderOnlyLibrary) +# Anyone using the static or dynamic libraries is not using the header only variant +set(afio_NON_HEADER_ONLY_COMPILE_DEFINITIONS INTERFACE BOOST_AFIO_HEADERS_ONLY=0) # Make the standard static and shared libraries, and if supported by this compiler, C++ modules # for both static and shared libraries as well. For the non-C++ module variants, makes the # interface headers into precompiled headers. Only builds all of them if this is the topmost # CMakeLists, else built only if something upstream is dependent on one of them. include(BoostLiteMakeLibrary) -# Make an interface only library so dependent CMakeLists can bring in this header-only library -include(BoostLiteMakeHeaderOnlyLibrary) + +# Set the C++ features this library requires +foreach(lib afio_sl afio_dl) + if(${lib} STREQUAL afio_hl) + set(PUBLIC INTERFACE) + else() + set(PUBLIC PUBLIC) + endif() + target_compile_features(${lib} ${PUBLIC} + # cxx_exceptions ## Annoyingly not supported by cmake 3.4 + cxx_alias_templates + cxx_variadic_templates + cxx_noexcept + cxx_constexpr + cxx_thread_local + #cxx_init_captures ## Not supported yet by cmake 3.4 + cxx_attributes + cxx_variable_templates + ) + unset(PUBLIC) +endforeach() + |