diff options
author | Nirbheek Chauhan <nirbheek@centricular.com> | 2017-03-24 19:43:21 +0530 |
---|---|---|
committer | Nirbheek Chauhan <nirbheek@centricular.com> | 2017-04-04 23:38:36 +0530 |
commit | 6042e21e25e31d4bb794ab83237beac511a15837 (patch) | |
tree | 09934d50be897233b3044ce3fbf995ebd273a164 /mesonbuild/environment.py | |
parent | 09fee02dd9484e682401469ff890cf99ef5fa56a (diff) | |
download | meson-6042e21e25e31d4bb794ab83237beac511a15837.zip meson-6042e21e25e31d4bb794ab83237beac511a15837.tar.gz meson-6042e21e25e31d4bb794ab83237beac511a15837.tar.bz2 |
Use CPPFLAGS for pre-processor compiler checks
Also don't add CFLAGS twice for links() checks
Includes a test for this.
Diffstat (limited to 'mesonbuild/environment.py')
-rw-r--r-- | mesonbuild/environment.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/mesonbuild/environment.py b/mesonbuild/environment.py index f2de31a..cb62506 100644 --- a/mesonbuild/environment.py +++ b/mesonbuild/environment.py @@ -770,7 +770,7 @@ def get_args_from_envvars(compiler): compiler_is_linker = (compiler.get_exelist() == compiler.get_linker_exelist()) if lang not in ('c', 'cpp', 'objc', 'objcpp', 'fortran', 'd'): - return [], [] + return [], [], [] # Compile flags cflags_mapping = {'c': 'CFLAGS', @@ -794,7 +794,7 @@ def get_args_from_envvars(compiler): # this when the linker is stand-alone such as with MSVC C/C++, etc. link_flags = compile_flags + link_flags - # Pre-processof rlags (not for fortran) + # Pre-processor flags (not for fortran or D) preproc_flags = '' if lang in ('c', 'cpp', 'objc', 'objcpp'): preproc_flags = os.environ.get('CPPFLAGS', '') @@ -802,7 +802,7 @@ def get_args_from_envvars(compiler): preproc_flags = shlex.split(preproc_flags) compile_flags += preproc_flags - return compile_flags, link_flags + return preproc_flags, compile_flags, link_flags class CrossBuildInfo: def __init__(self, filename): |