summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBent Bisballe Nyeng <deva@aasimon.org>2023-01-17 13:35:05 +0100
committerBent Bisballe Nyeng <deva@aasimon.org>2023-01-17 13:35:26 +0100
commit79c11f3dbaad391633c2678e85eeaba267df5ee1 (patch)
tree6993397fc0c68fdc41bfb9b9c621fde9a3a56b14 /src
parentc11bbf8455b065c22c7a2147b33fb6a9c8c43e11 (diff)
Recognize gcc and clang (not just their c++ variants) in tool-chain detection.
Diffstat (limited to 'src')
-rw-r--r--src/ctor.h8
-rw-r--r--src/tools.cc6
2 files changed, 8 insertions, 6 deletions
diff --git a/src/ctor.h b/src/ctor.h
index 9738949..4e0a247 100644
--- a/src/ctor.h
+++ b/src/ctor.h
@@ -122,10 +122,10 @@ enum class ld_opt
enum class ar_opt
{
// gcc/clang
- replace, // -r
- add_index, // -s
- create, // -c
- output, // <arg>
+ replace, // -r
+ add_index, // -s
+ create, // -c
+ output, // <arg>
custom, // entire option taken verbatim from <arg>
};
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;
}