mirror of
https://github.com/godotengine/godot.git
synced 2024-11-10 14:12:51 +00:00
Merge pull request #26160 from marxin/come-up-with-use_gcc
Come up with use_gcc.
This commit is contained in:
commit
fc5792f2ea
@ -339,7 +339,7 @@ if selected_platform in platform_list:
|
|||||||
shadow_local_warning = []
|
shadow_local_warning = []
|
||||||
all_plus_warnings = ['-Wwrite-strings']
|
all_plus_warnings = ['-Wwrite-strings']
|
||||||
|
|
||||||
if 'gcc' in os.path.basename(env["CC"]):
|
if methods.use_gcc(env):
|
||||||
version = methods.get_compiler_version(env)
|
version = methods.get_compiler_version(env)
|
||||||
if version != None and version[0] >= '7':
|
if version != None and version[0] >= '7':
|
||||||
shadow_local_warning = ['-Wshadow-local']
|
shadow_local_warning = ['-Wshadow-local']
|
||||||
|
@ -667,3 +667,6 @@ def get_compiler_version(env):
|
|||||||
return match.group().split('.')
|
return match.group().split('.')
|
||||||
else:
|
else:
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
def use_gcc(env):
|
||||||
|
return 'gcc' in os.path.basename(env["CC"])
|
||||||
|
@ -2,7 +2,7 @@ import os
|
|||||||
import platform
|
import platform
|
||||||
import sys
|
import sys
|
||||||
from compat import decode_utf8
|
from compat import decode_utf8
|
||||||
from methods import get_compiler_version
|
from methods import get_compiler_version, use_gcc
|
||||||
|
|
||||||
def is_active():
|
def is_active():
|
||||||
return True
|
return True
|
||||||
@ -162,10 +162,11 @@ def configure(env):
|
|||||||
env.Append(LINKFLAGS=['-pipe'])
|
env.Append(LINKFLAGS=['-pipe'])
|
||||||
|
|
||||||
# Check for gcc version >= 6 before adding -no-pie
|
# Check for gcc version >= 6 before adding -no-pie
|
||||||
version = get_compiler_version(env)
|
if use_gcc(env):
|
||||||
if version != None and version[0] > '6':
|
version = get_compiler_version(env)
|
||||||
env.Append(CCFLAGS=['-fpie'])
|
if version != None and version[0] >= '6':
|
||||||
env.Append(LINKFLAGS=['-no-pie'])
|
env.Append(CCFLAGS=['-fpie'])
|
||||||
|
env.Append(LINKFLAGS=['-no-pie'])
|
||||||
|
|
||||||
## Dependencies
|
## Dependencies
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user