From e8efcbec8c7e66e6e7ab45354189b9fc4166938e Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Mon, 15 May 2023 16:50:13 -0400 Subject: iwyu: ignore `std::remove_reference` requirements This removes some includes from some existing files. --- Source/cmCMakeHostSystemInformationCommand.cxx | 1 - Source/cmString.cxx | 1 - Tests/CMakeLib/testStringAlgorithms.cxx | 3 +-- Utilities/IWYU/mapping.imp | 1 + 4 files changed, 2 insertions(+), 4 deletions(-) diff --git a/Source/cmCMakeHostSystemInformationCommand.cxx b/Source/cmCMakeHostSystemInformationCommand.cxx index 8bfd7c8..1c00f15 100644 --- a/Source/cmCMakeHostSystemInformationCommand.cxx +++ b/Source/cmCMakeHostSystemInformationCommand.cxx @@ -8,7 +8,6 @@ #include #include #include -#include #include #include diff --git a/Source/cmString.cxx b/Source/cmString.cxx index aefaa64..f7f6293 100644 --- a/Source/cmString.cxx +++ b/Source/cmString.cxx @@ -9,7 +9,6 @@ #include #include #include -#include namespace cm { diff --git a/Tests/CMakeLib/testStringAlgorithms.cxx b/Tests/CMakeLib/testStringAlgorithms.cxx index 1bb23df..78442ba 100644 --- a/Tests/CMakeLib/testStringAlgorithms.cxx +++ b/Tests/CMakeLib/testStringAlgorithms.cxx @@ -1,12 +1,11 @@ /* Distributed under the OSI-approved BSD 3-Clause License. See accompanying file Copyright.txt or https://cmake.org/licensing for details. */ -#include // IWYU pragma: keep +#include "cmConfigure.h" // IWYU pragma: keep #include #include #include -#include #include #include diff --git a/Utilities/IWYU/mapping.imp b/Utilities/IWYU/mapping.imp index 6443632..366c517 100644 --- a/Utilities/IWYU/mapping.imp +++ b/Utilities/IWYU/mapping.imp @@ -99,6 +99,7 @@ { symbol: [ "std::enable_if > >::type", private, "\"cmConfigure.h\"", public ] }, { symbol: [ "std::enable_if > >::type", private, "\"cmConfigure.h\"", public ] }, { symbol: [ "__gnu_cxx::__enable_if::__type", private, "\"cmConfigure.h\"", public ] }, + { symbol: [ "std::remove_reference, std::allocator > &>::type", private, "\"cmConfigure.h\"", public ] }, { symbol: [ "std::remove_reference::type", private, "\"cmConfigure.h\"", public ] }, # Wrappers for 3rd-party libraries -- cgit v0.12 From 8207a3a266d85e64532a2a69ccea344fd645fe53 Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Sun, 14 May 2023 17:23:19 -0400 Subject: cmDyndepCollation: add a query for visibility of an object's modules This will be used to hide private modules from the view of consuming targets. --- Source/cmDyndepCollation.cxx | 17 +++++++++++++++++ Source/cmDyndepCollation.h | 2 ++ 2 files changed, 19 insertions(+) diff --git a/Source/cmDyndepCollation.cxx b/Source/cmDyndepCollation.cxx index 53a262b..f45d81b 100644 --- a/Source/cmDyndepCollation.cxx +++ b/Source/cmDyndepCollation.cxx @@ -623,3 +623,20 @@ bool cmDyndepCollation::WriteDyndepMetadata( return result; } + +bool cmDyndepCollation::IsObjectPrivate( + std::string const& object, cmCxxModuleExportInfo const& export_info) +{ +#ifdef _WIN32 + std::string output_path = object; + cmSystemTools::ConvertToUnixSlashes(output_path); +#else + std::string const& output_path = object; +#endif + auto fileset_info_itr = export_info.ObjectToFileSet.find(output_path); + if (fileset_info_itr == export_info.ObjectToFileSet.end()) { + return false; + } + auto const& file_set = fileset_info_itr->second; + return !cmFileSetVisibilityIsForInterface(file_set.Visibility); +} diff --git a/Source/cmDyndepCollation.h b/Source/cmDyndepCollation.h index e70ac09..48afe2b 100644 --- a/Source/cmDyndepCollation.h +++ b/Source/cmDyndepCollation.h @@ -49,4 +49,6 @@ struct cmDyndepCollation std::vector const& objects, cmCxxModuleExportInfo const& export_info, cmDyndepMetadataCallbacks const& cb); + static bool IsObjectPrivate(std::string const& object, + cmCxxModuleExportInfo const& export_info); }; -- cgit v0.12 From 56f7d6f827290dd7d4d5c6edf0fe12568d4a819e Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Mon, 15 May 2023 14:34:48 -0400 Subject: cmCxxModuleMapper: add a structure to represent BMI locations This structure allows representing whether a module is private in order to give a more useful error message when its usage is attempted from another target. --- Source/cmCxxModuleMapper.cxx | 44 ++++++++++++++++++++++++++++++++++++++++++++ Source/cmCxxModuleMapper.h | 17 +++++++++++++++++ 2 files changed, 61 insertions(+) diff --git a/Source/cmCxxModuleMapper.cxx b/Source/cmCxxModuleMapper.cxx index 59bf4c7..e320f54 100644 --- a/Source/cmCxxModuleMapper.cxx +++ b/Source/cmCxxModuleMapper.cxx @@ -17,6 +17,50 @@ #include "cmStringAlgorithms.h" #include "cmSystemTools.h" +CxxBmiLocation::CxxBmiLocation() = default; + +CxxBmiLocation::CxxBmiLocation(std::string path) + : BmiLocation(std::move(path)) +{ +} + +CxxBmiLocation CxxBmiLocation::Unknown() +{ + return {}; +} + +CxxBmiLocation CxxBmiLocation::Private() +{ + return { std::string{} }; +} + +CxxBmiLocation CxxBmiLocation::Known(std::string path) +{ + return { std::move(path) }; +} + +bool CxxBmiLocation::IsKnown() const +{ + return this->BmiLocation.has_value(); +} + +bool CxxBmiLocation::IsPrivate() const +{ + if (auto const& loc = this->BmiLocation) { + return loc->empty(); + } + return false; +} + +std::string const& CxxBmiLocation::Location() const +{ + if (auto const& loc = this->BmiLocation) { + return *loc; + } + static std::string empty; + return empty; +} + cm::optional CxxModuleLocations::BmiGeneratorPathForModule( std::string const& logical_name) const { diff --git a/Source/cmCxxModuleMapper.h b/Source/cmCxxModuleMapper.h index 0f453b0..f405054 100644 --- a/Source/cmCxxModuleMapper.h +++ b/Source/cmCxxModuleMapper.h @@ -22,6 +22,23 @@ enum class CxxModuleMapFormat Msvc, }; +struct CxxBmiLocation +{ + static CxxBmiLocation Unknown(); + static CxxBmiLocation Private(); + static CxxBmiLocation Known(std::string path); + + bool IsKnown() const; + bool IsPrivate() const; + std::string const& Location() const; + +private: + CxxBmiLocation(); + CxxBmiLocation(std::string path); + + cm::optional BmiLocation; +}; + struct CxxModuleLocations { // The path from which all relative paths should be computed. If -- cgit v0.12 From 18f87c87f86473dd2106b6d8ab7acc9def99b9b1 Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Sun, 14 May 2023 17:24:02 -0400 Subject: cmCxxModuleMapper: track whether modules are private or not This allows collation to give a useful error message when it finds usage of a private module rather than collation just not informing the compilation and the compiler erroring out about not being able to import unknown modules (which exists, but it was not told about due to visibility). Fixes: #24652 --- Source/cmCxxModuleMapper.cxx | 65 +++++++++++++++++++++++++-------------- Source/cmCxxModuleMapper.h | 5 ++- Source/cmGlobalNinjaGenerator.cxx | 44 ++++++++++++++++++++------ 3 files changed, 78 insertions(+), 36 deletions(-) diff --git a/Source/cmCxxModuleMapper.cxx b/Source/cmCxxModuleMapper.cxx index e320f54..e836a2a 100644 --- a/Source/cmCxxModuleMapper.cxx +++ b/Source/cmCxxModuleMapper.cxx @@ -61,13 +61,15 @@ std::string const& CxxBmiLocation::Location() const return empty; } -cm::optional CxxModuleLocations::BmiGeneratorPathForModule( +CxxBmiLocation CxxModuleLocations::BmiGeneratorPathForModule( std::string const& logical_name) const { - if (auto l = this->BmiLocationForModule(logical_name)) { - return this->PathForGenerator(std::move(*l)); + auto bmi_loc = this->BmiLocationForModule(logical_name); + if (bmi_loc.IsKnown() && !bmi_loc.IsPrivate()) { + bmi_loc = + CxxBmiLocation::Known(this->PathForGenerator(bmi_loc.Location())); } - return {}; + return bmi_loc; } namespace { @@ -86,18 +88,21 @@ std::string CxxModuleMapContentClang(CxxModuleLocations const& loc, // A series of flags which tell the compiler where to look for modules. for (auto const& p : obj.Provides) { - if (auto bmi_loc = loc.BmiGeneratorPathForModule(p.LogicalName)) { + auto bmi_loc = loc.BmiGeneratorPathForModule(p.LogicalName); + if (bmi_loc.IsKnown()) { // Force the TU to be considered a C++ module source file regardless of // extension. mm << "-x c++-module\n"; - mm << "-fmodule-output=" << *bmi_loc << '\n'; + mm << "-fmodule-output=" << bmi_loc.Location() << '\n'; break; } } for (auto const& r : obj.Requires) { - if (auto bmi_loc = loc.BmiGeneratorPathForModule(r.LogicalName)) { - mm << "-fmodule-file=" << r.LogicalName << "=" << *bmi_loc << '\n'; + auto bmi_loc = loc.BmiGeneratorPathForModule(r.LogicalName); + if (bmi_loc.IsKnown()) { + mm << "-fmodule-file=" << r.LogicalName << "=" << bmi_loc.Location() + << '\n'; } } @@ -120,13 +125,15 @@ std::string CxxModuleMapContentGcc(CxxModuleLocations const& loc, mm << "$root " << loc.RootDirectory << "\n"; for (auto const& p : obj.Provides) { - if (auto bmi_loc = loc.BmiGeneratorPathForModule(p.LogicalName)) { - mm << p.LogicalName << ' ' << *bmi_loc << '\n'; + auto bmi_loc = loc.BmiGeneratorPathForModule(p.LogicalName); + if (bmi_loc.IsKnown()) { + mm << p.LogicalName << ' ' << bmi_loc.Location() << '\n'; } } for (auto const& r : obj.Requires) { - if (auto bmi_loc = loc.BmiGeneratorPathForModule(r.LogicalName)) { - mm << r.LogicalName << ' ' << *bmi_loc << '\n'; + auto bmi_loc = loc.BmiGeneratorPathForModule(r.LogicalName); + if (bmi_loc.IsKnown()) { + mm << r.LogicalName << ' ' << bmi_loc.Location() << '\n'; } } @@ -167,8 +174,9 @@ std::string CxxModuleMapContentMsvc(CxxModuleLocations const& loc, mm << "-internalPartition\n"; } - if (auto bmi_loc = loc.BmiGeneratorPathForModule(p.LogicalName)) { - mm << "-ifcOutput " << *bmi_loc << '\n'; + auto bmi_loc = loc.BmiGeneratorPathForModule(p.LogicalName); + if (bmi_loc.IsKnown()) { + mm << "-ifcOutput " << bmi_loc.Location() << '\n'; } } @@ -176,10 +184,11 @@ std::string CxxModuleMapContentMsvc(CxxModuleLocations const& loc, std::set transitive_usage_names; for (auto const& r : obj.Requires) { - if (auto bmi_loc = loc.BmiGeneratorPathForModule(r.LogicalName)) { + auto bmi_loc = loc.BmiGeneratorPathForModule(r.LogicalName); + if (bmi_loc.IsKnown()) { auto flag = flag_for_method(r.Method); - mm << flag << ' ' << r.LogicalName << '=' << *bmi_loc << "\n"; + mm << flag << ' ' << r.LogicalName << '=' << bmi_loc.Location() << "\n"; transitive_usage_directs.insert(r.LogicalName); // Insert transitive usages. @@ -281,18 +290,28 @@ std::set CxxModuleUsageSeed( for (cmScanDepInfo const& object : objects) { // Add references for each of the provided modules. for (auto const& p : object.Provides) { - if (auto bmi_loc = loc.BmiGeneratorPathForModule(p.LogicalName)) { + auto bmi_loc = loc.BmiGeneratorPathForModule(p.LogicalName); + if (bmi_loc.IsKnown()) { // XXX(cxx-modules): How to support header units? - usages.AddReference(p.LogicalName, *bmi_loc, LookupMethod::ByName); + usages.AddReference(p.LogicalName, bmi_loc.Location(), + LookupMethod::ByName); } } // For each requires, pull in what is required. for (auto const& r : object.Requires) { - // Find transitive usages. - auto transitive_usages = usages.Usage.find(r.LogicalName); // Find the required name in the current target. auto bmi_loc = loc.BmiGeneratorPathForModule(r.LogicalName); + if (bmi_loc.IsPrivate()) { + cmSystemTools::Error( + cmStrCat("Unable to use module '", r.LogicalName, + "' as it is 'PRIVATE' and therefore not accessible outside " + "of its owning target.")); + continue; + } + + // Find transitive usages. + auto transitive_usages = usages.Usage.find(r.LogicalName); for (auto const& p : object.Provides) { auto& this_usages = usages.Usage[p.LogicalName]; @@ -304,14 +323,14 @@ std::set CxxModuleUsageSeed( if (transitive_usages != usages.Usage.end()) { this_usages.insert(transitive_usages->second.begin(), transitive_usages->second.end()); - } else if (bmi_loc) { + } else if (bmi_loc.IsKnown()) { // Mark that we need to update transitive usages later. internal_usages[p.LogicalName].insert(r.LogicalName); } } - if (bmi_loc) { - usages.AddReference(r.LogicalName, *bmi_loc, r.Method); + if (bmi_loc.IsKnown()) { + usages.AddReference(r.LogicalName, bmi_loc.Location(), r.Method); } } } diff --git a/Source/cmCxxModuleMapper.h b/Source/cmCxxModuleMapper.h index f405054..ef01e48 100644 --- a/Source/cmCxxModuleMapper.h +++ b/Source/cmCxxModuleMapper.h @@ -50,12 +50,11 @@ struct CxxModuleLocations std::function PathForGenerator; // Lookup the BMI location of a logical module name. - std::function(std::string const&)> - BmiLocationForModule; + std::function BmiLocationForModule; // Returns the generator path (if known) for the BMI given a // logical module name. - cm::optional BmiGeneratorPathForModule( + CxxBmiLocation BmiGeneratorPathForModule( std::string const& logical_name) const; }; diff --git a/Source/cmGlobalNinjaGenerator.cxx b/Source/cmGlobalNinjaGenerator.cxx index 7626fa3..21d1e6d 100644 --- a/Source/cmGlobalNinjaGenerator.cxx +++ b/Source/cmGlobalNinjaGenerator.cxx @@ -2526,7 +2526,12 @@ bool cmGlobalNinjaGenerator::WriteDyndepFile( CxxModuleUsage usages; // Map from module name to module file path, if known. - std::map mod_files; + struct AvailableModuleInfo + { + std::string BmiPath; + bool IsPrivate; + }; + std::map mod_files; // Populate the module map with those provided by linked targets first. for (std::string const& linked_target_dir : linked_target_dirs) { @@ -2550,7 +2555,15 @@ bool cmGlobalNinjaGenerator::WriteDyndepFile( Json::Value const& target_modules = ltm["modules"]; if (target_modules.isObject()) { for (auto i = target_modules.begin(); i != target_modules.end(); ++i) { - mod_files[i.key().asString()] = i->asString(); + Json::Value const& visible_module = *i; + if (visible_module.isObject()) { + Json::Value const& bmi_path = visible_module["bmi"]; + Json::Value const& is_private = visible_module["is-private"]; + mod_files[i.key().asString()] = AvailableModuleInfo{ + bmi_path.asString(), + is_private.asBool(), + }; + } } } Json::Value const& target_modules_references = ltm["references"]; @@ -2631,8 +2644,15 @@ bool cmGlobalNinjaGenerator::WriteDyndepFile( cmSystemTools::ReplaceString(safe_logical_name, ":", "-"); mod = cmStrCat(module_dir, safe_logical_name, module_ext); } - mod_files[p.LogicalName] = mod; - target_modules[p.LogicalName] = mod; + mod_files[p.LogicalName] = AvailableModuleInfo{ + mod, + false, // Always visible within our own target. + }; + Json::Value& module_info = target_modules[p.LogicalName] = + Json::objectValue; + module_info["bmi"] = mod; + module_info["is-private"] = + cmDyndepCollation::IsObjectPrivate(object.PrimaryOutput, export_info); } } @@ -2652,12 +2672,15 @@ bool cmGlobalNinjaGenerator::WriteDyndepFile( return path; }; locs.BmiLocationForModule = - [&mod_files](std::string const& logical) -> cm::optional { + [&mod_files](std::string const& logical) -> CxxBmiLocation { auto m = mod_files.find(logical); if (m != mod_files.end()) { - return m->second; + if (m->second.IsPrivate) { + return CxxBmiLocation::Private(); + } + return CxxBmiLocation::Known(m->second.BmiPath); } - return {}; + return CxxBmiLocation::Unknown(); }; // Insert information about the current target's modules. @@ -2679,13 +2702,14 @@ bool cmGlobalNinjaGenerator::WriteDyndepFile( build.ImplicitOuts.clear(); for (auto const& p : object.Provides) { build.ImplicitOuts.push_back( - this->ConvertToNinjaPath(mod_files[p.LogicalName])); + this->ConvertToNinjaPath(mod_files[p.LogicalName].BmiPath)); } build.ImplicitDeps.clear(); for (auto const& r : object.Requires) { auto mit = mod_files.find(r.LogicalName); if (mit != mod_files.end()) { - build.ImplicitDeps.push_back(this->ConvertToNinjaPath(mit->second)); + build.ImplicitDeps.push_back( + this->ConvertToNinjaPath(mit->second.BmiPath)); } } build.Variables.clear(); @@ -2751,7 +2775,7 @@ bool cmGlobalNinjaGenerator::WriteDyndepFile( [mod_files](std::string const& name) -> cm::optional { auto m = mod_files.find(name); if (m != mod_files.end()) { - return m->second; + return m->second.BmiPath; } return {}; }; -- cgit v0.12 From 69e452524129552e4891feb7949c4af1567a525f Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Sun, 14 May 2023 17:24:41 -0400 Subject: Tests/CXXModules: add example for private modules between targets Adapted from the example in issue #24652 by Ivan Garramona. --- Tests/RunCMake/CXXModules/RunCMakeTest.cmake | 3 +++ .../examples/req-private-other-target-build-result.txt | 1 + .../examples/req-private-other-target-build-stdout.txt | 1 + .../examples/req-private-other-target-stderr.txt | 9 +++++++++ .../examples/req-private-other-target/CMakeLists.txt | 16 ++++++++++++++++ .../CXXModules/examples/req-private-other-target/lib.cxx | 1 + .../examples/req-private-other-target/main.cxx | 7 +++++++ .../examples/req-private-other-target/priv.cxx | 1 + 8 files changed, 39 insertions(+) create mode 100644 Tests/RunCMake/CXXModules/examples/req-private-other-target-build-result.txt create mode 100644 Tests/RunCMake/CXXModules/examples/req-private-other-target-build-stdout.txt create mode 100644 Tests/RunCMake/CXXModules/examples/req-private-other-target-stderr.txt create mode 100644 Tests/RunCMake/CXXModules/examples/req-private-other-target/CMakeLists.txt create mode 100644 Tests/RunCMake/CXXModules/examples/req-private-other-target/lib.cxx create mode 100644 Tests/RunCMake/CXXModules/examples/req-private-other-target/main.cxx create mode 100644 Tests/RunCMake/CXXModules/examples/req-private-other-target/priv.cxx diff --git a/Tests/RunCMake/CXXModules/RunCMakeTest.cmake b/Tests/RunCMake/CXXModules/RunCMakeTest.cmake index c1129ca..b088724 100644 --- a/Tests/RunCMake/CXXModules/RunCMakeTest.cmake +++ b/Tests/RunCMake/CXXModules/RunCMakeTest.cmake @@ -155,6 +155,9 @@ endif () # Tests which require collation work. if ("collation" IN_LIST CMake_TEST_MODULE_COMPILATION) run_cxx_module_test(public-req-private) + set(RunCMake_CXXModules_NO_TEST 1) + run_cxx_module_test(req-private-other-target) + unset(RunCMake_CXXModules_NO_TEST) endif () # Tests which use named modules in shared libraries. diff --git a/Tests/RunCMake/CXXModules/examples/req-private-other-target-build-result.txt b/Tests/RunCMake/CXXModules/examples/req-private-other-target-build-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/CXXModules/examples/req-private-other-target-build-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CXXModules/examples/req-private-other-target-build-stdout.txt b/Tests/RunCMake/CXXModules/examples/req-private-other-target-build-stdout.txt new file mode 100644 index 0000000..912c2e9 --- /dev/null +++ b/Tests/RunCMake/CXXModules/examples/req-private-other-target-build-stdout.txt @@ -0,0 +1 @@ +((Ninja generators)?(Unable to use module 'lib.priv' as it is 'PRIVATE' and therefore not accessible outside of its owning target.)) diff --git a/Tests/RunCMake/CXXModules/examples/req-private-other-target-stderr.txt b/Tests/RunCMake/CXXModules/examples/req-private-other-target-stderr.txt new file mode 100644 index 0000000..5e4392a --- /dev/null +++ b/Tests/RunCMake/CXXModules/examples/req-private-other-target-stderr.txt @@ -0,0 +1,9 @@ +CMake Warning \(dev\) at CMakeLists.txt:7 \(target_sources\): + CMake's C\+\+ module support is experimental. It is meant only for + experimentation and feedback to CMake developers. +This warning is for project developers. Use -Wno-dev to suppress it. + +CMake Warning \(dev\): + C\+\+20 modules support via CMAKE_EXPERIMENTAL_CXX_MODULE_DYNDEP is + experimental. It is meant only for compiler developers to try. +This warning is for project developers. Use -Wno-dev to suppress it. diff --git a/Tests/RunCMake/CXXModules/examples/req-private-other-target/CMakeLists.txt b/Tests/RunCMake/CXXModules/examples/req-private-other-target/CMakeLists.txt new file mode 100644 index 0000000..910c515 --- /dev/null +++ b/Tests/RunCMake/CXXModules/examples/req-private-other-target/CMakeLists.txt @@ -0,0 +1,16 @@ +cmake_minimum_required(VERSION 3.26) +project(req_private_other_target CXX) + +include("${CMAKE_SOURCE_DIR}/../cxx-modules-rules.cmake") + +add_library(lib) +target_sources(lib + PUBLIC FILE_SET pub TYPE CXX_MODULES FILES lib.cxx + PRIVATE FILE_SET priv TYPE CXX_MODULES FILES priv.cxx +) +target_compile_features(lib PUBLIC cxx_std_20) + +add_executable(exe main.cxx) +target_link_libraries(exe PRIVATE lib) + +add_test(NAME exe COMMAND exe) diff --git a/Tests/RunCMake/CXXModules/examples/req-private-other-target/lib.cxx b/Tests/RunCMake/CXXModules/examples/req-private-other-target/lib.cxx new file mode 100644 index 0000000..066c2e1 --- /dev/null +++ b/Tests/RunCMake/CXXModules/examples/req-private-other-target/lib.cxx @@ -0,0 +1 @@ +export module lib; diff --git a/Tests/RunCMake/CXXModules/examples/req-private-other-target/main.cxx b/Tests/RunCMake/CXXModules/examples/req-private-other-target/main.cxx new file mode 100644 index 0000000..08b08ff --- /dev/null +++ b/Tests/RunCMake/CXXModules/examples/req-private-other-target/main.cxx @@ -0,0 +1,7 @@ +import lib; +import lib.priv; + +int main(int argc, char const* argv[]) +{ + return 0; +} diff --git a/Tests/RunCMake/CXXModules/examples/req-private-other-target/priv.cxx b/Tests/RunCMake/CXXModules/examples/req-private-other-target/priv.cxx new file mode 100644 index 0000000..a7cad3b --- /dev/null +++ b/Tests/RunCMake/CXXModules/examples/req-private-other-target/priv.cxx @@ -0,0 +1 @@ +export module lib.priv; -- cgit v0.12 From d38779df2a03b984901bc310ec7c370d35a09731 Mon Sep 17 00:00:00 2001 From: Brad King Date: Thu, 18 May 2023 08:44:23 -0400 Subject: ci: Enable RunCMake.CXXModules collation cases in clang jobs Since commit 069a32b03c (Tests/RunCMake/CXXModules: split out collation-requiring tests, 2022-11-28, v3.26.0-rc1~243^2~4) these cases require explicit configuration. --- .gitlab/ci/configure_linux_clang_cxx_modules_ninja.cmake | 2 +- .gitlab/ci/configure_linux_clang_cxx_modules_ninja_multi.cmake | 2 +- .gitlab/ci/configure_windows_clang_ninja.cmake | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.gitlab/ci/configure_linux_clang_cxx_modules_ninja.cmake b/.gitlab/ci/configure_linux_clang_cxx_modules_ninja.cmake index 43bccdb..671c625 100644 --- a/.gitlab/ci/configure_linux_clang_cxx_modules_ninja.cmake +++ b/.gitlab/ci/configure_linux_clang_cxx_modules_ninja.cmake @@ -1,4 +1,4 @@ -set(CMake_TEST_MODULE_COMPILATION "named,partitions,internal_partitions,export_bmi,install_bmi,shared" CACHE STRING "") +set(CMake_TEST_MODULE_COMPILATION "named,collation,partitions,internal_partitions,export_bmi,install_bmi,shared" CACHE STRING "") set(CMake_TEST_MODULE_COMPILATION_RULES "${CMAKE_CURRENT_LIST_DIR}/cxx_modules_rules_clang.cmake" CACHE STRING "") include("${CMAKE_CURRENT_LIST_DIR}/configure_external_test.cmake") diff --git a/.gitlab/ci/configure_linux_clang_cxx_modules_ninja_multi.cmake b/.gitlab/ci/configure_linux_clang_cxx_modules_ninja_multi.cmake index 43bccdb..671c625 100644 --- a/.gitlab/ci/configure_linux_clang_cxx_modules_ninja_multi.cmake +++ b/.gitlab/ci/configure_linux_clang_cxx_modules_ninja_multi.cmake @@ -1,4 +1,4 @@ -set(CMake_TEST_MODULE_COMPILATION "named,partitions,internal_partitions,export_bmi,install_bmi,shared" CACHE STRING "") +set(CMake_TEST_MODULE_COMPILATION "named,collation,partitions,internal_partitions,export_bmi,install_bmi,shared" CACHE STRING "") set(CMake_TEST_MODULE_COMPILATION_RULES "${CMAKE_CURRENT_LIST_DIR}/cxx_modules_rules_clang.cmake" CACHE STRING "") include("${CMAKE_CURRENT_LIST_DIR}/configure_external_test.cmake") diff --git a/.gitlab/ci/configure_windows_clang_ninja.cmake b/.gitlab/ci/configure_windows_clang_ninja.cmake index a66e302..f864dde 100644 --- a/.gitlab/ci/configure_windows_clang_ninja.cmake +++ b/.gitlab/ci/configure_windows_clang_ninja.cmake @@ -1,5 +1,5 @@ if("$ENV{CMAKE_CI_BUILD_NAME}" MATCHES "(^|_)gnu(_|$)") - set(CMake_TEST_MODULE_COMPILATION "named,partitions,internal_partitions,export_bmi,install_bmi,shared" CACHE STRING "") + set(CMake_TEST_MODULE_COMPILATION "named,collation,partitions,internal_partitions,export_bmi,install_bmi,shared" CACHE STRING "") set(CMake_TEST_MODULE_COMPILATION_RULES "${CMAKE_CURRENT_LIST_DIR}/cxx_modules_rules_clang.cmake" CACHE STRING "") endif() include("${CMAKE_CURRENT_LIST_DIR}/configure_windows_clang_common.cmake") -- cgit v0.12