diff options
Diffstat (limited to 'src/rebuild.cc')
-rw-r--r-- | src/rebuild.cc | 25 |
1 files changed, 18 insertions, 7 deletions
diff --git a/src/rebuild.cc b/src/rebuild.cc index 3e0e78d..a82e0cc 100644 --- a/src/rebuild.cc +++ b/src/rebuild.cc @@ -13,6 +13,8 @@ #include "tasks.h" #include "build.h" #include "execute.h" +#include "tools.h" +#include "util.h" std::array<BuildConfigurationEntry, 1024> configFiles; std::size_t numConfigFiles{0}; @@ -143,19 +145,28 @@ bool recompileCheck(const Settings& global_settings, int argc, char* argv[], BuildConfiguration config; config.name = "ctor"; - config.flags.cxxflags = - std::vector<std::string>({ "-s", "-O3", "-std=c++20" }); + config.system = OutputSystem::Build; + + auto tool_chain = getToolChain(config.system); + + append(config.flags.cxxflags, + getOption(tool_chain, opt::optimization, "3")); + append(config.flags.cxxflags, + getOption(tool_chain, opt::cpp_std, "c++20")); if(hasConfiguration(cfg::ctor_includedir)) { - config.flags.cxxflags.push_back("-I"s + getConfiguration(cfg::ctor_includedir)); + append(config.flags.cxxflags, + getOption(tool_chain, opt::include_path, + getConfiguration(cfg::ctor_includedir))); } if(hasConfiguration(cfg::ctor_libdir)) { - config.flags.ldflags.push_back("-L"s + getConfiguration(cfg::ctor_libdir)); + append(config.flags.ldflags, + getOption(tool_chain, opt::library_path, + getConfiguration(cfg::ctor_libdir))); } - config.flags.ldflags.push_back("-lctor"); - config.flags.ldflags.push_back("-pthread"); - + append(config.flags.ldflags, getOption(tool_chain, opt::link, "ctor")); + append(config.flags.ldflags, getOption(tool_chain, opt::threads)); Settings settings{global_settings}; settings.verbose = -1; // Make check completely silent. |