Browse Source

add optimize option

master
Martin Dørum 3 years ago
parent
commit
b5b9357643
2 changed files with 6 additions and 0 deletions
  1. 1
    0
      build.bx
  2. 5
    0
      src/toolchain.cc

+ 1
- 0
build.bx View File

@@ -2,3 +2,4 @@ target := box
files := src
warnings := all extra no-unused-parameter
std := c++14
optimize := 3

+ 5
- 0
src/toolchain.cc View File

@@ -173,6 +173,11 @@ void getFlags(const BXVariables &vars, FileType type, std::vector<std::string> &
}
}

auto optimize = vars.find("optimize");
if (optimize != vars.end()) {
flags.push_back("-O" + optimize->second[0]);
}

auto cflags = vars.find(
type == FileType::C ? "cflags" :
type == FileType::CXX ? "cxxflags" :

Loading…
Cancel
Save