Martin Dørum 5 лет назад
Родитель
Сommit
95d6d9588f
3 измененных файлов: 12 добавлений и 6 удалений
  1. 2
    5
      src/CompileStep.cc
  2. 8
    1
      src/build.cc
  3. 2
    0
      src/main.cc

+ 2
- 5
src/CompileStep.cc Просмотреть файл

} }


BBVariables &vars = variables(); BBVariables &vars = variables();
std::vector<std::string> flags;


auto pkgsIt = vars.find("pkgs"); auto pkgsIt = vars.find("pkgs");
if (pkgsIt != vars.end()) { if (pkgsIt != vars.end()) {
for (auto &flag: pkgsIt->second) {
flags.push_back(flag);
}
toolchain::getPkgConfigFlags(pkgsIt->second, flags_);
} }


std::string cflagsName; std::string cflagsName;
auto cflagsIt = vars.find(cflagsName); auto cflagsIt = vars.find(cflagsName);
if (cflagsIt != vars.end()) { if (cflagsIt != vars.end()) {
for (auto &flag: cflagsIt->second) { for (auto &flag: cflagsIt->second) {
flags.push_back(flag);
flags_.push_back(flag);
} }
} }



+ 8
- 1
src/build.cc Просмотреть файл

#include "BBParser.h" #include "BBParser.h"
#include "CompileStep.h" #include "CompileStep.h"
#include "LinkStep.h" #include "LinkStep.h"
#include "logger.h"


static std::string extension(const std::string &path) { static std::string extension(const std::string &path) {
size_t idx = path.find_last_of('.'); size_t idx = path.find_last_of('.');
const std::string &dir, const std::string &name, const std::string &dir, const std::string &name,
const BBVariables &variables, std::vector<std::unique_ptr<DepNode>> &deps) { const BBVariables &variables, std::vector<std::unique_ptr<DepNode>> &deps) {
std::string path = dir + "/" + name; 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) { if (info.isDir) {
// May or may not need to copy variables // May or may not need to copy variables

+ 2
- 0
src/main.cc Просмотреть файл

return 0; return 0;
} }


sys::mkdirp(outDir);

{ {
std::ofstream f(outDir + "/compile_commands.json"); std::ofstream f(outDir + "/compile_commands.json");
compdb::Writer writer(f); compdb::Writer writer(f);

Загрузка…
Отмена
Сохранить