Browse Source

some bug fixes

rebrand
Martin Dørum 3 years ago
parent
commit
95d6d9588f
3 changed files with 12 additions and 6 deletions
  1. 2
    5
      src/CompileStep.cc
  2. 8
    1
      src/build.cc
  3. 2
    0
      src/main.cc

+ 2
- 5
src/CompileStep.cc View File

@@ -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);
}
}


+ 8
- 1
src/build.cc View File

@@ -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

+ 2
- 0
src/main.cc View File

@@ -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);

Loading…
Cancel
Save