aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2019-04-09 00:54:10 +0200
committerdec05eba <dec05eba@protonmail.com>2020-07-06 07:39:33 +0200
commit137cbf7ddeeb534353af9a1c3bfa4b70a63051e2 (patch)
tree812dda7e3c29fd17bdd57ffd3fa276c525b3daf4
parente592041f16d34495ba1146705adfb848f80a2a0d (diff)
Remove compdb dependency
-rw-r--r--backend/ninja/Ninja.cpp30
-rw-r--r--src/main.cpp4
2 files changed, 1 insertions, 33 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);
}
}
diff --git a/src/main.cpp b/src/main.cpp
index bf97450..5efafe6 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -89,10 +89,6 @@ using namespace std::chrono;
// TODO: Support packaging with musl to reduce number of libraries needed for the package and also to reduce package size.
-// TODO: Remove dependency on compdb tool, implement compile_commands.json generation inside sibs.
-// Also compile_commands.json shouldn't update if no files have changed. This is easier to do when ninja is replaced so we can track changes
-// in source/header files.
-
// TODO: Create a script that downloads every library in the package list (packages.json) and build each project for every new release of sibs
// to verify we don't break anything.