| 1 |
project('has function xcode8', 'c') |
| 2 |
|
| 3 |
cc = meson.get_compiler('c') |
| 4 |
|
| 5 |
# XCode 8 location for the macOS 10.12 SDK |
| 6 |
sdk_args = ['-isysroot', '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk'] |
| 7 |
args_10_11 = ['-mmacosx-version-min=10.11'] + sdk_args |
| 8 |
args_10_12 = ['-mmacosx-version-min=10.12'] + sdk_args |
| 9 |
|
| 10 |
# XCode 9 location for the macOS 10.13 SDK |
| 11 |
sdk_args = ['-isysroot', '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk'] |
| 12 |
args_10_12 = ['-mmacosx-version-min=10.13'] + sdk_args |
| 13 |
|
| 14 |
# Test requires XCode 8 which has the MacOSX 10.12 SDK |
| 15 |
if cc.version().version_compare('>=8.0', '<8.1') |
| 16 |
if cc.has_function('clock_gettime', args : args_10_11, prefix : '#include <time.h>') |
| 17 |
error('Should not have found clock_gettime via <time.h> when targeting Mac OS X 10.11') |
| 18 |
endif |
| 19 |
if not cc.has_function('clock_gettime', args : args_10_12, prefix : '#include <time.h>') |
| 20 |
error('Did NOT find clock_gettime via <time.h> when targeting Mac OS X 10.12') |
| 21 |
endif |
| 22 |
if not cc.has_function('clock_gettime', args : args_10_11) |
| 23 |
error('Did NOT find clock_gettime w/o a prototype when targeting Mac OS X 10.11') |
| 24 |
endif |
| 25 |
if not cc.has_function('clock_gettime', args : args_10_12) |
| 26 |
error('Did NOT find clock_gettime w/o a prototype when targeting Mac OS X 10.12') |
| 27 |
endif |
| 28 |
else |
| 29 |
error('MESON_SKIP_TEST Test needs XCode 8.') |
| 30 |
endif |