mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-10 07:40:03 -06:00
Merge topic 'cxxmodules-collapse-source-paths' into release-3.28
0f0d853de7 cmDyndepCollation: collapse full path before looking up
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !9249
This commit is contained in:
@@ -119,7 +119,8 @@ Json::Value CollationInformationCxxModules(
|
||||
|
||||
for (auto const& files_per_dir : files_per_dirs) {
|
||||
for (auto const& file : files_per_dir.second) {
|
||||
auto lookup = sf_map.find(file);
|
||||
auto const full_file = cmSystemTools::CollapseFullPath(file);
|
||||
auto lookup = sf_map.find(full_file);
|
||||
if (lookup == sf_map.end()) {
|
||||
gt->Makefile->IssueMessage(
|
||||
MessageType::FATAL_ERROR,
|
||||
@@ -147,7 +148,7 @@ Json::Value CollationInformationCxxModules(
|
||||
Json::Value& tdi_module_info = tdi_cxx_module_info[obj_path] =
|
||||
Json::objectValue;
|
||||
|
||||
tdi_module_info["source"] = file;
|
||||
tdi_module_info["source"] = full_file;
|
||||
tdi_module_info["bmi-only"] = ct == CompileType::BmiOnly;
|
||||
tdi_module_info["relative-directory"] = files_per_dir.first;
|
||||
tdi_module_info["name"] = file_set->GetName();
|
||||
|
||||
@@ -171,6 +171,7 @@ run_cxx_module_test(scan-with-pch)
|
||||
# Tests which use named modules.
|
||||
if ("named" IN_LIST CMake_TEST_MODULE_COMPILATION)
|
||||
run_cxx_module_test(simple)
|
||||
run_cxx_module_test(file-sets-with-dot)
|
||||
run_cxx_module_test(vs-without-flags)
|
||||
run_cxx_module_test(library library-static -DBUILD_SHARED_LIBS=OFF)
|
||||
run_cxx_module_test(unity-build)
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
cmake_minimum_required(VERSION 3.28)
|
||||
project(cxx_modules_file_sets_with_dot CXX)
|
||||
|
||||
include("${CMAKE_SOURCE_DIR}/../cxx-modules-rules.cmake")
|
||||
|
||||
add_executable(file_sets_with_dot)
|
||||
target_sources(file_sets_with_dot
|
||||
PRIVATE
|
||||
./main.cxx
|
||||
PRIVATE
|
||||
FILE_SET CXX_MODULES
|
||||
BASE_DIRS
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}"
|
||||
FILES
|
||||
./importable.cxx)
|
||||
target_compile_features(file_sets_with_dot PUBLIC cxx_std_20)
|
||||
|
||||
add_test(NAME file_sets_with_dot COMMAND file_sets_with_dot)
|
||||
@@ -0,0 +1,6 @@
|
||||
export module importable;
|
||||
|
||||
export int from_import()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
import importable;
|
||||
|
||||
int main(int argc, char* argv[])
|
||||
{
|
||||
return from_import();
|
||||
}
|
||||
Reference in New Issue
Block a user