diff options
author | Nirbheek Chauhan <nirbheek@centricular.com> | 2016-10-25 09:18:54 +0530 |
---|---|---|
committer | Nirbheek Chauhan <nirbheek@centricular.com> | 2016-10-26 23:16:07 +0530 |
commit | eea951c9f358a3a67fcfd479e20c151e91cbca04 (patch) | |
tree | c82d6d25cfdebd5df3193860e053347ff3da232b /test cases/osx | |
parent | 5ffb0bcd0dad9bfa1601dbeee1400b6653199722 (diff) | |
download | meson-eea951c9f358a3a67fcfd479e20c151e91cbca04.zip meson-eea951c9f358a3a67fcfd479e20c151e91cbca04.tar.gz meson-eea951c9f358a3a67fcfd479e20c151e91cbca04.tar.bz2 |
Add osx test for the XCode 8 fixes to has_function
Diffstat (limited to 'test cases/osx')
-rw-r--r-- | test cases/osx/3 has function xcode8/meson.build | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/test cases/osx/3 has function xcode8/meson.build b/test cases/osx/3 has function xcode8/meson.build new file mode 100644 index 0000000..300d352 --- /dev/null +++ b/test cases/osx/3 has function xcode8/meson.build @@ -0,0 +1,26 @@ +project('has function xcode8', 'c') + +cc = meson.get_compiler('c') + +# XCode 8 location for the macOS 10.12 SDK +sdk_args = ['-isysroot', '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk'] +args_10_11 = ['-mmacosx-version-min=10.11'] + sdk_args +args_10_12 = ['-mmacosx-version-min=10.12'] + sdk_args + +# Test requires XCode 8 which has the MacOSX 10.12 SDK +if cc.version().version_compare('>=8.0') + if cc.has_function('clock_gettime', args : args_10_11, prefix : '#include <time.h>') + error('Should not have found clock_gettime via <time.h> when targetting Mac OS X 10.11') + endif + if not cc.has_function('clock_gettime', args : args_10_12, prefix : '#include <time.h>') + error('Did NOT find clock_gettime via <time.h> when targetting Mac OS X 10.12') + endif + if not cc.has_function('clock_gettime', args : args_10_11) + error('Did NOT find clock_gettime w/o a prototype when targetting Mac OS X 10.11') + endif + if not cc.has_function('clock_gettime', args : args_10_12) + error('Did NOT find clock_gettime w/o a prototype when targetting Mac OS X 10.12') + endif +else + message('Test needs XCode 8, skipping...') +endif |