aboutsummaryrefslogtreecommitdiff
path: root/backend/ninja
diff options
context:
space:
mode:
Diffstat (limited to 'backend/ninja')
-rw-r--r--backend/ninja/Ninja.cpp30
1 files changed, 1 insertions, 29 deletions
diff --git a/backend/ninja/Ninja.cpp b/backend/ninja/Ninja.cpp
index c231355..c594722 100644
--- a/backend/ninja/Ninja.cpp
+++ b/backend/ninja/Ninja.cpp
@@ -1845,13 +1845,10 @@ namespace backend
Result<bool> Ninja::buildCompilationDatabase(const _tinydir_char_t *buildFilePath, const FileString &saveDir)
{
- Result<ExecResult> compdbAvailableResult = exec(TINYDIR_STRING("compdb version"), false);
- bool isCompdbAvailable = false;//(compdbAvailableResult && compdbAvailableResult.unwrap().exitCode == 0);
-
FileString command = TINYDIR_STRING("ninja -C \"");
command += buildFilePath;
command += TINYDIR_STRING("\" -t compdb compile_c compile_cpp > \"");
- command += (isCompdbAvailable ? buildFilePath : saveDir);
+ command += saveDir;
command += TINYDIR_STRING("/compile_commands.json\"");
Result<ExecResult> execResult = exec(command.c_str(), false);
if(execResult)
@@ -1869,31 +1866,6 @@ namespace backend
errMsg += execResult.getErrMsg();
return Result<bool>::Err(errMsg);
}
-
- if(isCompdbAvailable)
- {
- command = TINYDIR_STRING("compdb -p \"");
- command += buildFilePath;
- command += TINYDIR_STRING("\" list > \"");
- command += saveDir;
- command += TINYDIR_STRING("/compile_commands.json\"");
- execResult = exec(command.c_str(), false);
- if(execResult)
- {
- if(execResult.unwrap().exitCode != 0)
- {
- string errMsg = "Failed to build compilation database, reason: ";
- errMsg += execResult.unwrap().execStdout;
- return Result<bool>::Err(errMsg);
- }
- }
- else
- {
- string errMsg = "Failed to build compilation database, reason: ";
- errMsg += execResult.getErrMsg();
- return Result<bool>::Err(errMsg);
- }
- }
return Result<bool>::Ok(true);
}
}