diff options
author | Dylan Baker <dylan@pnwbakers.com> | 2022-03-29 14:20:15 -0700 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2022-06-08 23:19:09 +0300 |
commit | 5f02d0d9e164a5bcda072d223eaa5bc92b57747e (patch) | |
tree | 55762ead53d30cbef518cfc600fc1707545e83ea | |
parent | a8521fef70ef76fb742d80aceb2e9ed634bd6a70 (diff) | |
download | meson-5f02d0d9e164a5bcda072d223eaa5bc92b57747e.zip meson-5f02d0d9e164a5bcda072d223eaa5bc92b57747e.tar.gz meson-5f02d0d9e164a5bcda072d223eaa5bc92b57747e.tar.bz2 |
build: check for -fno-pic and -fno-pie while we're checking for pic and pie
-rw-r--r-- | mesonbuild/build.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/mesonbuild/build.py b/mesonbuild/build.py index a8452da..bea1473 100644 --- a/mesonbuild/build.py +++ b/mesonbuild/build.py @@ -1277,10 +1277,13 @@ class BuildTarget(Target): def _extract_pic_pie(self, kwargs, arg: str, option: str): # Check if we have -fPIC, -fpic, -fPIE, or -fpie in cflags - all_flags = self.extra_args['c'] + self.extra_args['cpp'] - if '-f' + arg.lower() in all_flags or '-f' + arg.upper() in all_flags: + all_flags = set(self.extra_args['c']) | set(self.extra_args['cpp']) + if {f'-f-{arg.lower()}', f'-f-{arg.upper()}'}.issubset(all_flags): mlog.warning(f"Use the '{arg}' kwarg instead of passing '-f{arg}' manually to {self.name!r}") return True + elif {f'-fno-{arg.lower()}', f'-fno-{arg.upper()}'}.issubset(all_flags): + mlog.warning(f"Use the '{arg}' kwarg instead of passing '-fno-{arg}' manually to {self.name!r}") + return False k = OptionKey(option) if arg in kwargs: |