diff options
author | Hein-Pieter van Braam <hp@tmm.cx> | 2019-02-25 00:50:53 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-02-25 00:50:53 +0100 |
commit | fc5792f2ea5c3fcd9de4d4200763313ab4052a8f (patch) | |
tree | 276ef20eaa1aac76426b00f4e3f317f2bf647c9e | |
parent | 3d5fc1bb38f8749e27b3f987becf2b92b878323b (diff) | |
parent | 0d2a105e6b6ff5d28daeed140faa0b2c3f66254a (diff) |
Merge pull request #26160 from marxin/come-up-with-use_gcc
Come up with use_gcc.
-rw-r--r-- | SConstruct | 2 | ||||
-rw-r--r-- | methods.py | 3 | ||||
-rw-r--r-- | platform/x11/detect.py | 11 |
3 files changed, 10 insertions, 6 deletions
diff --git a/SConstruct b/SConstruct index 8ecb17b4e7..df1be4bfd7 100644 --- a/SConstruct +++ b/SConstruct @@ -339,7 +339,7 @@ if selected_platform in platform_list: shadow_local_warning = [] all_plus_warnings = ['-Wwrite-strings'] - if 'gcc' in os.path.basename(env["CC"]): + if methods.use_gcc(env): version = methods.get_compiler_version(env) if version != None and version[0] >= '7': shadow_local_warning = ['-Wshadow-local'] diff --git a/methods.py b/methods.py index d8e90a8da5..2d4dc4921f 100644 --- a/methods.py +++ b/methods.py @@ -667,3 +667,6 @@ def get_compiler_version(env): return match.group().split('.') else: return None + +def use_gcc(env): + return 'gcc' in os.path.basename(env["CC"]) diff --git a/platform/x11/detect.py b/platform/x11/detect.py index 16760f9407..1355ae542d 100644 --- a/platform/x11/detect.py +++ b/platform/x11/detect.py @@ -2,7 +2,7 @@ import os import platform import sys from compat import decode_utf8 -from methods import get_compiler_version +from methods import get_compiler_version, use_gcc def is_active(): return True @@ -162,10 +162,11 @@ def configure(env): env.Append(LINKFLAGS=['-pipe']) # Check for gcc version >= 6 before adding -no-pie - version = get_compiler_version(env) - if version != None and version[0] > '6': - env.Append(CCFLAGS=['-fpie']) - env.Append(LINKFLAGS=['-no-pie']) + if use_gcc(env): + version = get_compiler_version(env) + if version != None and version[0] >= '6': + env.Append(CCFLAGS=['-fpie']) + env.Append(LINKFLAGS=['-no-pie']) ## Dependencies |