Conversation
Add FILE_SET HEADERS too support generic installation
| # ----------------------------------------------------------------------------- | ||
| # User option: enable C++ modules | ||
| # ----------------------------------------------------------------------------- | ||
| option(BOOST_USE_MODULES "Build Boost using C++ modules" OFF) |
There was a problem hiding this comment.
This differs with boostorg/conversion boostorg/conversion@d324df9#diff-1e7de1ae2d059d21e1dd75d5812d5a34b0222cef273b7c3a2af62eb747f9d20a
Is that OK? Is there any conflict with https://github.com/boostorg/cmake/pull/105/changes#diff-362ae3918cd3ea347acb8663e39d697af2ec828794c33494e747ee3249dbde73R307 ?
|
|
||
| # Ensure CMAKE_CXX_STANDARD is set for module detection | ||
| if(NOT DEFINED CMAKE_CXX_STANDARD) | ||
| set(CMAKE_CXX_STANDARD 20) |
There was a problem hiding this comment.
Is it right to set this variable from CMakeLists? Can we stick to using feature flags only?
| add_library(boost_type_index INTERFACE) | ||
|
|
||
| # If modules are disabled, require C++17 for headers | ||
| target_compile_features(boost_type_index INTERFACE cxx_std_17) |
There was a problem hiding this comment.
cxx_std_11
Library supports C++11
|
|
||
| # Verify interface headers only at top level | ||
| if(PROJECT_IS_TOP_LEVEL) | ||
| set(CMAKE_VERIFY_INTERFACE_HEADER_SETS ON) |
There was a problem hiding this comment.
Projects should not normally set this variable, it is intended as a developer control to be set on the [cmake(1)](https://cmake.org/cmake/help/latest/manual/cmake.1.html#manual:cmake(1)) command line or other equivalent methods
Maybe we should set this variable in CI only?
| TYPE HEADERS | ||
| BASE_DIRS include | ||
| FILES | ||
| include/boost/type_index.hpp |
There was a problem hiding this comment.
How about searching the files via GLOB?
| target_link_libraries(boost_type_index_module_usage_mu PRIVATE Boost::type_index) | ||
| add_test(NAME boost_type_index_module_usage_mu COMMAND boost_type_index_module_usage_mu) | ||
| else() | ||
| list(APPEND RUN_TESTS_SOURCES |
|
|
||
| #ifndef BOOST_TYPE_INDEX_USE_STD_MODULE | ||
| #ifdef BOOST_TYPE_INDEX_USE_STD_MODULE | ||
| import std; |
There was a problem hiding this comment.
Looks like import std; should not be used in global module fragment https://eel.is/c++draft/module#global.frag-1
Make
import std;usableAdd
FILE_SET HEADERStoo support generic module installation