diff options
author | Bent Bisballe Nyeng <deva@aasimon.org> | 2022-08-19 18:09:25 +0200 |
---|---|---|
committer | Bent Bisballe Nyeng <deva@aasimon.org> | 2022-08-19 18:09:25 +0200 |
commit | 7436d83ef371d4fee4a66bec235e102ed80275db (patch) | |
tree | 243b416b1b6e10a43b9495121af0e57522543de0 /src/bootstrap.cc | |
parent | e1030dc6e69863438fe35a628bd6af9abc814b4a (diff) |
Add support for msvc tool-chain (cl.exe/link.exe and lib.exe) on windows.
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) |