1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-18 14:21:41 +00:00

SCons: Fix get_compiler_version() to return ints

Otherwise comparisons would fail for compiler versions above 10.
Also simplified code somewhat to avoid using subprocess too much
needlessly.
This commit is contained in:
Rémi Verschelde
2020-02-26 13:23:37 +01:00
parent 1e57b558f2
commit c7dc5142b5
3 changed files with 23 additions and 34 deletions

View File

@@ -179,18 +179,10 @@ def configure(env):
env.Append(CCFLAGS=['-pipe'])
env.Append(LINKFLAGS=['-pipe'])
# Check for gcc version >= 6 before adding -no-pie
if using_gcc(env):
version = get_compiler_version(env)
if version != None and version[0] >= '6':
env.Append(CCFLAGS=['-fpie'])
env.Append(LINKFLAGS=['-no-pie'])
# Do the same for clang should be fine with Clang 4 and higher
if using_clang(env):
version = get_compiler_version(env)
if version != None and version[0] >= '4':
env.Append(CCFLAGS=['-fpie'])
env.Append(LINKFLAGS=['-no-pie'])
# -fpie and -no-pie is supported on GCC 6+ and Clang 4+, both below our
# minimal requirements.
env.Append(CCFLAGS=['-fpie'])
env.Append(LINKFLAGS=['-no-pie'])
## Dependencies