This commit is contained in:
scturtle 2018-02-22 16:19:32 +08:00
parent 892f2ebfc7
commit 319cec6e0a
2 changed files with 5 additions and 2 deletions

View File

@ -4,6 +4,7 @@
#include <string.h>
#include <memory>
#include <string>
#include <utility>
// Nullable null-terminated string, which is null if default constructed,

View File

@ -169,8 +169,10 @@ Project::Entry GetCompilationEntryFromCompileCommandEntry(
result.args.push_back(entry.args[i - 1]);
// Add -working-directory if not provided.
if (!AnyStartsWith(entry.args, "-working-directory"))
result.args.emplace_back("-working-directory=" + entry.directory);
if (!AnyStartsWith(entry.args, "-working-directory")) {
result.args.emplace_back("-working-directory");
result.args.emplace_back(entry.directory);
}
if (config->mode == ProjectMode::DotCquery &&
!AnyStartsWith(entry.args, "-std=")) {