Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tests: add a test case for the MACOSX_DEPLOYMENT_TARGET env #11011

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
21 changes: 21 additions & 0 deletions test cases/common/36 has function/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -113,4 +113,25 @@ foreach cc : compilers
assert(cc.has_function('__builtin_constant_p', args : unit_test_args),
'__builtin_constant_p must be found under gcc and clang')
endif

# Test whether the `MACOSX_DEPLOYMENT_TARGET=10.13` env is honored.
if host_system == 'darwin'
# Only available on macOS 10.13 or newer
assert(cc.has_function('utimensat',
prefix : '#include <sys/stat.h>'),
'utimensat must be found when targeting macOS 10.13')

# Introduced in macOS 11.0
assert(not cc.has_function('pthread_jit_write_protect_np',
prefix : '#include <pthread.h>'),
'pthread_jit_write_protect_np must not be found' +
' when targeting macOS 10.13')

# Same as above, without `prefix: '#include <pthread.h>'`,
# this is currently incorrectly detected as found, see:
# FIXME: https://github.com/mesonbuild/meson/issues/3482
assert(cc.has_function('pthread_jit_write_protect_np'),
'pthread_jit_write_protect_np must not be found' +
' when targeting macOS 10.13')
endif
endforeach
5 changes: 5 additions & 0 deletions test cases/common/36 has function/test.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"env": {
"MACOSX_DEPLOYMENT_TARGET": "10.13"
}
}