Check for argument leagake over languages.

This commit is contained in:
Jussi Pakkanen 2013-01-26 13:26:00 +02:00
parent b97f43b9b7
commit f0cec5bd79
3 changed files with 13 additions and 3 deletions

View File

@ -1,7 +1,7 @@
project('global arg test', 'c++', 'c') project('global arg test', 'c++', 'c')
add_global_arguments('c', '-Werror', '-DMYTHING') add_global_arguments('c', '-DMYTHING')
add_global_arguments('c++', '-Werror', '-std=c++11') add_global_arguments('c++', '-DMYCXXTHING')
exe1 = executable('prog', 'prog.c') exe1 = executable('prog', 'prog.c')
exe2 = executable('prog2', 'prog.cc') exe2 = executable('prog2', 'prog.cc')

View File

@ -2,6 +2,10 @@
#error "Global argument not set" #error "Global argument not set"
#endif #endif
#ifdef MYCXXTHING
#error "Wrong global argument set"
#endif
int main(int argc, char **argv) { int main(int argc, char **argv) {
return 0; return 0;
} }

View File

@ -1,4 +1,10 @@
#include<unordered_map> #ifdef MYTHING
#error "Wrong global argument set"
#endif
#ifndef MYCXXTHING
#error "Global argument not set"
#endif
int main(int argc, char **argv) { int main(int argc, char **argv) {
return 0; return 0;