-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #949 from centricular/has-function-xcode8-fixes
Fix has_function with XCode 8 and related changes
- Loading branch information
Showing
4 changed files
with
138 additions
and
86 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |