diff options
Diffstat (limited to 'src/bootstrap.cc')
-rw-r--r-- | src/bootstrap.cc | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/src/bootstrap.cc b/src/bootstrap.cc index 9a3c321..97fe6fa 100644 --- a/src/bootstrap.cc +++ b/src/bootstrap.cc @@ -3,6 +3,7 @@ // See accompanying file LICENSE for details. #include <iostream> #include <array> +#include <cstdlib> #define BOOTSTRAP @@ -17,6 +18,7 @@ #include "tasks.cc" #include "build.cc" #include "tools.cc" +#include "../ctor.cc" std::filesystem::path configurationFile("configuration.cc"); std::filesystem::path configHeaderFile("config.h"); @@ -35,6 +37,24 @@ bool hasConfiguration(const std::string& key) const std::string& getConfiguration(const std::string& key, const std::string& defaultValue) { + if(key == cfg::host_cxx && std::getenv("CXX")) + { + static std::string s = std::getenv("CXX"); + return s; + } + + if(key == cfg::host_cc && std::getenv("CC")) + { + static std::string s = std::getenv("CC"); + return s; + } + + if(key == cfg::host_ar && std::getenv("AR")) + { + static std::string s = std::getenv("AR"); + return s; + } + return defaultValue; } @@ -51,7 +71,7 @@ int main(int argc, char* argv[]) settings.builddir = getConfiguration(cfg::builddir, "build"); settings.parallel_processes = - std::max(1u, std::thread::hardware_concurrency() * 2 - 1); + (std::max)(1u, std::thread::hardware_concurrency() * 2 - 1); settings.verbose = 0; auto all_tasks = getTasks(settings, {}, false); for(auto task : all_tasks) |