summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBen Boeckel <ben.boeckel@kitware.com>2019-04-04 19:31:56 (GMT)
committerBrad King <brad.king@kitware.com>2021-01-05 14:29:18 (GMT)
commitb0fc2993e11fb8b4bcf8a44e6d165f5634ad21bb (patch)
tree4edc06330f992ba7b4da48408c59daa3156212c0
parent988f9971006d09d675f8d406367d9021915ef9c0 (diff)
downloadCMake-b0fc2993e11fb8b4bcf8a44e6d165f5634ad21bb.zip
CMake-b0fc2993e11fb8b4bcf8a44e6d165f5634ad21bb.tar.gz
CMake-b0fc2993e11fb8b4bcf8a44e6d165f5634ad21bb.tar.bz2
Treat the '.mpp' file extension as C++ code
This is the extension required in build2 for C++ module support.
-rw-r--r--Modules/CMakeCXXCompiler.cmake.in2
-rw-r--r--Source/cmMakefile.cxx7
-rw-r--r--Source/cmSourceFile.h2
-rw-r--r--Source/cmake.cxx5
4 files changed, 9 insertions, 7 deletions
diff --git a/Modules/CMakeCXXCompiler.cmake.in b/Modules/CMakeCXXCompiler.cmake.in
index 92ae2ab..45acfe7 100644
--- a/Modules/CMakeCXXCompiler.cmake.in
+++ b/Modules/CMakeCXXCompiler.cmake.in
@@ -44,7 +44,7 @@ if(CMAKE_COMPILER_IS_MINGW)
set(MINGW 1)
endif()
set(CMAKE_CXX_COMPILER_ID_RUN 1)
-set(CMAKE_CXX_SOURCE_FILE_EXTENSIONS C;M;c++;cc;cpp;cxx;m;mm;CPP)
+set(CMAKE_CXX_SOURCE_FILE_EXTENSIONS C;M;c++;cc;cpp;cxx;m;mm;mpp;CPP)
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 9d37d61..348a06c 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -1216,9 +1216,10 @@ void cmMakefile::AddCustomCommandOldStyle(
};
// Each output must get its own copy of this rule.
- cmsys::RegularExpression sourceFiles("\\.(C|M|c|c\\+\\+|cc|cpp|cxx|cu|m|mm|"
- "rc|def|r|odl|idl|hpj|bat|h|h\\+\\+|"
- "hm|hpp|hxx|in|txx|inl)$");
+ cmsys::RegularExpression sourceFiles(
+ "\\.(C|M|c|c\\+\\+|cc|cpp|cxx|mpp|cu|m|mm|"
+ "rc|def|r|odl|idl|hpj|bat|h|h\\+\\+|"
+ "hm|hpp|hxx|in|txx|inl)$");
// Choose whether to use a main dependency.
if (sourceFiles.find(source)) {
diff --git a/Source/cmSourceFile.h b/Source/cmSourceFile.h
index 94b5cc8..76a5ded 100644
--- a/Source/cmSourceFile.h
+++ b/Source/cmSourceFile.h
@@ -175,7 +175,7 @@ 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|cxx|cu|f|f90|for|fpp|ftn|m|mm|" \
+ "\\.(C|F|M|c|c\\+\\+|cc|cpp|mpp|cxx|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 1691037..fb8fb3e 100644
--- a/Source/cmake.cxx
+++ b/Source/cmake.cxx
@@ -325,8 +325,9 @@ cmake::cmake(Role role, cmState::Mode mode)
};
// The "c" extension MUST precede the "C" extension.
- setupExts(this->CLikeSourceFileExtensions,
- { "c", "C", "c++", "cc", "cpp", "cxx", "cu", "m", "M", "mm" });
+ setupExts(
+ this->CLikeSourceFileExtensions,
+ { "c", "C", "c++", "cc", "cpp", "cxx", "cu", "mpp", "m", "M", "mm" });
setupExts(this->HeaderFileExtensions,
{ "h", "hh", "h++", "hm", "hpp", "hxx", "in", "txx" });
setupExts(this->CudaFileExtensions, { "cu" });