The Meson Build System
http://mesonbuild.com/
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
769 B
22 lines
769 B
8 years ago
|
project('has member', 'c', 'cpp')
|
||
11 years ago
|
|
||
8 years ago
|
compilers = [meson.get_compiler('c'), meson.get_compiler('cpp')]
|
||
11 years ago
|
|
||
8 years ago
|
foreach cc : compilers
|
||
|
if not cc.has_member('struct tm', 'tm_sec', prefix : '#include<time.h>')
|
||
|
error('Did not detect member of "struct tm" that exists: "tm_sec"')
|
||
|
endif
|
||
11 years ago
|
|
||
8 years ago
|
if cc.has_member('struct tm', 'tm_nonexistent', prefix : '#include<time.h>')
|
||
|
error('Not existing member "tm_nonexistent" found.')
|
||
|
endif
|
||
8 years ago
|
|
||
8 years ago
|
if not cc.has_members('struct tm', 'tm_sec', 'tm_min', prefix : '#include<time.h>')
|
||
|
error('Did not detect members of "struct tm" that exist: "tm_sec" "tm_min"')
|
||
|
endif
|
||
8 years ago
|
|
||
8 years ago
|
if cc.has_members('struct tm', 'tm_sec', 'tm_nonexistent2', prefix : '#include<time.h>')
|
||
|
error('Not existing member "tm_nonexistent2" found.')
|
||
|
endif
|
||
|
endforeach
|