diff options
author | bloodstalker <thabogre@gmail.com> | 2017-06-12 12:19:31 +0000 |
---|---|---|
committer | bloodstalker <thabogre@gmail.com> | 2017-06-12 12:19:31 +0000 |
commit | 7191f47c7bfc2571bc03d5860e58d11fca7b4575 (patch) | |
tree | 8fe3d8054f345130acbbec463b4b2c586eadba73 /bruiser/bruiser.cpp | |
parent | updated (diff) | |
download | mutator-7191f47c7bfc2571bc03d5860e58d11fca7b4575.tar.gz mutator-7191f47c7bfc2571bc03d5860e58d11fca7b4575.zip |
fixed the new command
Diffstat (limited to '')
-rw-r--r-- | bruiser/bruiser.cpp | 28 |
1 files changed, 25 insertions, 3 deletions
diff --git a/bruiser/bruiser.cpp b/bruiser/bruiser.cpp index 32100dd..86e2cd7 100644 --- a/bruiser/bruiser.cpp +++ b/bruiser/bruiser.cpp @@ -194,6 +194,18 @@ class CompilationDatabaseProcessor //PRINT_WITH_COLOR_LB(RED, MakePath.c_str()); } + bool CompilationDatabseIsEmpty(void) + { + std::vector<CompileCommand> CCV = CDB.getAllCompileCommands(); + + if(CCV.empty()) + { + return true; + } + + return false; + } + std::string GetMakePath(void) { return this->MakePath; @@ -1143,9 +1155,19 @@ int main(int argc, const char **argv) /*populating the shellglobalinstance*/ CompilationDatabaseProcessor CDBP(CDB); - CDBP.CalcMakePath(); - CDBP.PopulateGPATH(); - CDBP.PopulateGSOURCEFILES(); + + /*checking whether the compilation database is found and not empty*/ + if (CDBP.CompilationDatabseIsEmpty()) + { + PRINT_WITH_COLOR_LB(RED, "bruiser could not find the compilation database."); + //return 1; + } + else + { + CDBP.CalcMakePath(); + CDBP.PopulateGPATH(); + CDBP.PopulateGSOURCEFILES(); + } /*initialize the LuaWrapper class so we can register and run them from lua.*/ LuaWrapper LW(Tool); |