Skip to content

Commit 4c6f7e6

Browse files
authored
Merge pull request #5353 from erg/sourcekit-cmake
Sourcekit cmake changes
2 parents db816f8 + e032658 commit 4c6f7e6

File tree

2 files changed

+13
-8
lines changed

2 files changed

+13
-8
lines changed

tools/SourceKit/CMakeLists.txt

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,14 @@ configure_file(
2020
set(SOURCEKIT_DEPLOYMENT_OS "${SWIFT_HOST_VARIANT}")
2121
set(SOURCEKIT_DEPLOYMENT_TARGET "${SWIFT_SDK_${SWIFT_HOST_VARIANT_SDK}_DEPLOYMENT_VERSION}")
2222

23+
swift_is_installing_component(sourcekit-inproc SOURCEKIT_INSTALLING_INPROC)
24+
25+
if("${CMAKE_SYSTEM_NAME}" STREQUAL "Darwin")
26+
set(CMAKE_OSX_SYSROOT "${SWIFT_SDK_${SWIFT_HOST_VARIANT_SDK}_PATH}")
27+
set(CMAKE_OSX_ARCHITECTURES "${SWIFT_HOST_VARIANT_ARCH}")
28+
set(CMAKE_OSX_DEPLOYMENT_TARGET "")
29+
endif()
30+
2331
function(add_sourcekit_symbol_exports target_name export_file)
2432
# Makefile.rules contains special cases for different platforms.
2533
# We restrict ourselves to Darwin for the time being.
@@ -458,10 +466,6 @@ if("${CMAKE_SYSTEM_NAME}" STREQUAL "Darwin")
458466
string(REGEX MATCH "[0-9]+\\.[0-9]+" SOURCEKIT_DEPLOYMENT_TARGET ${SOURCEKIT_DEPLOYMENT_TARGET})
459467
endif()
460468

461-
# Choose a deployment OS if none was set.
462-
set(SOURCEKIT_DEPLOYMENT_OS "macosx" CACHE STRING
463-
"Deployment OS for SourceKit [macosx, iphoneos, iphonesimulator].")
464-
465469
# Sadly there are two OS naming conventions.
466470
# xcrun SDK name: macosx iphoneos iphonesimulator (+ "internal" or version)
467471
# -mOS-version-min: macosx ios ios-simulator
@@ -482,10 +486,6 @@ if("${CMAKE_SYSTEM_NAME}" STREQUAL "Darwin")
482486
message(FATAL_ERROR "Can't understand SOURCEKIT_DEPLOYMENT_OS '${SOURCEKIT_DEPLOYMENT_OS}';")
483487
endif()
484488

485-
# Determine deployment flags for the C/C++ compiler and linker.
486-
set(SOURCEKIT_GLOBAL_DEPLOYMENT_TARGET_FLAGS
487-
"-m${version_min_os}-version-min=${SOURCEKIT_DEPLOYMENT_TARGET}")
488-
489489
# Add deployment target to C/C++ compiler and linker flags.
490490
# FIXME: CMAKE_OSX_DEPLOYMENT_TARGET falls over when used for iOS versions.
491491
if (XCODE)

utils/build-script-impl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2781,6 +2781,11 @@ for host in "${ALL_HOSTS[@]}"; do
27812781
continue
27822782
fi
27832783

2784+
# Skip this if we're cross compiling and it's the local host.
2785+
if [[ $(has_cross_compile_hosts) ]] && [[ ${host} == ${LOCAL_HOST} ]]; then
2786+
continue
2787+
fi
2788+
27842789
# Calculate the directory to install products in to.
27852790
host_install_destdir=$(get_host_install_destdir ${host})
27862791
host_install_prefix=$(get_host_install_prefix ${host})

0 commit comments

Comments
 (0)