From 3e5c4743370a434d6e47b8f01c40dd2ab4f734b6 Mon Sep 17 00:00:00 2001 From: Antony Polukhin Date: Tue, 29 Apr 2025 22:04:16 +0300 Subject: [PATCH] Minor fixes for modules (#200) --- CMakeLists.txt | 3 +-- doc/pfr.qbk | 8 ++++---- modules/{pfr.cppm => boost_pfr.cppm} | 0 3 files changed, 5 insertions(+), 6 deletions(-) rename modules/{pfr.cppm => boost_pfr.cppm} (100%) diff --git a/CMakeLists.txt b/CMakeLists.txt index f119fc5..aef0bc3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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) diff --git a/doc/pfr.qbk b/doc/pfr.qbk index a617863..4e10e68 100644 --- a/doc/pfr.qbk +++ b/doc/pfr.qbk @@ -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] diff --git a/modules/pfr.cppm b/modules/boost_pfr.cppm similarity index 100% rename from modules/pfr.cppm rename to modules/boost_pfr.cppm