aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Ericson <John.Ericson@Obsidian.Systems>2019-04-12 20:05:35 -0400
committerNirbheek Chauhan <nirbheek.chauhan@gmail.com>2019-04-16 17:52:16 +0000
commitd3c191b7a3f8a9d99e1ac25efd5f90a80501147e (patch)
tree8743ba3f3bbef239a40eaeb3d646e6b856ac6c57
parent997281f6387579f92df754bbea18f235949f2e3b (diff)
downloadmeson-d3c191b7a3f8a9d99e1ac25efd5f90a80501147e.zip
meson-d3c191b7a3f8a9d99e1ac25efd5f90a80501147e.tar.gz
meson-d3c191b7a3f8a9d99e1ac25efd5f90a80501147e.tar.bz2
Fix `-Dc_std=...` not affecting cross compilation.
Certain compiler options should affect all platforms for backwards compatibility. We should probably replace this list with a generic way to affect all or just one platform.
-rw-r--r--mesonbuild/coredata.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/mesonbuild/coredata.py b/mesonbuild/coredata.py
index 066ad30..206eb57 100644
--- a/mesonbuild/coredata.py
+++ b/mesonbuild/coredata.py
@@ -592,7 +592,13 @@ class CoreData:
k in env.cmd_line_options):
# TODO think about cross and command-line interface.
o.set_value(env.cmd_line_options[k])
- self.compiler_options[for_machine].setdefault(k, o)
+ if k in ['c_std', 'cpp_std']:
+ # These CLI options should affect all platforms
+ for m in iter(MachineChoice):
+ self.compiler_options[m].setdefault(k, o)
+ else:
+ # By default, CLI options just affect the native platform
+ self.compiler_options[for_machine].setdefault(k, o)
# Unlike compiler and linker flags, preprocessor flags are not in
# compiler_options because they are not visible to user.