Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The project's CMake does not correctly install the
Boost::ut_moduletarget - it just installs theut.cppmfile. This prevents consumption viafind_package(ut)andtarget_link_libraries(... Boost::ut_module). The module target was also missing some required propertiesinstall()command.cxx_std_23(or any compile feature) was not enabled on the target. This is a requirement ofimport stdCXX_IMPORT_STDtarget property was not set. This is a requirement ofimport stduttarget. Although the relative include (#include "ut.hpp") that previously existed inut.cppmfound the header, this missing link didn't classify the header as aSYSTEMheader, thereby emitting warnings in consuming projectsSolution
The main issues were fixed by appying the respective CMake commands in fa6b5d8.
Subsequent optional commits applied additional cleaning to the CMakeLists.txt.
Correct typos in the
BOOST_UT_USE_WARNINGS_AS_ERRORSoptionConsolidate the configuring of the
utandut_moduletargets into one location, instead of having a smattering ofif(BOOST_UT_DISABLE_MODULE)everywhereThe targets are also now located after
CMAKE_CXX_FLAGSis setup to initialize the target properties.ut.hppis now recorded in a header file set of theuttarget.ut.cppmnow uses fully qualified#include <boost/ut.hpp>.A test of
Boost::ut_moduleTesting
Building, installing, and consuming
Boost::ut_modulefrom a separate project was tested on both fa6b5d8 and the tip of this branch using g++ 16.2.1 and cmake 4.4.3. It doesn't appear that the Bazel or Meson build systems consider the C++ module, and I don't know how to use them. It's also confirmed that consuming projects no longer report warnings from the installedut.hppfile when usingBoost::ut_moduleCMake Configure
cmake -S . -B build -G Ninja \ -D -DCMAKE_BUILD_TYPE=Debug \ -D BOOST_UT_DISABLE_MODULE=OFF \ -D CMAKE_EXPERIMENTAL_CXX_IMPORT_STD=f35a9ac6-8463-4d38-8eec-5d6008153e7dReviewers:
@kris-jusiak
Even on
origin/master, theut_testtest fails during the build withBOOST_UT_ENABLE_RUN_AFTER_BUILD=ON, even though it passes when runningctestdirectly. Since I didn't introduce this, I won't delve into a solution, but here's the output for reference:build_test_fail.log