Or other language flags that use CPPFLAGS (like CXXFLAGS). The problem here is actually rather simple, `dict.setdefault()` doesn't work like I thought it did, I thought it created a weak entry, but it actually is equivalent to: ```python if k not in dict: dict[k] = v ``` Instead we'll use an intermediate dictionary (a default dictionary actually, since that makes things a little cleaner) and then add the keys from that dict to self.options as applicable. Test case written by Jussi, Fix by Dylan Co-authored-by: Jussi Pakkanen Fixes: #8361 Fixes: #8345pull/8380/head
parent
7812ceec5f
commit
10d94a12b8
6 changed files with 60 additions and 8 deletions
@ -0,0 +1,4 @@ |
||||
project('multienv', 'c', 'cpp') |
||||
|
||||
executable('cexe', 'prog.c') |
||||
executable('cppexe', 'prog.cpp') |
@ -0,0 +1,18 @@ |
||||
#include<stdio.h> |
||||
|
||||
#ifndef CPPFLAG |
||||
#error CPPFLAG not set |
||||
#endif |
||||
|
||||
#ifndef CFLAG |
||||
#error CFLAGS not set |
||||
#endif |
||||
|
||||
#ifdef CXXFLAG |
||||
#error CXXFLAG is set |
||||
#endif |
||||
|
||||
int main(int argc, char **argv) { |
||||
printf("%d %s\n", argc, argv[0]); |
||||
return 0; |
||||
} |
@ -0,0 +1,18 @@ |
||||
#include<cstdio> |
||||
|
||||
#ifndef CPPFLAG |
||||
#error CPPFLAG not set |
||||
#endif |
||||
|
||||
#ifdef CFLAG |
||||
#error CFLAG is set |
||||
#endif |
||||
|
||||
#ifndef CXXFLAG |
||||
#error CXXFLAG not set |
||||
#endif |
||||
|
||||
int main(int argc, char **argv) { |
||||
printf("%d %s\n", argc, argv[0]); |
||||
return 0; |
||||
} |
Loading…
Reference in new issue