diff options
author | Robert Maynard <robert.maynard@kitware.com> | 2018-01-03 09:22:47 -0500 |
---|---|---|
committer | Robert Maynard <robert.maynard@kitware.com> | 2018-01-08 16:16:52 -0500 |
commit | 81868e6badbb36947a6e89b0e97f2f0526d59a67 (patch) | |
tree | 0a80366b630f15f2094c2210a3bc1a4d7062f8c1 /Source | |
parent | 1f29bc4092edf57cfb61882d7d7358db7e53ebe6 (diff) | |
download | cmake-81868e6badbb36947a6e89b0e97f2f0526d59a67.tar.gz |
CUDA: Add cu as default source file extension
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmExtraCodeBlocksGenerator.cxx | 4 | ||||
-rw-r--r-- | Source/cmExtraCodeLiteGenerator.cxx | 4 | ||||
-rw-r--r-- | Source/cmMakefile.cxx | 2 | ||||
-rw-r--r-- | Source/cmSourceFile.h | 3 | ||||
-rw-r--r-- | Source/cmSystemTools.cxx | 3 | ||||
-rw-r--r-- | Source/cmSystemTools.h | 1 | ||||
-rw-r--r-- | Source/cmake.cxx | 1 |
7 files changed, 12 insertions, 6 deletions
diff --git a/Source/cmExtraCodeBlocksGenerator.cxx b/Source/cmExtraCodeBlocksGenerator.cxx index edce330c4f..31c8bca8b8 100644 --- a/Source/cmExtraCodeBlocksGenerator.cxx +++ b/Source/cmExtraCodeBlocksGenerator.cxx @@ -371,10 +371,10 @@ void cmExtraCodeBlocksGenerator::CreateNewProjectFile( continue; } - // check whether it is a C/C++ implementation file + // check whether it is a C/C++/CUDA implementation file bool isCFile = false; std::string lang = s->GetLanguage(); - if (lang == "C" || lang == "CXX") { + if (lang == "C" || lang == "CXX" || lang == "CUDA") { std::string const& srcext = s->GetExtension(); isCFile = cm->IsSourceExtension(srcext); } diff --git a/Source/cmExtraCodeLiteGenerator.cxx b/Source/cmExtraCodeLiteGenerator.cxx index 383942b5a3..4958007947 100644 --- a/Source/cmExtraCodeLiteGenerator.cxx +++ b/Source/cmExtraCodeLiteGenerator.cxx @@ -227,10 +227,10 @@ std::string cmExtraCodeLiteGenerator::CollectSourceFiles( gt->GetSourceFiles(sources, makefile->GetSafeDefinition("CMAKE_BUILD_TYPE")); for (cmSourceFile* s : sources) { - // check whether it is a C/C++ implementation file + // check whether it is a C/C++/CUDA implementation file bool isCFile = false; std::string lang = s->GetLanguage(); - if (lang == "C" || lang == "CXX") { + if (lang == "C" || lang == "CXX" || lang == "CUDA") { std::string const& srcext = s->GetExtension(); isCFile = cm->IsSourceExtension(srcext); } diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index a1e2f63e59..9fb80010b7 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -967,7 +967,7 @@ void cmMakefile::AddCustomCommandOldStyle( } // Each output must get its own copy of this rule. - cmsys::RegularExpression sourceFiles("\\.(C|M|c|c\\+\\+|cc|cpp|cxx|m|mm|" + 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)$"); for (std::string const& oi : outputs) { diff --git a/Source/cmSourceFile.h b/Source/cmSourceFile.h index c2105d2243..da722eaf20 100644 --- a/Source/cmSourceFile.h +++ b/Source/cmSourceFile.h @@ -120,7 +120,8 @@ private: #define CM_HEADER_REGEX "\\.(h|hh|h\\+\\+|hm|hpp|hxx|in|txx|inl)$" #define CM_SOURCE_REGEX \ - "\\.(C|M|c|c\\+\\+|cc|cpp|cxx|f|f90|for|fpp|ftn|m|mm|rc|def|r|odl|idl|hpj" \ + "\\.(C|M|c|c\\+\\+|cc|cpp|cxx|cu|f|f90|for|fpp|ftn|m|mm|rc|def|r|odl|idl|" \ + "hpj" \ "|bat)$" #define CM_RESOURCE_REGEX "\\.(pdf|plist|png|jpeg|jpg|storyboard|xcassets)$" diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx index 5d1f5f7219..c321236220 100644 --- a/Source/cmSystemTools.cxx +++ b/Source/cmSystemTools.cxx @@ -1308,6 +1308,9 @@ cmSystemTools::FileFormat cmSystemTools::GetFileFormat(const char* cext) if (ext == "java" || ext == ".java") { return cmSystemTools::JAVA_FILE_FORMAT; } + if (ext == "cu" || ext == ".cu") { + return cmSystemTools::CUDA_FILE_FORMAT; + } if (ext == "H" || ext == ".H" || ext == "h" || ext == ".h" || ext == "h++" || ext == ".h++" || ext == "hm" || ext == ".hm" || ext == "hpp" || ext == ".hpp" || ext == "hxx" || ext == ".hxx" || ext == "in" || diff --git a/Source/cmSystemTools.h b/Source/cmSystemTools.h index 2646df9ceb..26696de0d6 100644 --- a/Source/cmSystemTools.h +++ b/Source/cmSystemTools.h @@ -285,6 +285,7 @@ public: CXX_FILE_FORMAT, FORTRAN_FILE_FORMAT, JAVA_FILE_FORMAT, + CUDA_FILE_FORMAT, HEADER_FILE_FORMAT, RESOURCE_FILE_FORMAT, DEFINITION_FILE_FORMAT, diff --git a/Source/cmake.cxx b/Source/cmake.cxx index 2a5bb6c9ef..2341dd6641 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -196,6 +196,7 @@ cmake::cmake(Role role) this->SourceFileExtensions.push_back("cc"); this->SourceFileExtensions.push_back("cpp"); this->SourceFileExtensions.push_back("cxx"); + this->SourceFileExtensions.push_back("cu"); this->SourceFileExtensions.push_back("m"); this->SourceFileExtensions.push_back("M"); this->SourceFileExtensions.push_back("mm"); |