Skip to content

Commit

Permalink
[gen][compdb] Create wdirs in advance.
Browse files Browse the repository at this point in the history
  • Loading branch information
egorpugin committed May 25, 2024
1 parent ddd5ec9 commit a3327d2
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/sw/client/common/generator/generator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1304,8 +1304,11 @@ void CompilationDatabaseGenerator::generate(const SwBuild &b)
for (auto &c : tgt->getCommands())
{
nlohmann::json j2;
if (!c->working_directory.empty())
if (!c->working_directory.empty()) {
j2["directory"] = to_printable_string(normalize_path(c->working_directory));
// required by consumers (e.g. clion)
fs::create_directories(c->working_directory);
}
// since we are not using compdb to build whole project
// we are fine to skip empty input commands (clion is not ok with them)
if (compdb_clion && c->inputs.size() == 1 && *c->inputs.begin() == c->arguments[0]->toString())
Expand Down

0 comments on commit a3327d2

Please sign in to comment.