| @@ -161,13 +161,10 @@ std::vector<std::string> &CompileStep::flags() { | |||
| } | |||
| BBVariables &vars = variables(); | |||
| std::vector<std::string> flags; | |||
| auto pkgsIt = vars.find("pkgs"); | |||
| if (pkgsIt != vars.end()) { | |||
| for (auto &flag: pkgsIt->second) { | |||
| flags.push_back(flag); | |||
| } | |||
| toolchain::getPkgConfigFlags(pkgsIt->second, flags_); | |||
| } | |||
| std::string cflagsName; | |||
| @@ -183,7 +180,7 @@ std::vector<std::string> &CompileStep::flags() { | |||
| auto cflagsIt = vars.find(cflagsName); | |||
| if (cflagsIt != vars.end()) { | |||
| for (auto &flag: cflagsIt->second) { | |||
| flags.push_back(flag); | |||
| flags_.push_back(flag); | |||
| } | |||
| } | |||
| @@ -9,6 +9,7 @@ | |||
| #include "BBParser.h" | |||
| #include "CompileStep.h" | |||
| #include "LinkStep.h" | |||
| #include "logger.h" | |||
| static std::string extension(const std::string &path) { | |||
| size_t idx = path.find_last_of('.'); | |||
| @@ -41,7 +42,13 @@ static void findDeps( | |||
| const std::string &dir, const std::string &name, | |||
| const BBVariables &variables, std::vector<std::unique_ptr<DepNode>> &deps) { | |||
| std::string path = dir + "/" + name; | |||
| sys::FileInfo info = sys::fileInfo(path); | |||
| sys::FileInfo info; | |||
| try { | |||
| info = sys::fileInfo(path); | |||
| } catch (std::exception &ex) { | |||
| logger::log(ex.what()); | |||
| return; | |||
| } | |||
| if (info.isDir) { | |||
| // May or may not need to copy variables | |||
| @@ -110,6 +110,8 @@ int main(int argc, char **argv) { | |||
| return 0; | |||
| } | |||
| sys::mkdirp(outDir); | |||
| { | |||
| std::ofstream f(outDir + "/compile_commands.json"); | |||
| compdb::Writer writer(f); | |||