mirror of
https://github.com/boostorg/pfr.git
synced 2026-01-19 04:22:13 +00:00
Minor fixes for modules (#200)
This commit is contained in:
@@ -11,8 +11,7 @@ project(boost_pfr VERSION "${BOOST_SUPERPROJECT_VERSION}" LANGUAGES CXX)
|
||||
if (BOOST_USE_MODULES)
|
||||
add_library(boost_pfr)
|
||||
target_sources(boost_pfr PUBLIC
|
||||
FILE_SET modules_public TYPE CXX_MODULES FILES
|
||||
${CMAKE_CURRENT_LIST_DIR}/modules/pfr.cppm
|
||||
FILE_SET modules_public TYPE CXX_MODULES FILES modules/boost_pfr.cppm
|
||||
)
|
||||
|
||||
target_compile_features(boost_pfr PUBLIC cxx_std_20)
|
||||
|
||||
@@ -569,19 +569,19 @@ benifits of modules without changing the existing code.
|
||||
[note For better compile times make sure that `import std;` is available when building the `boost.pfr` module (in CMake logs there should be
|
||||
a 'Using `import std;`' message). ]
|
||||
|
||||
If not using CMake, then the module could be build manually from the `module/pfr.cppm` file.
|
||||
If not using CMake, then the module could be build manually from the `modules/boost_pfr.cppm` file.
|
||||
|
||||
For manual module build the following commands could be used for clang compiler:
|
||||
For manual module build the following commands can be used for clang compiler:
|
||||
|
||||
```
|
||||
cd pfr/module
|
||||
clang++ -I ../include -std=c++20 --precompile -x c++-module pfr.cppm
|
||||
clang++ -I ../include -std=c++20 --precompile -x c++-module boost_pfr.cppm
|
||||
```
|
||||
|
||||
After that, the module could be used in the following way:
|
||||
|
||||
```
|
||||
clang++ -std=c++20 -fmodule-file=pfr.pcm pfr.pcm usage_sample.cpp
|
||||
clang++ -std=c++20 -fmodule-file=boost_pfr.pcm boost_pfr.pcm usage_sample.cpp
|
||||
```
|
||||
|
||||
[endsect]
|
||||
|
||||
Reference in New Issue
Block a user