aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/environment.py
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2016-11-02 11:41:32 -0700
committerGitHub <noreply@github.com>2016-11-02 11:41:32 -0700
commit97c2321740602ed43a5fbf0ca2cad53a2a622cee (patch)
tree809b2b82276627c499808f35b5aaebcf1216d735 /mesonbuild/environment.py
parentafe00697faab16928fc3a801229175a5746d57b7 (diff)
parenteea951c9f358a3a67fcfd479e20c151e91cbca04 (diff)
downloadmeson-97c2321740602ed43a5fbf0ca2cad53a2a622cee.zip
meson-97c2321740602ed43a5fbf0ca2cad53a2a622cee.tar.gz
meson-97c2321740602ed43a5fbf0ca2cad53a2a622cee.tar.bz2
Merge pull request #949 from centricular/has-function-xcode8-fixes
Fix has_function with XCode 8 and related changes
Diffstat (limited to 'mesonbuild/environment.py')
-rw-r--r--mesonbuild/environment.py12
1 files changed, 8 insertions, 4 deletions
diff --git a/mesonbuild/environment.py b/mesonbuild/environment.py
index 86c23ae..b810e20 100644
--- a/mesonbuild/environment.py
+++ b/mesonbuild/environment.py
@@ -833,9 +833,9 @@ class Environment():
return self.coredata.get_builtin_option('datadir')
-def get_args_from_envvars(lang, compiler_is_linker):
+def get_args_from_envvars(compiler):
"""
- @lang: Language to fetch environment flags for
+ @compiler: Compiler to fetch environment flags for
Returns a tuple of (compile_flags, link_flags) for the specified language
from the inherited environment
@@ -844,14 +844,18 @@ def get_args_from_envvars(lang, compiler_is_linker):
if val:
mlog.log('Appending {} from environment: {!r}'.format(var, val))
+ lang = compiler.get_language()
+ compiler_is_linker = False
+ if hasattr(compiler, 'get_linker_exelist'):
+ compiler_is_linker = (compiler.get_exelist() == compiler.get_linker_exelist())
+
if lang not in ('c', 'cpp', 'objc', 'objcpp', 'fortran', 'd'):
return ([], [])
# Compile flags
cflags_mapping = {'c': 'CFLAGS', 'cpp': 'CXXFLAGS',
'objc': 'OBJCFLAGS', 'objcpp': 'OBJCXXFLAGS',
- 'fortran': 'FFLAGS',
- 'd': 'DFLAGS'}
+ 'fortran': 'FFLAGS', 'd': 'DFLAGS'}
compile_flags = os.environ.get(cflags_mapping[lang], '')
log_var(cflags_mapping[lang], compile_flags)
compile_flags = compile_flags.split()