mirror of
https://github.com/godotengine/godot.git
synced 2026-01-03 18:11:19 +03: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. (cherry picked from commitsc7dc5142b5anddf7ecfc4a7)
This commit is contained in:
@@ -350,12 +350,13 @@ if selected_platform in platform_list:
|
||||
# Force to use Unicode encoding
|
||||
env.Append(MSVC_FLAGS=['/utf8'])
|
||||
else: # Rest of the world
|
||||
version = methods.get_compiler_version(env) or [-1, -1]
|
||||
|
||||
shadow_local_warning = []
|
||||
all_plus_warnings = ['-Wwrite-strings']
|
||||
|
||||
if methods.using_gcc(env):
|
||||
version = methods.get_compiler_version(env)
|
||||
if version != None and version[0] >= '7':
|
||||
if version[0] >= 7:
|
||||
shadow_local_warning = ['-Wshadow-local']
|
||||
|
||||
if (env["warnings"] == 'extra'):
|
||||
@@ -369,8 +370,7 @@ if selected_platform in platform_list:
|
||||
'-Wduplicated-branches', '-Wduplicated-cond',
|
||||
'-Wstringop-overflow=4', '-Wlogical-op'])
|
||||
env.Append(CXXFLAGS=['-Wnoexcept', '-Wplacement-new=1'])
|
||||
version = methods.get_compiler_version(env)
|
||||
if version != None and version[0] >= '9':
|
||||
if version[0] >= 9:
|
||||
env.Append(CCFLAGS=['-Wattribute-alias=2'])
|
||||
elif (env["warnings"] == 'all'):
|
||||
env.Append(CCFLAGS=['-Wall'] + shadow_local_warning)
|
||||
|
||||
Reference in New Issue
Block a user