Add manually overriding of the darwin SDK version

Summary:
When doing cross-compilation from Linux to MacOS we don't have
access to have access to `xcodebuild` and therefore need a way
to set the SDK version from the outside.

Fixes https://reviews.llvm.org/D68292#1853594 for me.

Reviewers: delcypher, yln

Reviewed By: delcypher

Subscribers: #julialang, mgorny, #sanitizers

Tags: #sanitizers

Differential Revision: https://reviews.llvm.org/D77026
This commit is contained in:
Valentin Churavy 2020-03-31 12:48:59 -04:00
parent a76e68c970
commit cba15d1b5c
No known key found for this signature in database
GPG Key ID: 02E09F0CCD46FF9D
1 changed files with 5 additions and 2 deletions

View File

@ -44,8 +44,11 @@ function(find_darwin_sdk_dir var sdk_name)
endfunction()
function(find_darwin_sdk_version var sdk_name)
# We deliberately don't cache the result here because
# CMake's caching causes too many problems.
if (DARWIN_${sdk_name}_OVERRIDE_SDK_VERSION)
message(WARNING "Overriding ${sdk_name} SDK version to ${DARWIN_${sdk_name}_OVERRIDE_SDK_VERSION}")
set(${var} "${DARWIN_${sdk_name}_OVERRIDE_SDK_VERSION}" PARENT_SCOPE)
return()
endif()
set(result_process 1)
if(NOT DARWIN_PREFER_PUBLIC_SDK)
# Let's first try the internal SDK, otherwise use the public SDK.