aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/backend/backends.py
diff options
context:
space:
mode:
authorOle André Vadla RavnÄs <oleavr@gmail.com>2017-05-21 20:35:44 +0200
committerJussi Pakkanen <jpakkane@gmail.com>2017-05-21 23:04:19 +0300
commitb595cda4ed0ca699da3052a6bd30ba7d1dae1124 (patch)
tree587c4654ebe3d2956fdca855c23f62f32e5fa346 /mesonbuild/backend/backends.py
parent5794f37af5c5ce0010168d163f2568d7581b5a13 (diff)
downloadmeson-b595cda4ed0ca699da3052a6bd30ba7d1dae1124.zip
meson-b595cda4ed0ca699da3052a6bd30ba7d1dae1124.tar.gz
meson-b595cda4ed0ca699da3052a6bd30ba7d1dae1124.tar.bz2
Fix cross environment pollution.
Environment variables like CFLAGS and LDFLAGS should not affect the cross environment. Fixes #1772
Diffstat (limited to 'mesonbuild/backend/backends.py')
-rw-r--r--mesonbuild/backend/backends.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/mesonbuild/backend/backends.py b/mesonbuild/backend/backends.py
index a95294b..75974a5 100644
--- a/mesonbuild/backend/backends.py
+++ b/mesonbuild/backend/backends.py
@@ -405,9 +405,10 @@ class Backend:
# Add compile args added using add_global_arguments()
# These override per-project arguments
commands += self.build.get_global_args(compiler)
- # Compile args added from the env: CFLAGS/CXXFLAGS, etc. We want these
- # to override all the defaults, but not the per-target compile args.
- commands += self.environment.coredata.external_args[compiler.get_language()]
+ if not target.is_cross:
+ # Compile args added from the env: CFLAGS/CXXFLAGS, etc. We want these
+ # to override all the defaults, but not the per-target compile args.
+ commands += self.environment.coredata.external_args[compiler.get_language()]
# Always set -fPIC for shared libraries
if isinstance(target, build.SharedLibrary):
commands += compiler.get_pic_args()