summaryrefslogtreecommitdiff
path: root/platform/x11
diff options
context:
space:
mode:
authormarxin <mliska@suse.cz>2019-02-12 21:10:08 +0100
committerRĂ©mi Verschelde <rverschelde@gmail.com>2019-02-20 19:44:12 +0100
commit8d51618949d5ea8a94e0f504401e8f852a393968 (patch)
tree6c0ab829b02aba47ff3dc27b9a14d3c3a0658a3b /platform/x11
parent132e2f458df7a3551a251d68afeccd0362ca6be2 (diff)
Add -Wshadow=local to warnings and fix reported issues.
Fixes #25316.
Diffstat (limited to 'platform/x11')
-rw-r--r--platform/x11/detect.py19
1 files changed, 6 insertions, 13 deletions
diff --git a/platform/x11/detect.py b/platform/x11/detect.py
index 72139538b7..16760f9407 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
def is_active():
return True
@@ -161,18 +161,11 @@ def configure(env):
env.Append(CCFLAGS=['-pipe'])
env.Append(LINKFLAGS=['-pipe'])
- # Check for gcc version > 5 before adding -no-pie
- import re
- import subprocess
- proc = subprocess.Popen([env['CXX'], '--version'], stdout=subprocess.PIPE)
- (stdout, _) = proc.communicate()
- stdout = decode_utf8(stdout)
- match = re.search('[0-9][0-9.]*', stdout)
- if match is not None:
- version = match.group().split('.')
- if (version[0] > '5'):
- env.Append(CCFLAGS=['-fpie'])
- env.Append(LINKFLAGS=['-no-pie'])
+ # 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'])
## Dependencies