diff options
author | Brad King <brad.king@kitware.com> | 2023-03-09 16:37:12 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2023-03-09 19:36:01 (GMT) |
commit | 45d1925efc5ed19066d179ed15bfbcb6ae31ae9a (patch) | |
tree | 35e572920eb7fcf5305f28d056b231309740dfef | |
parent | 8c96d145c1f9b5431643403caad9264a5b9e1402 (diff) | |
download | CMake-45d1925efc5ed19066d179ed15bfbcb6ae31ae9a.zip CMake-45d1925efc5ed19066d179ed15bfbcb6ae31ae9a.tar.gz CMake-45d1925efc5ed19066d179ed15bfbcb6ae31ae9a.tar.bz2 |
Treat '.ccm', '.cxxm', and '.c++m' files as C++ sources
These extensions are used by convention for C++ module interface units
with Clang.
For now, do not add any tests using these extensions.
Very few compilers recognize them as C++ sources.
Tests can be added later as part of C++ modules support.
-rw-r--r-- | Help/release/dev/cxx-module-extensions.rst | 5 | ||||
-rw-r--r-- | Modules/CMakeCXXCompiler.cmake.in | 2 | ||||
-rw-r--r-- | Source/cmMakefile.cxx | 2 | ||||
-rw-r--r-- | Source/cmSourceFile.h | 4 | ||||
-rw-r--r-- | Source/cmake.cxx | 2 |
5 files changed, 10 insertions, 5 deletions
diff --git a/Help/release/dev/cxx-module-extensions.rst b/Help/release/dev/cxx-module-extensions.rst new file mode 100644 index 0000000..92df86a --- /dev/null +++ b/Help/release/dev/cxx-module-extensions.rst @@ -0,0 +1,5 @@ +cxx-module-extensions +--------------------- + +* Source file extensions ``.ccm``, ``.cxxm``, or ``.c++m`` are now + treated as C++. diff --git a/Modules/CMakeCXXCompiler.cmake.in b/Modules/CMakeCXXCompiler.cmake.in index dcfff6f..834c2e6 100644 --- a/Modules/CMakeCXXCompiler.cmake.in +++ b/Modules/CMakeCXXCompiler.cmake.in @@ -37,7 +37,7 @@ set(CMAKE_CXX_ABI_COMPILED @CMAKE_CXX_ABI_COMPILED@) set(CMAKE_CXX_COMPILER_ENV_VAR "CXX") set(CMAKE_CXX_COMPILER_ID_RUN 1) -set(CMAKE_CXX_SOURCE_FILE_EXTENSIONS C;M;c++;cc;cpp;cxx;m;mm;mpp;CPP;ixx;cppm) +set(CMAKE_CXX_SOURCE_FILE_EXTENSIONS C;M;c++;cc;cpp;cxx;m;mm;mpp;CPP;ixx;cppm;ccm;cxxm;c++m) set(CMAKE_CXX_IGNORE_EXTENSIONS inl;h;hpp;HPP;H;o;O;obj;OBJ;def;DEF;rc;RC) foreach (lang C OBJC OBJCXX) diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index 33843e2..3fcc7f7 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -1229,7 +1229,7 @@ void cmMakefile::AddCustomCommandOldStyle( // Each output must get its own copy of this rule. cmsys::RegularExpression sourceFiles( - "\\.(C|M|c|c\\+\\+|cc|cpp|cxx|mpp|ixx|cppm|cu|m|mm|" + "\\.(C|M|c|c\\+\\+|cc|cpp|cxx|mpp|ixx|cppm|ccm|cxxm|c\\+\\+m|cu|m|mm|" "rc|def|r|odl|idl|hpj|bat|h|h\\+\\+|" "hm|hpp|hxx|in|txx|inl)$"); diff --git a/Source/cmSourceFile.h b/Source/cmSourceFile.h index c1c5201..9308af4 100644 --- a/Source/cmSourceFile.h +++ b/Source/cmSourceFile.h @@ -183,8 +183,8 @@ private: #define CM_HEADER_REGEX "\\.(h|hh|h\\+\\+|hm|hpp|hxx|in|txx|inl)$" #define CM_SOURCE_REGEX \ - "\\.(C|F|M|c|c\\+\\+|cc|cpp|mpp|cxx|ixx|cppm|cu|f|f90|for|fpp|ftn|m|mm|" \ - "rc|def|r|odl|idl|hpj|bat)$" + "\\.(C|F|M|c|c\\+\\+|cc|cpp|mpp|cxx|ixx|cppm|ccm|cxxm|c\\+\\+m|cu" \ + "|f|f90|for|fpp|ftn|m|mm|rc|def|r|odl|idl|hpj|bat)$" #define CM_PCH_REGEX "cmake_pch(_[^.]+)?\\.(h|hxx)$" diff --git a/Source/cmake.cxx b/Source/cmake.cxx index dbf961d..d4bbc14 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -335,7 +335,7 @@ cmake::cmake(Role role, cmState::Mode mode, cmState::ProjectKind projectKind) // The "c" extension MUST precede the "C" extension. setupExts(this->CLikeSourceFileExtensions, { "c", "C", "c++", "cc", "cpp", "cxx", "cu", "mpp", "m", "M", - "mm", "ixx", "cppm" }); + "mm", "ixx", "cppm", "ccm", "cxxm", "c++m" }); setupExts(this->HeaderFileExtensions, { "h", "hh", "h++", "hm", "hpp", "hxx", "in", "txx" }); setupExts(this->CudaFileExtensions, { "cu" }); |