Skip to content

Sourcekit cmake changes #5353

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

Merged
merged 2 commits into from
Oct 18, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions tools/SourceKit/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,14 @@ configure_file(
set(SOURCEKIT_DEPLOYMENT_OS "${SWIFT_HOST_VARIANT}")
set(SOURCEKIT_DEPLOYMENT_TARGET "${SWIFT_SDK_${SWIFT_HOST_VARIANT_SDK}_DEPLOYMENT_VERSION}")

swift_is_installing_component(sourcekit-inproc SOURCEKIT_INSTALLING_INPROC)

if("${CMAKE_SYSTEM_NAME}" STREQUAL "Darwin")
set(CMAKE_OSX_SYSROOT "${SWIFT_SDK_${SWIFT_HOST_VARIANT_SDK}_PATH}")
set(CMAKE_OSX_ARCHITECTURES "${SWIFT_HOST_VARIANT_ARCH}")
set(CMAKE_OSX_DEPLOYMENT_TARGET "")
endif()

function(add_sourcekit_symbol_exports target_name export_file)
# Makefile.rules contains special cases for different platforms.
# We restrict ourselves to Darwin for the time being.
Expand Down Expand Up @@ -458,10 +466,6 @@ if("${CMAKE_SYSTEM_NAME}" STREQUAL "Darwin")
string(REGEX MATCH "[0-9]+\\.[0-9]+" SOURCEKIT_DEPLOYMENT_TARGET ${SOURCEKIT_DEPLOYMENT_TARGET})
endif()

# Choose a deployment OS if none was set.
set(SOURCEKIT_DEPLOYMENT_OS "macosx" CACHE STRING
"Deployment OS for SourceKit [macosx, iphoneos, iphonesimulator].")

# Sadly there are two OS naming conventions.
# xcrun SDK name: macosx iphoneos iphonesimulator (+ "internal" or version)
# -mOS-version-min: macosx ios ios-simulator
Expand All @@ -482,10 +486,6 @@ if("${CMAKE_SYSTEM_NAME}" STREQUAL "Darwin")
message(FATAL_ERROR "Can't understand SOURCEKIT_DEPLOYMENT_OS '${SOURCEKIT_DEPLOYMENT_OS}';")
endif()

# Determine deployment flags for the C/C++ compiler and linker.
set(SOURCEKIT_GLOBAL_DEPLOYMENT_TARGET_FLAGS
"-m${version_min_os}-version-min=${SOURCEKIT_DEPLOYMENT_TARGET}")

# Add deployment target to C/C++ compiler and linker flags.
# FIXME: CMAKE_OSX_DEPLOYMENT_TARGET falls over when used for iOS versions.
if (XCODE)
Expand Down
5 changes: 5 additions & 0 deletions utils/build-script-impl
Original file line number Diff line number Diff line change
Expand Up @@ -2781,6 +2781,11 @@ for host in "${ALL_HOSTS[@]}"; do
continue
fi

# Skip this if we're cross compiling and it's the local host.
if [[ $(has_cross_compile_hosts) ]] && [[ ${host} == ${LOCAL_HOST} ]]; then
continue
fi

# Calculate the directory to install products in to.
host_install_destdir=$(get_host_install_destdir ${host})
host_install_prefix=$(get_host_install_prefix ${host})
Expand Down