diff options
author | Tyler <tylerbrawl@gmail.com> | 2023-05-13 00:58:35 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2023-05-23 19:01:52 (GMT) |
commit | 28ece63fee1d5b4cd37f79ea5c7f078509f44bcd (patch) | |
tree | b2eb44da3871af6a61ece1da96c9369bade50b65 /Tests | |
parent | f2a699261b9d3d494bc791caad2d8f1fb21d6b4b (diff) | |
download | CMake-28ece63fee1d5b4cd37f79ea5c7f078509f44bcd.zip CMake-28ece63fee1d5b4cd37f79ea5c7f078509f44bcd.tar.gz CMake-28ece63fee1d5b4cd37f79ea5c7f078509f44bcd.tar.bz2 |
cxxmodules: Fix exported path to installed module sources in subdirs
When generating the `IMPORTED_CXX_MODULES_[CONFIG]` target property,
there was a missing path separator after a non-empty relative directory
part of the path to a module source file.
Co-authored-by: Brad King <brad.king@kitware.com>
Diffstat (limited to 'Tests')
18 files changed, 64 insertions, 6 deletions
diff --git a/Tests/RunCMake/CXXModules/examples/export-bmi-and-interface-build/CMakeLists.txt b/Tests/RunCMake/CXXModules/examples/export-bmi-and-interface-build/CMakeLists.txt index 62971a3..71e7b62 100644 --- a/Tests/RunCMake/CXXModules/examples/export-bmi-and-interface-build/CMakeLists.txt +++ b/Tests/RunCMake/CXXModules/examples/export-bmi-and-interface-build/CMakeLists.txt @@ -18,7 +18,9 @@ target_sources(export_bmi_and_interfaces BASE_DIRS "${CMAKE_CURRENT_SOURCE_DIR}" FILES - importable.cxx) + importable.cxx + subdir/importable.cxx + ) target_compile_features(export_bmi_and_interfaces PUBLIC cxx_std_20) add_library(no_modules STATIC no_modules.cxx) diff --git a/Tests/RunCMake/CXXModules/examples/export-bmi-and-interface-build/subdir/importable.cxx b/Tests/RunCMake/CXXModules/examples/export-bmi-and-interface-build/subdir/importable.cxx new file mode 100644 index 0000000..07d6af6 --- /dev/null +++ b/Tests/RunCMake/CXXModules/examples/export-bmi-and-interface-build/subdir/importable.cxx @@ -0,0 +1,6 @@ +export module subdir_importable; + +export int from_subdir() +{ + return 0; +} diff --git a/Tests/RunCMake/CXXModules/examples/export-bmi-and-interface-build/test/CMakeLists.txt b/Tests/RunCMake/CXXModules/examples/export-bmi-and-interface-build/test/CMakeLists.txt index a0cf4d9..3cb185c 100644 --- a/Tests/RunCMake/CXXModules/examples/export-bmi-and-interface-build/test/CMakeLists.txt +++ b/Tests/RunCMake/CXXModules/examples/export-bmi-and-interface-build/test/CMakeLists.txt @@ -21,6 +21,7 @@ get_property(file_set_files TARGET CXXModules::export_bmi_and_interfaces PROPERTY CXX_MODULE_SET_modules) set(expected_file_set_files "${expected_source_dir}/importable.cxx" + "${expected_source_dir}/subdir/importable.cxx" ) if (NOT file_set_files STREQUAL "${expected_file_set_files}") message(FATAL_ERROR @@ -31,6 +32,7 @@ get_property(imported_modules TARGET CXXModules::export_bmi_and_interfaces PROPERTY IMPORTED_CXX_MODULES_DEBUG) set(expected_imported_modules "importable=${expected_source_dir}/importable.cxx,${expected_binary_dir}/CMakeFiles/export_bmi_and_interfaces.dir(/Debug)?/importable.(gcm|pcm|ifc)" + "subdir_importable=${expected_source_dir}/subdir/importable.cxx,${expected_binary_dir}/CMakeFiles/export_bmi_and_interfaces.dir(/Debug)?/subdir_importable.(gcm|pcm|ifc)" ) if (NOT imported_modules MATCHES "^${expected_imported_modules}$") message(FATAL_ERROR diff --git a/Tests/RunCMake/CXXModules/examples/export-bmi-and-interface-install/CMakeLists.txt b/Tests/RunCMake/CXXModules/examples/export-bmi-and-interface-install/CMakeLists.txt index bc19d93..e675507 100644 --- a/Tests/RunCMake/CXXModules/examples/export-bmi-and-interface-install/CMakeLists.txt +++ b/Tests/RunCMake/CXXModules/examples/export-bmi-and-interface-install/CMakeLists.txt @@ -18,7 +18,9 @@ target_sources(export_bmi_and_interfaces BASE_DIRS "${CMAKE_CURRENT_SOURCE_DIR}" FILES - importable.cxx) + importable.cxx + subdir/importable.cxx + ) target_compile_features(export_bmi_and_interfaces PUBLIC cxx_std_20) add_library(no_modules STATIC no_modules.cxx) diff --git a/Tests/RunCMake/CXXModules/examples/export-bmi-and-interface-install/subdir/importable.cxx b/Tests/RunCMake/CXXModules/examples/export-bmi-and-interface-install/subdir/importable.cxx new file mode 100644 index 0000000..07d6af6 --- /dev/null +++ b/Tests/RunCMake/CXXModules/examples/export-bmi-and-interface-install/subdir/importable.cxx @@ -0,0 +1,6 @@ +export module subdir_importable; + +export int from_subdir() +{ + return 0; +} diff --git a/Tests/RunCMake/CXXModules/examples/export-bmi-and-interface-install/test/CMakeLists.txt b/Tests/RunCMake/CXXModules/examples/export-bmi-and-interface-install/test/CMakeLists.txt index 98f6e52..7b36f8c 100644 --- a/Tests/RunCMake/CXXModules/examples/export-bmi-and-interface-install/test/CMakeLists.txt +++ b/Tests/RunCMake/CXXModules/examples/export-bmi-and-interface-install/test/CMakeLists.txt @@ -21,6 +21,7 @@ get_property(file_set_files TARGET CXXModules::export_bmi_and_interfaces PROPERTY CXX_MODULE_SET_modules) set(expected_file_set_files "${expected_source_dir}/importable.cxx" + "${expected_source_dir}/subdir/importable.cxx" ) if (NOT file_set_files STREQUAL "${expected_file_set_files}") message(FATAL_ERROR @@ -31,6 +32,7 @@ get_property(imported_modules TARGET CXXModules::export_bmi_and_interfaces PROPERTY IMPORTED_CXX_MODULES_DEBUG) set(expected_imported_modules "importable=${expected_source_dir}/importable.cxx,${expected_binary_dir}/importable.(gcm|pcm|ifc)" + "subdir_importable=${expected_source_dir}/subdir/importable.cxx,${expected_binary_dir}/subdir_importable.(gcm|pcm|ifc)" ) if (NOT imported_modules MATCHES "^${expected_imported_modules}$") message(FATAL_ERROR diff --git a/Tests/RunCMake/CXXModules/examples/export-interface-build/CMakeLists.txt b/Tests/RunCMake/CXXModules/examples/export-interface-build/CMakeLists.txt index 62352ff..136e885 100644 --- a/Tests/RunCMake/CXXModules/examples/export-interface-build/CMakeLists.txt +++ b/Tests/RunCMake/CXXModules/examples/export-interface-build/CMakeLists.txt @@ -18,7 +18,9 @@ target_sources(export_interfaces BASE_DIRS "${CMAKE_CURRENT_SOURCE_DIR}" FILES - importable.cxx) + importable.cxx + subdir/importable.cxx + ) target_compile_features(export_interfaces PUBLIC cxx_std_20) add_library(no_modules STATIC no_modules.cxx) diff --git a/Tests/RunCMake/CXXModules/examples/export-interface-build/subdir/importable.cxx b/Tests/RunCMake/CXXModules/examples/export-interface-build/subdir/importable.cxx new file mode 100644 index 0000000..07d6af6 --- /dev/null +++ b/Tests/RunCMake/CXXModules/examples/export-interface-build/subdir/importable.cxx @@ -0,0 +1,6 @@ +export module subdir_importable; + +export int from_subdir() +{ + return 0; +} diff --git a/Tests/RunCMake/CXXModules/examples/export-interface-build/test/CMakeLists.txt b/Tests/RunCMake/CXXModules/examples/export-interface-build/test/CMakeLists.txt index 6005676..1874c97 100644 --- a/Tests/RunCMake/CXXModules/examples/export-interface-build/test/CMakeLists.txt +++ b/Tests/RunCMake/CXXModules/examples/export-interface-build/test/CMakeLists.txt @@ -21,6 +21,7 @@ get_property(file_set_files TARGET CXXModules::export_interfaces PROPERTY CXX_MODULE_SET_modules) set(expected_file_set_files "${expected_source_dir}/importable.cxx" + "${expected_source_dir}/subdir/importable.cxx" ) if (NOT file_set_files STREQUAL "${expected_file_set_files}") message(FATAL_ERROR @@ -31,6 +32,7 @@ get_property(imported_modules TARGET CXXModules::export_interfaces PROPERTY IMPORTED_CXX_MODULES_DEBUG) set(expected_imported_modules "importable=${expected_source_dir}/importable.cxx,${expected_binary_dir}/CMakeFiles/export_interfaces.dir(/Debug)?/importable.(gcm|pcm|ifc)" + "subdir_importable=${expected_source_dir}/subdir/importable.cxx,${expected_binary_dir}/CMakeFiles/export_interfaces.dir(/Debug)?/subdir_importable.(gcm|pcm|ifc)" ) if (NOT imported_modules MATCHES "^${expected_imported_modules}$") message(FATAL_ERROR diff --git a/Tests/RunCMake/CXXModules/examples/export-interface-install/CMakeLists.txt b/Tests/RunCMake/CXXModules/examples/export-interface-install/CMakeLists.txt index 15c91d9..df87980 100644 --- a/Tests/RunCMake/CXXModules/examples/export-interface-install/CMakeLists.txt +++ b/Tests/RunCMake/CXXModules/examples/export-interface-install/CMakeLists.txt @@ -18,7 +18,9 @@ target_sources(export_interfaces BASE_DIRS "${CMAKE_CURRENT_SOURCE_DIR}" FILES - importable.cxx) + importable.cxx + subdir/importable.cxx + ) target_compile_features(export_interfaces PUBLIC cxx_std_20) add_library(no_modules STATIC no_modules.cxx) diff --git a/Tests/RunCMake/CXXModules/examples/export-interface-install/subdir/importable.cxx b/Tests/RunCMake/CXXModules/examples/export-interface-install/subdir/importable.cxx new file mode 100644 index 0000000..07d6af6 --- /dev/null +++ b/Tests/RunCMake/CXXModules/examples/export-interface-install/subdir/importable.cxx @@ -0,0 +1,6 @@ +export module subdir_importable; + +export int from_subdir() +{ + return 0; +} diff --git a/Tests/RunCMake/CXXModules/examples/export-interface-install/test/CMakeLists.txt b/Tests/RunCMake/CXXModules/examples/export-interface-install/test/CMakeLists.txt index 6ea2831..78177ce 100644 --- a/Tests/RunCMake/CXXModules/examples/export-interface-install/test/CMakeLists.txt +++ b/Tests/RunCMake/CXXModules/examples/export-interface-install/test/CMakeLists.txt @@ -21,6 +21,7 @@ get_property(file_set_files TARGET CXXModules::export_interfaces PROPERTY CXX_MODULE_SET_modules) set(expected_file_set_files "${expected_source_dir}/importable.cxx" + "${expected_source_dir}/subdir/importable.cxx" ) if (NOT file_set_files STREQUAL "${expected_file_set_files}") message(FATAL_ERROR @@ -31,6 +32,7 @@ get_property(imported_modules TARGET CXXModules::export_interfaces PROPERTY IMPORTED_CXX_MODULES_DEBUG) set(expected_imported_modules "importable=${expected_source_dir}/importable.cxx" + "subdir_importable=${expected_source_dir}/subdir/importable.cxx" ) if (NOT imported_modules STREQUAL "${expected_imported_modules}") message(FATAL_ERROR diff --git a/Tests/RunCMake/CXXModules/examples/export-interface-no-properties-build/CMakeLists.txt b/Tests/RunCMake/CXXModules/examples/export-interface-no-properties-build/CMakeLists.txt index 7d04c50..a93e3a4 100644 --- a/Tests/RunCMake/CXXModules/examples/export-interface-no-properties-build/CMakeLists.txt +++ b/Tests/RunCMake/CXXModules/examples/export-interface-no-properties-build/CMakeLists.txt @@ -18,7 +18,9 @@ target_sources(export_interfaces_no_properties BASE_DIRS "${CMAKE_CURRENT_SOURCE_DIR}" FILES - importable.cxx) + importable.cxx + subdir/importable.cxx + ) target_compile_features(export_interfaces_no_properties PUBLIC cxx_std_20) add_library(no_modules STATIC no_modules.cxx) diff --git a/Tests/RunCMake/CXXModules/examples/export-interface-no-properties-build/subdir/importable.cxx b/Tests/RunCMake/CXXModules/examples/export-interface-no-properties-build/subdir/importable.cxx new file mode 100644 index 0000000..07d6af6 --- /dev/null +++ b/Tests/RunCMake/CXXModules/examples/export-interface-no-properties-build/subdir/importable.cxx @@ -0,0 +1,6 @@ +export module subdir_importable; + +export int from_subdir() +{ + return 0; +} diff --git a/Tests/RunCMake/CXXModules/examples/export-interface-no-properties-build/test/CMakeLists.txt b/Tests/RunCMake/CXXModules/examples/export-interface-no-properties-build/test/CMakeLists.txt index 9ff88df..18e933c 100644 --- a/Tests/RunCMake/CXXModules/examples/export-interface-no-properties-build/test/CMakeLists.txt +++ b/Tests/RunCMake/CXXModules/examples/export-interface-no-properties-build/test/CMakeLists.txt @@ -21,6 +21,7 @@ get_property(file_set_files TARGET CXXModules::export_interfaces_no_properties PROPERTY CXX_MODULE_SET_modules) set(expected_file_set_files "${expected_dir}/importable.cxx" + "${expected_dir}/subdir/importable.cxx" ) if (NOT file_set_files STREQUAL "${expected_file_set_files}") message(FATAL_ERROR diff --git a/Tests/RunCMake/CXXModules/examples/export-interface-no-properties-install/CMakeLists.txt b/Tests/RunCMake/CXXModules/examples/export-interface-no-properties-install/CMakeLists.txt index c0db766..99e67e7 100644 --- a/Tests/RunCMake/CXXModules/examples/export-interface-no-properties-install/CMakeLists.txt +++ b/Tests/RunCMake/CXXModules/examples/export-interface-no-properties-install/CMakeLists.txt @@ -18,7 +18,9 @@ target_sources(export_interfaces_no_properties BASE_DIRS "${CMAKE_CURRENT_SOURCE_DIR}" FILES - importable.cxx) + importable.cxx + subdir/importable.cxx + ) target_compile_features(export_interfaces_no_properties PUBLIC cxx_std_20) add_library(no_modules STATIC no_modules.cxx) diff --git a/Tests/RunCMake/CXXModules/examples/export-interface-no-properties-install/subdir/importable.cxx b/Tests/RunCMake/CXXModules/examples/export-interface-no-properties-install/subdir/importable.cxx new file mode 100644 index 0000000..07d6af6 --- /dev/null +++ b/Tests/RunCMake/CXXModules/examples/export-interface-no-properties-install/subdir/importable.cxx @@ -0,0 +1,6 @@ +export module subdir_importable; + +export int from_subdir() +{ + return 0; +} diff --git a/Tests/RunCMake/CXXModules/examples/export-interface-no-properties-install/test/CMakeLists.txt b/Tests/RunCMake/CXXModules/examples/export-interface-no-properties-install/test/CMakeLists.txt index 9ff88df..18e933c 100644 --- a/Tests/RunCMake/CXXModules/examples/export-interface-no-properties-install/test/CMakeLists.txt +++ b/Tests/RunCMake/CXXModules/examples/export-interface-no-properties-install/test/CMakeLists.txt @@ -21,6 +21,7 @@ get_property(file_set_files TARGET CXXModules::export_interfaces_no_properties PROPERTY CXX_MODULE_SET_modules) set(expected_file_set_files "${expected_dir}/importable.cxx" + "${expected_dir}/subdir/importable.cxx" ) if (NOT file_set_files STREQUAL "${expected_file_set_files}") message(FATAL_ERROR |