| target := bbbuild | target := bbbuild | ||||
| files := src | files := src | ||||
| warnings := all extra no-unused-parameter |
| } | } | ||||
| void CompileStep::doBuild(const std::string &outDir) { | void CompileStep::doBuild(const std::string &outDir) { | ||||
| logger::log("Compile " + path_); | |||||
| bool verboseCommand = global::verbose >= 1; | |||||
| if (!verboseCommand) { | |||||
| logger::log("Compile " + path_); | |||||
| } | |||||
| std::string objPath = toolchain::objectFilePath(path_, outDir); | std::string objPath = toolchain::objectFilePath(path_, outDir); | ||||
| std::string dirPath = sys::dirname(objPath); | std::string dirPath = sys::dirname(objPath); | ||||
| BBWriter writer(f); | BBWriter writer(f); | ||||
| writer.write(newCachedVars); | writer.write(newCachedVars); | ||||
| sys::execute(command, nullptr, global::verbose >= 1); | |||||
| sys::execute(command, nullptr, verboseCommand); | |||||
| } | } | ||||
| void CompileStep::doWriteCompDB(const std::string &outDir, compdb::Writer &w) { | void CompileStep::doWriteCompDB(const std::string &outDir, compdb::Writer &w) { |
| } | } | ||||
| } | } | ||||
| auto sanitize = vars.find("sanitize"); | |||||
| if (sanitize != vars.end()) { | |||||
| for (auto &s: sanitize->second) { | |||||
| auto sanitizers = vars.find("sanitizers"); | |||||
| if (sanitizers != vars.end()) { | |||||
| for (auto &s: sanitizers->second) { | |||||
| flags.push_back("-fsanitize=" + s); | flags.push_back("-fsanitize=" + s); | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| void getLDFlags(const BBVariables &vars, std::vector<std::string> &flags) { | void getLDFlags(const BBVariables &vars, std::vector<std::string> &flags) { | ||||
| auto sanitize = vars.find("sanitize"); | |||||
| auto sanitize = vars.find("sanitizers"); | |||||
| if (sanitize != vars.end()) { | if (sanitize != vars.end()) { | ||||
| for (auto &s: sanitize->second) { | for (auto &s: sanitize->second) { | ||||
| flags.push_back("-fsanitize=" + s); | |||||
| flags.push_back("-fsanitizers=" + s); | |||||
| } | } | ||||
| } | } | ||||