From 79c11f3dbaad391633c2678e85eeaba267df5ee1 Mon Sep 17 00:00:00 2001 From: Bent Bisballe Nyeng Date: Tue, 17 Jan 2023 13:35:05 +0100 Subject: Recognize gcc and clang (not just their c++ variants) in tool-chain detection. --- src/tools.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/tools.cc') diff --git a/src/tools.cc b/src/tools.cc index 6d4c34b..a83f115 100644 --- a/src/tools.cc +++ b/src/tools.cc @@ -109,11 +109,13 @@ ctor::toolchain getToolChain(const std::string& compiler) auto cc_cmd = cc.stem().string(); // Note: "g++" is a substring of "clang++" so "clang++" must be tested first. - if(cc_cmd.find("clang++") != std::string::npos) + if(cc_cmd.find("clang++") != std::string::npos || + cc_cmd.find("clang") != std::string::npos) { return ctor::toolchain::clang; } - else if(cc_cmd.find("g++") != std::string::npos) + else if(cc_cmd.find("g++") != std::string::npos || + cc_cmd.find("gcc") != std::string::npos) { return ctor::toolchain::gcc; } -- cgit v1.2.3