Treat the '.mpp' file extension as C++ code

This is the extension required in build2 for C++ module support.
This commit is contained in:
Ben Boeckel
2019-04-04 15:31:56 -04:00
committed by Brad King
parent 988f997100
commit b0fc2993e1
4 changed files with 9 additions and 7 deletions
+1 -1
View File
@@ -44,7 +44,7 @@ if(CMAKE_COMPILER_IS_MINGW)
set(MINGW 1) set(MINGW 1)
endif() endif()
set(CMAKE_CXX_COMPILER_ID_RUN 1) 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) set(CMAKE_CXX_IGNORE_EXTENSIONS inl;h;hpp;HPP;H;o;O;obj;OBJ;def;DEF;rc;RC)
foreach (lang C OBJC OBJCXX) foreach (lang C OBJC OBJCXX)
+4 -3
View File
@@ -1216,9 +1216,10 @@ void cmMakefile::AddCustomCommandOldStyle(
}; };
// Each output must get its own copy of this rule. // Each output must get its own copy of this rule.
cmsys::RegularExpression sourceFiles("\\.(C|M|c|c\\+\\+|cc|cpp|cxx|cu|m|mm|" cmsys::RegularExpression sourceFiles(
"rc|def|r|odl|idl|hpj|bat|h|h\\+\\+|" "\\.(C|M|c|c\\+\\+|cc|cpp|cxx|mpp|cu|m|mm|"
"hm|hpp|hxx|in|txx|inl)$"); "rc|def|r|odl|idl|hpj|bat|h|h\\+\\+|"
"hm|hpp|hxx|in|txx|inl)$");
// Choose whether to use a main dependency. // Choose whether to use a main dependency.
if (sourceFiles.find(source)) { if (sourceFiles.find(source)) {
+1 -1
View File
@@ -175,7 +175,7 @@ private:
#define CM_HEADER_REGEX "\\.(h|hh|h\\+\\+|hm|hpp|hxx|in|txx|inl)$" #define CM_HEADER_REGEX "\\.(h|hh|h\\+\\+|hm|hpp|hxx|in|txx|inl)$"
#define CM_SOURCE_REGEX \ #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)$" "rc|def|r|odl|idl|hpj|bat)$"
#define CM_PCH_REGEX "cmake_pch(_[^.]+)?\\.(h|hxx)$" #define CM_PCH_REGEX "cmake_pch(_[^.]+)?\\.(h|hxx)$"
+3 -2
View File
@@ -325,8 +325,9 @@ cmake::cmake(Role role, cmState::Mode mode)
}; };
// The "c" extension MUST precede the "C" extension. // The "c" extension MUST precede the "C" extension.
setupExts(this->CLikeSourceFileExtensions, setupExts(
{ "c", "C", "c++", "cc", "cpp", "cxx", "cu", "m", "M", "mm" }); this->CLikeSourceFileExtensions,
{ "c", "C", "c++", "cc", "cpp", "cxx", "cu", "mpp", "m", "M", "mm" });
setupExts(this->HeaderFileExtensions, setupExts(this->HeaderFileExtensions,
{ "h", "hh", "h++", "hm", "hpp", "hxx", "in", "txx" }); { "h", "hh", "h++", "hm", "hpp", "hxx", "in", "txx" });
setupExts(this->CudaFileExtensions, { "cu" }); setupExts(this->CudaFileExtensions, { "cu" });