1 |
--- |
2 |
eclass/toolchain-funcs.eclass | 14 ++++++++++++++ |
3 |
1 file changed, 14 insertions(+) |
4 |
|
5 |
diff --git a/eclass/toolchain-funcs.eclass b/eclass/toolchain-funcs.eclass |
6 |
index 116bc43..00dec40 100644 |
7 |
--- a/eclass/toolchain-funcs.eclass |
8 |
+++ b/eclass/toolchain-funcs.eclass |
9 |
@@ -604,6 +604,20 @@ tc-get-compiler-type() { |
10 |
fi |
11 |
} |
12 |
|
13 |
+# @FUNCTION: tc-is-gcc |
14 |
+# @DESCRIPTION: |
15 |
+# Return true if the current compiler is pure GCC. |
16 |
+tc-is-gcc() { |
17 |
+ [[ $(tc-get-compiler-type) == gcc ]] |
18 |
+} |
19 |
+ |
20 |
+# @FUNCTION: tc-is-clang |
21 |
+# @DESCRIPTION: |
22 |
+# Return true if the current compiler is clang. |
23 |
+tc-is-clang() { |
24 |
+ [[ $(tc-get-compiler-type) == clang ]] |
25 |
+} |
26 |
+ |
27 |
# Internal func. The first argument is the version info to expand. |
28 |
# Query the preprocessor to improve compatibility across different |
29 |
# compilers rather than maintaining a --version flag matrix. #335943 |
30 |
-- |
31 |
2.9.0 |