public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
Search results ordered by [date|relevance]  view[summary|nested|Atom feed]
thread overview below | download: 
* [gentoo-dev] [PATCH 4/4] toolchain-funcs.eclass: Add helpful tc-is-{gcc,clang} wrappers
  @ 2016-06-22 20:06 99% ` Michał Górny
  0 siblings, 0 replies; 1+ results
From: Michał Górny @ 2016-06-22 20:06 UTC (permalink / raw
  To: gentoo-dev; +Cc: toolchain, Michał Górny

---
 eclass/toolchain-funcs.eclass | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/eclass/toolchain-funcs.eclass b/eclass/toolchain-funcs.eclass
index 116bc43..00dec40 100644
--- a/eclass/toolchain-funcs.eclass
+++ b/eclass/toolchain-funcs.eclass
@@ -604,6 +604,20 @@ tc-get-compiler-type() {
 	fi
 }
 
+# @FUNCTION: tc-is-gcc
+# @DESCRIPTION:
+# Return true if the current compiler is pure GCC.
+tc-is-gcc() {
+	[[ $(tc-get-compiler-type) == gcc ]]
+}
+
+# @FUNCTION: tc-is-clang
+# @DESCRIPTION:
+# Return true if the current compiler is clang.
+tc-is-clang() {
+	[[ $(tc-get-compiler-type) == clang ]]
+}
+
 # Internal func.  The first argument is the version info to expand.
 # Query the preprocessor to improve compatibility across different
 # compilers rather than maintaining a --version flag matrix. #335943
-- 
2.9.0



^ permalink raw reply related	[relevance 99%]

Results 1-1 of 1 | reverse | options above
-- pct% links below jump to the message on this page, permalinks otherwise --
2016-06-22 20:06     [gentoo-dev] [PATCH 0/4] toolchain-funcs.eclass: fix for version checks (v2) + compiler identification Michał Górny
2016-06-22 20:06 99% ` [gentoo-dev] [PATCH 4/4] toolchain-funcs.eclass: Add helpful tc-is-{gcc,clang} wrappers Michał Górny

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox