summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2024-01-10 15:16:14 (GMT)
committerKitware Robot <kwrobot@kitware.com>2024-01-10 15:17:01 (GMT)
commit3160b136b20bf905f07a6995072935c2adf5ca86 (patch)
tree5f6526337efc5f40f4d5f8fcc9dc048de3be7be7 /Tests/RunCMake
parent2858af8d6b503c073f36e1ed47c5b88b2ad36506 (diff)
parent405dc7d19c4e71cf3ac7e4daa93016d2b4665d3c (diff)
downloadCMake-3160b136b20bf905f07a6995072935c2adf5ca86.zip
CMake-3160b136b20bf905f07a6995072935c2adf5ca86.tar.gz
CMake-3160b136b20bf905f07a6995072935c2adf5ca86.tar.bz2
Merge topic 'vs-scan-for-modules' into release-3.28
405dc7d19c Tests/CXXModules/scan_properties: use `ixx` extension 029ddc3410 cmVisualStudio10TargetGenerator: always specify scanning 6c9614cbf4 Tests/CXXModules: add a test case for VS generation without flags 34f4423851 cmVisualStudio10TargetGenerator: fix typo in flag name Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !9104
Diffstat (limited to 'Tests/RunCMake')
-rw-r--r--Tests/RunCMake/CXXModules/RunCMakeTest.cmake1
-rw-r--r--Tests/RunCMake/CXXModules/examples/scan_properties/CMakeLists.txt8
-rw-r--r--Tests/RunCMake/CXXModules/examples/scan_properties/never_scan.ixx (renamed from Tests/RunCMake/CXXModules/examples/scan_properties/never_scan.cxx)0
-rw-r--r--Tests/RunCMake/CXXModules/examples/vs-without-flags/CMakeLists.txt22
-rw-r--r--Tests/RunCMake/CXXModules/examples/vs-without-flags/main.cxx6
-rw-r--r--Tests/RunCMake/CXXModules/examples/vs-without-flags/module.cxx6
6 files changed, 40 insertions, 3 deletions
diff --git a/Tests/RunCMake/CXXModules/RunCMakeTest.cmake b/Tests/RunCMake/CXXModules/RunCMakeTest.cmake
index cd7527a..abede44 100644
--- a/Tests/RunCMake/CXXModules/RunCMakeTest.cmake
+++ b/Tests/RunCMake/CXXModules/RunCMakeTest.cmake
@@ -170,6 +170,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(vs-without-flags)
run_cxx_module_test(library library-static -DBUILD_SHARED_LIBS=OFF)
run_cxx_module_test(unity-build)
run_cxx_module_test(object-library)
diff --git a/Tests/RunCMake/CXXModules/examples/scan_properties/CMakeLists.txt b/Tests/RunCMake/CXXModules/examples/scan_properties/CMakeLists.txt
index 47be1d9..110e411 100644
--- a/Tests/RunCMake/CXXModules/examples/scan_properties/CMakeLists.txt
+++ b/Tests/RunCMake/CXXModules/examples/scan_properties/CMakeLists.txt
@@ -18,8 +18,10 @@ string(REPLACE "<DEFINES>" "<DEFINES> -DCMAKE_SCANNED_THIS_SOURCE"
set_property(SOURCE always_scan.cxx
PROPERTY CXX_SCAN_FOR_MODULES 1)
-set_property(SOURCE never_scan.cxx
+set_property(SOURCE never_scan.ixx
PROPERTY CXX_SCAN_FOR_MODULES 0)
+set_property(SOURCE never_scan.ixx
+ PROPERTY LANGUAGE CXX)
add_executable(scans_everything)
target_sources(scans_everything
@@ -27,7 +29,7 @@ target_sources(scans_everything
main.cxx
join.cxx
always_scan.cxx
- never_scan.cxx
+ never_scan.ixx
PRIVATE
FILE_SET CXX_MODULES
BASE_DIRS
@@ -46,7 +48,7 @@ target_sources(no_scan_everything
main.cxx
join.cxx
always_scan.cxx
- never_scan.cxx
+ never_scan.ixx
PRIVATE
FILE_SET CXX_MODULES
BASE_DIRS
diff --git a/Tests/RunCMake/CXXModules/examples/scan_properties/never_scan.cxx b/Tests/RunCMake/CXXModules/examples/scan_properties/never_scan.ixx
index b47510b..b47510b 100644
--- a/Tests/RunCMake/CXXModules/examples/scan_properties/never_scan.cxx
+++ b/Tests/RunCMake/CXXModules/examples/scan_properties/never_scan.ixx
diff --git a/Tests/RunCMake/CXXModules/examples/vs-without-flags/CMakeLists.txt b/Tests/RunCMake/CXXModules/examples/vs-without-flags/CMakeLists.txt
new file mode 100644
index 0000000..0d18a66
--- /dev/null
+++ b/Tests/RunCMake/CXXModules/examples/vs-without-flags/CMakeLists.txt
@@ -0,0 +1,22 @@
+cmake_minimum_required(VERSION 3.28)
+project(cxx_modules_vs_without_flags CXX)
+
+include("${CMAKE_SOURCE_DIR}/../cxx-modules-rules.cmake")
+
+set(CMAKE_CXX_STANDARD 23)
+set(CMAKE_CXX_STANDARD_REQUIRED ON)
+set(CMAKE_CXX_EXTENSIONS OFF)
+set(CMAKE_CXX_SCAN_FOR_MODULES ON)
+
+add_executable(vs_without_flags)
+target_sources(vs_without_flags
+ PRIVATE
+ main.cxx
+ PRIVATE
+ FILE_SET CXX_MODULES
+ BASE_DIRS
+ "${CMAKE_CURRENT_SOURCE_DIR}"
+ FILES
+ module.cxx)
+
+add_test(NAME vs_without_flags COMMAND vs_without_flags)
diff --git a/Tests/RunCMake/CXXModules/examples/vs-without-flags/main.cxx b/Tests/RunCMake/CXXModules/examples/vs-without-flags/main.cxx
new file mode 100644
index 0000000..239ab00
--- /dev/null
+++ b/Tests/RunCMake/CXXModules/examples/vs-without-flags/main.cxx
@@ -0,0 +1,6 @@
+import mod;
+
+int main(int argc, char* argv[])
+{
+ return f();
+}
diff --git a/Tests/RunCMake/CXXModules/examples/vs-without-flags/module.cxx b/Tests/RunCMake/CXXModules/examples/vs-without-flags/module.cxx
new file mode 100644
index 0000000..27a61a6
--- /dev/null
+++ b/Tests/RunCMake/CXXModules/examples/vs-without-flags/module.cxx
@@ -0,0 +1,6 @@
+export module mod;
+
+export int f()
+{
+ return 0;
+}