summaryrefslogtreecommitdiff
path: root/Tests/RunCMake/CXXModules/NoDyndepSupport.cmake
diff options
context:
space:
mode:
authorBen Boeckel <ben.boeckel@kitware.com>2022-04-08 13:56:33 -0400
committerBen Boeckel <ben.boeckel@kitware.com>2022-06-16 10:28:34 -0400
commit386465bf8396dca8d00448b23734bc5edafb17c8 (patch)
tree08fe81417c136cfb716a53fa3db2fb91bdc83b4c /Tests/RunCMake/CXXModules/NoDyndepSupport.cmake
parentff30a5397d804b9de564d54868bd5fdf504361c2 (diff)
downloadcmake-386465bf8396dca8d00448b23734bc5edafb17c8.tar.gz
cmTarget: add support for C++ module fileset types
C++ modules have two variants which are of importance to CMake: - `CXX_MODULES`: interface modules (those using `export module M;`, `export module M:part;`, or `module M:internal_part;`) - `CXX_MODULE_HEADER_UNITS`: importable header units Creating C++ modules or partitions are *not* supported in any other source listing. This is because the source files must be installed (so their scope matters), but not part of usage requirements (what it means for a module source to be injected into a consumer is not clear at this moment). Due to the way `FILE_SET` works with scopes, they are a perfect fit as long as `INTERFACE` is not allowed (which it is not).
Diffstat (limited to 'Tests/RunCMake/CXXModules/NoDyndepSupport.cmake')
-rw-r--r--Tests/RunCMake/CXXModules/NoDyndepSupport.cmake16
1 files changed, 16 insertions, 0 deletions
diff --git a/Tests/RunCMake/CXXModules/NoDyndepSupport.cmake b/Tests/RunCMake/CXXModules/NoDyndepSupport.cmake
new file mode 100644
index 0000000000..09544007f5
--- /dev/null
+++ b/Tests/RunCMake/CXXModules/NoDyndepSupport.cmake
@@ -0,0 +1,16 @@
+enable_language(CXX)
+set(CMAKE_EXPERIMENTAL_CXX_MODULE_DYNDEP 1)
+set(CMAKE_EXPERIMENTAL_CXX_SCANDEP_SOURCE "")
+
+if (NOT CMAKE_CXX_STANDARD_DEFAULT)
+ set(CMAKE_CXX_STANDARD_DEFAULT "11")
+endif ()
+
+add_library(nodyndep)
+target_sources(nodyndep
+ PUBLIC
+ FILE_SET fs TYPE CXX_MODULES FILES
+ sources/module.cxx)
+target_compile_features(nodyndep
+ PRIVATE
+ cxx_std_20)