diff options
author | dec05eba <dec05eba@protonmail.com> | 2018-07-23 11:08:35 +0200 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2020-07-06 07:39:32 +0200 |
commit | e9e51e0041abbbf950ed11d6b4fea8616cbd28bb (patch) | |
tree | 220d6d588e95583fb76838a2bf143eabb22bea8c | |
parent | 531d05df58bcb20e051c6ebe77c6583322b84dcb (diff) |
Add more c++ file extensions
-rw-r--r-- | backend/BackendUtils.cpp | 11 | ||||
-rw-r--r-- | backend/ninja/Ninja.cpp | 3 | ||||
-rw-r--r-- | src/main.cpp | 15 |
3 files changed, 13 insertions, 16 deletions
diff --git a/backend/BackendUtils.cpp b/backend/BackendUtils.cpp index 68794f5..a91fc95 100644 --- a/backend/BackendUtils.cpp +++ b/backend/BackendUtils.cpp @@ -12,7 +12,16 @@ namespace backend return _tinydir_strncmp(path.c_str(), subPathOf.c_str(), subPathOf.size()) == 0; } - const _tinydir_char_t *sourceFileExtensions[] = { TINYDIR_STRING("c"), TINYDIR_STRING("cc"), TINYDIR_STRING("cpp"), TINYDIR_STRING("cxx"), TINYDIR_STRING("c++") }; + const _tinydir_char_t *sourceFileExtensions[] = + { + TINYDIR_STRING("c"), + TINYDIR_STRING("C"), + TINYDIR_STRING("cc"), + TINYDIR_STRING("cp"), + TINYDIR_STRING("cpp"), + TINYDIR_STRING("cxx"), + TINYDIR_STRING("c++") + }; bool BackendUtils::isSourceFile(tinydir_file *file) { if(!file->is_reg) diff --git a/backend/ninja/Ninja.cpp b/backend/ninja/Ninja.cpp index 871234c..b21ea60 100644 --- a/backend/ninja/Ninja.cpp +++ b/backend/ninja/Ninja.cpp @@ -154,6 +154,7 @@ namespace backend case CVersion::C99: return "-std=c99 -pedantic"; case CVersion::C11: return "-std=c11 -pedantic"; } + break; } case Compiler::MSVC: { @@ -177,6 +178,7 @@ namespace backend case CPPVersion::CPP14: return "-std=c++14 -pedantic"; case CPPVersion::CPP17: return "-std=c++17 -pedantic"; } + break; } case Compiler::MSVC: { @@ -187,6 +189,7 @@ namespace backend case CPPVersion::CPP14: return "/std=c++14"; case CPPVersion::CPP17: return "/std=c++17"; } + break; } } assert(false); diff --git a/src/main.cpp b/src/main.cpp index ecbf9cd..6dfd256 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -212,21 +212,6 @@ void validateFilePath(const _tinydir_char_t *projectConfPath) } } -const _tinydir_char_t *sourceFileExtensions[] = { TINYDIR_STRING("c"), TINYDIR_STRING("cc"), TINYDIR_STRING("cpp"), TINYDIR_STRING("cxx") }; -bool isSourceFile(tinydir_file *file) -{ - if(!file->is_reg) - return false; - - for(const _tinydir_char_t *sourceFileExtension : sourceFileExtensions) - { - if(_tinydir_strcmp(sourceFileExtension, file->extension) == 0) - return true; - } - - return false; -} - bool isPathSubPathOf(const FileString &path, const FileString &subPathOf) { return _tinydir_strncmp(path.c_str(), subPathOf.c_str(), subPathOf.size()) == 0; |