diff options
Diffstat (limited to 'src/configure.cc')
-rw-r--r-- | src/configure.cc | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/configure.cc b/src/configure.cc index ff4f24d..a43152f 100644 --- a/src/configure.cc +++ b/src/configure.cc @@ -31,7 +31,15 @@ const ctor::configuration& __attribute__((weak)) ctor::get_configuration() static bool initialised{false}; if(!initialised) { - cfg.build_toolchain = getToolChain(cfg.get(ctor::cfg::build_cxx, "/usr/bin/g++")); + std::string cxx_prog{"c++"}; + auto cxx_env = std::getenv("CXX"); + if(cxx_env) + { + cxx_prog = cxx_env; + } + + cfg.build_toolchain = getToolChain(cfg.get(ctor::cfg::build_cxx, cxx_prog)); + initialised = true; } return cfg; @@ -69,7 +77,8 @@ bool ctor::configuration::has(const std::string& key) const return tools.find(key) != tools.end(); } -std::string ctor::configuration::get(const std::string& key, const std::string& default_value) const +std::string ctor::configuration::get(const std::string& key, + const std::string& default_value) const { if(key == ctor::cfg::ctor_includedir && ctor::includedir) { |