From 137cbf7ddeeb534353af9a1c3bfa4b70a63051e2 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Tue, 9 Apr 2019 00:54:10 +0200 Subject: Remove compdb dependency --- backend/ninja/Ninja.cpp | 30 +----------------------------- 1 file changed, 1 insertion(+), 29 deletions(-) (limited to 'backend') 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 Ninja::buildCompilationDatabase(const _tinydir_char_t *buildFilePath, const FileString &saveDir) { - Result 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 = exec(command.c_str(), false); if(execResult) @@ -1869,31 +1866,6 @@ namespace backend errMsg += execResult.getErrMsg(); return Result::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::Err(errMsg); - } - } - else - { - string errMsg = "Failed to build compilation database, reason: "; - errMsg += execResult.getErrMsg(); - return Result::Err(errMsg); - } - } return Result::Ok(true); } } -- cgit v1.2.3