Skip to content

Commit d9bbb6c

Browse files
committed
Remove checks and references to internal Apple SDKs.
These aren't available for use outside of Apple. rdar://problem/23302539
1 parent 69d3b20 commit d9bbb6c

File tree

3 files changed

+13
-77
lines changed

3 files changed

+13
-77
lines changed

CMakeLists.txt

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -129,10 +129,6 @@ option(SWIFT_EMBED_BITCODE_SECTION
129129
"If non-empty, embeds LLVM bitcode binary sections in the standard library and overlay binaries for supported platforms"
130130
FALSE)
131131

132-
option(SWIFT_DARWIN_USE_INTERNAL_SDK
133-
"If true, selects the internal SDK on Darwin"
134-
FALSE)
135-
136132
option(SWIFT_RUNTIME_CRASH_REPORTER_CLIENT
137133
"Whether to enable CrashReporter integration"
138134
FALSE)
@@ -270,8 +266,6 @@ if("${SWIFT_NATIVE_LLVM_TOOLS_PATH}" STREQUAL "")
270266
set(SWIFT_CROSS_COMPILING FALSE)
271267
else()
272268
set(SWIFT_CROSS_COMPILING TRUE)
273-
# Cross compiling tools requires the internal SDK.
274-
set(SWIFT_DARWIN_USE_INTERNAL_SDK TRUE)
275269
endif()
276270

277271
# Reset CMAKE_SYSTEM_PROCESSOR if not cross-compiling.

cmake/modules/AddSwift.cmake

Lines changed: 8 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -40,40 +40,33 @@ endfunction()
4040

4141

4242
function(_add_variant_c_compile_link_flags
43-
sdk arch build_type enable_assertions use_internal_sdk result_var_name)
43+
sdk arch build_type enable_assertions result_var_name)
4444
set(result
4545
${${result_var_name}}
4646
"-target" "${SWIFT_SDK_${sdk}_ARCH_${arch}_TRIPLE}")
4747

48-
if(use_internal_sdk)
49-
list(APPEND result
50-
"-isysroot" "${SWIFT_SDK_${sdk}_INTERNAL_PATH}")
51-
else()
52-
list(APPEND result
53-
"-isysroot" "${SWIFT_SDK_${sdk}_PATH}")
54-
endif()
48+
list(APPEND result
49+
"-isysroot" "${SWIFT_SDK_${sdk}_PATH}")
5550

5651
if("${CMAKE_SYSTEM_NAME}" STREQUAL "Darwin")
5752
list(APPEND result
5853
"-arch" "${arch}"
5954
"-F" "${SWIFT_SDK_${sdk}_PATH}/../../../Developer/Library/Frameworks"
60-
"-F" "${SWIFT_SDK_${sdk}_PATH}/../../../Developer/AppleInternal/Library/Frameworks"
6155
"-m${SWIFT_SDK_${sdk}_VERSION_MIN_NAME}-version-min=${SWIFT_SDK_${sdk}_DEPLOYMENT_VERSION}")
6256
endif()
6357

6458
set("${result_var_name}" "${result}" PARENT_SCOPE)
6559
endfunction()
6660

6761
function(_add_variant_c_compile_flags
68-
sdk arch build_type enable_assertions use_internal_sdk result_var_name)
62+
sdk arch build_type enable_assertions result_var_name)
6963
set(result ${${result_var_name}})
7064

7165
_add_variant_c_compile_link_flags(
7266
"${sdk}"
7367
"${arch}"
7468
"${build_type}"
7569
"${enable_assertions}"
76-
${use_internal_sdk}
7770
result)
7871

7972
is_build_type_optimized("${build_type}" optimized)
@@ -114,8 +107,7 @@ function(_add_variant_swift_compile_flags
114107

115108
if("${CMAKE_SYSTEM_NAME}" STREQUAL "Darwin")
116109
list(APPEND result
117-
"-F" "${SWIFT_SDK_${sdk}_PATH}/../../../Developer/Library/Frameworks"
118-
"-F" "${SWIFT_SDK_${sdk}_PATH}/../../../Developer/AppleInternal/Library/Frameworks")
110+
"-F" "${SWIFT_SDK_${sdk}_PATH}/../../../Developer/Library/Frameworks")
119111
endif()
120112

121113
is_build_type_optimized("${build_type}" optimized)
@@ -138,7 +130,7 @@ function(_add_variant_swift_compile_flags
138130
endfunction()
139131

140132
function(_add_variant_link_flags
141-
sdk arch build_type enable_assertions use_internal_sdk result_var_name)
133+
sdk arch build_type enable_assertions result_var_name)
142134

143135
if("${sdk}" STREQUAL "")
144136
message(FATAL_ERROR "Should specify an SDK")
@@ -155,7 +147,6 @@ function(_add_variant_link_flags
155147
"${arch}"
156148
"${build_type}"
157149
"${enable_assertions}"
158-
${use_internal_sdk}
159150
result)
160151

161152
if("${sdk}" STREQUAL "LINUX")
@@ -630,7 +621,6 @@ endfunction()
630621
# _add_swift_library_single(
631622
# target
632623
# name
633-
# [USE_INTERNAL_SDK]
634624
# [SHARED]
635625
# [SDK sdk]
636626
# [ARCHITECTURE architecture]
@@ -711,15 +701,12 @@ endfunction()
711701
# INSTALL_IN_COMPONENT comp
712702
# The Swift installation component that this library belongs to.
713703
#
714-
# USE_INTERNAL_SDK
715-
# Use the 'internal' sdk variant.
716-
#
717704
# source1 ...
718705
# Sources to add into this library
719706
function(_add_swift_library_single target name)
720707
set(SWIFTLIB_SINGLE_options
721708
SHARED IS_STDLIB IS_STDLIB_CORE IS_SDK_OVERLAY
722-
API_NOTES_NON_OVERLAY DONT_EMBED_BITCODE USE_INTERNAL_SDK)
709+
API_NOTES_NON_OVERLAY DONT_EMBED_BITCODE)
723710
cmake_parse_arguments(SWIFTLIB_SINGLE
724711
"${SWIFTLIB_SINGLE_options}"
725712
"SDK;ARCHITECTURE;INSTALL_IN_COMPONENT"
@@ -1033,14 +1020,12 @@ function(_add_swift_library_single target name)
10331020
"${SWIFTLIB_SINGLE_ARCHITECTURE}"
10341021
"${build_type}"
10351022
"${enable_assertions}"
1036-
${SWIFTLIB_SINGLE_USE_INTERNAL_SDK}
10371023
c_compile_flags)
10381024
_add_variant_link_flags(
10391025
"${SWIFTLIB_SINGLE_SDK}"
10401026
"${SWIFTLIB_SINGLE_ARCHITECTURE}"
10411027
"${build_type}"
10421028
"${enable_assertions}"
1043-
${SWIFTLIB_SINGLE_USE_INTERNAL_SDK}
10441029
link_flags)
10451030

10461031
# Handle gold linker flags for shared libraries.
@@ -1228,15 +1213,12 @@ endfunction()
12281213
# INSTALL_IN_COMPONENT comp
12291214
# The Swift installation component that this library belongs to.
12301215
#
1231-
# USE_INTERNAL_SDK
1232-
# Use the 'internal' sdk variant.
1233-
#
12341216
# source1 ...
12351217
# Sources to add into this library.
12361218
function(add_swift_library name)
12371219
set(SWIFTLIB_options
12381220
SHARED IS_STDLIB IS_STDLIB_CORE IS_SDK_OVERLAY TARGET_LIBRARY
1239-
API_NOTES_NON_OVERLAY DONT_EMBED_BITCODE USE_INTERNAL_SDK)
1221+
API_NOTES_NON_OVERLAY DONT_EMBED_BITCODE)
12401222
cmake_parse_arguments(SWIFTLIB
12411223
"${SWIFTLIB_options}"
12421224
"INSTALL_IN_COMPONENT"
@@ -1372,7 +1354,6 @@ function(add_swift_library name)
13721354
_add_swift_library_single(
13731355
${VARIANT_NAME}
13741356
${name}
1375-
${SWIFTLIB_USE_INTERNAL_SDK_keyword}
13761357
${SWIFTLIB_SHARED_keyword}
13771358
${SWIFTLIB_SOURCES}
13781359
SDK ${sdk}
@@ -1519,7 +1500,6 @@ function(add_swift_library name)
15191500
_add_swift_library_single(
15201501
${name}
15211502
${name}
1522-
${SWIFTLIB_USE_INTERNAL_SDK_keyword}
15231503
${SWIFTLIB_SHARED_keyword}
15241504
${SWIFTLIB_SOURCES}
15251505
SDK ${sdk}

cmake/modules/SwiftConfigureSDK.cmake

Lines changed: 5 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ set(SWIFT_CONFIGURED_SDKS)
99
function(_report_sdk prefix)
1010
message(STATUS "${SWIFT_SDK_${prefix}_NAME} SDK:")
1111
message(STATUS " Path: ${SWIFT_SDK_${prefix}_PATH}")
12-
message(STATUS " Path (public): ${SWIFT_SDK_${prefix}_PUBLIC_PATH}")
1312
message(STATUS " Version: ${SWIFT_SDK_${prefix}_VERSION}")
1413
message(STATUS " Build number: ${SWIFT_SDK_${prefix}_BUILD_NUMBER}")
1514
message(STATUS " Deployment version: ${SWIFT_SDK_${prefix}_DEPLOYMENT_VERSION}")
@@ -40,16 +39,14 @@ endfunction()
4039
# )
4140
#
4241
# Sadly there are three OS naming conventions.
43-
# xcrun SDK name: macosx iphoneos iphonesimulator (+ "internal" or version)
42+
# xcrun SDK name: macosx iphoneos iphonesimulator (+ version)
4443
# -mOS-version-min: macosx ios ios-simulator
4544
# swift -triple: macosx ios ios
4645
#
4746
# This macro attempts to configure a given SDK. When successful, it
4847
# defines a number of variables:
4948
#
5049
# SWIFT_SDK_${prefix}_NAME Display name for the SDK
51-
# SWIFT_SDK_${prefix}_PATH Path to the SDK (possibly internal)
52-
# SWIFT_SDK_${prefix}_PUBLIC_PATH Path to the public SDK
5350
# SWIFT_SDK_${prefix}_VERSION SDK version number (e.g., 10.9, 7.0)
5451
# SWIFT_SDK_${prefix}_BUILD_NUMBER SDK build number (e.g., 14A389a)
5552
# SWIFT_SDK_${prefix}_DEPLOYMENT_VERSION Deployment version (e.g., 10.9, 7.0)
@@ -67,51 +64,18 @@ macro(configure_sdk_darwin
6764
# Find the SDK
6865
set(SWIFT_SDK_${prefix}_PATH "" CACHE PATH "Path to the ${name} SDK")
6966

70-
if(NOT SWIFT_SDK_${prefix}_PATH)
71-
if(${SWIFT_DARWIN_USE_INTERNAL_SDK})
72-
# If requested, require the internal SDK.
73-
execute_process(
74-
COMMAND "xcrun" "--sdk" "${xcrun_name}.internal" "--show-sdk-path"
75-
OUTPUT_VARIABLE SWIFT_SDK_${prefix}_PATH
76-
OUTPUT_STRIP_TRAILING_WHITESPACE)
77-
if(NOT EXISTS "${SWIFT_SDK_${prefix}_PATH}/System/Library/PrivateFrameworks")
78-
message(FATAL_ERROR "Internal ${name} SDK not found at SWIFT_SDK_${prefix}_PATH.")
79-
endif()
80-
endif()
81-
endif()
82-
8367
if(NOT SWIFT_SDK_${prefix}_PATH)
8468
execute_process(
8569
COMMAND "xcrun" "--sdk" "${xcrun_name}" "--show-sdk-path"
86-
OUTPUT_VARIABLE SWIFT_SDK_${prefix}_PUBLIC_PATH
87-
OUTPUT_STRIP_TRAILING_WHITESPACE)
88-
if(NOT EXISTS "${SWIFT_SDK_${prefix}_PUBLIC_PATH}/System/Library/Frameworks/module.map")
89-
message(FATAL_ERROR "${name} SDK not found at SWIFT_SDK_${prefix}_PUBLIC_PATH.")
90-
endif()
91-
92-
set(SWIFT_SDK_${prefix}_PATH "${SWIFT_SDK_${prefix}_PUBLIC_PATH}")
93-
endif()
94-
95-
# Find the internal SDK if the user has not specified to use an external ICU
96-
# library. Otherwise, we will just use the regular SDK.
97-
set(SWIFT_SDK_${prefix}_INTERNAL_PATH "" CACHE PATH "Path to the internal ${name} SDK")
98-
if (NOT SWIFT_DARWIN_ICU_INCLUDE_PATH)
99-
if ("${prefix}" STREQUAL "IOS_SIMULATOR" OR
100-
"${prefix}" STREQUAL "WATCHOS_SIMULATOR" OR
101-
"${prefix}" STREQUAL "TVOS_SIMULATOR")
102-
set(SWIFT_SDK_${prefix}_INTERNAL_PATH "${SWIFT_SDK_${prefix}_PATH}")
103-
else()
104-
execute_process(
105-
COMMAND "xcrun" "--sdk" "${xcrun_name}.internal" "--show-sdk-path"
106-
OUTPUT_VARIABLE SWIFT_SDK_${prefix}_INTERNAL_PATH
70+
OUTPUT_VARIABLE SWIFT_SDK_${prefix}_PATH
10771
OUTPUT_STRIP_TRAILING_WHITESPACE)
72+
if(NOT EXISTS "${SWIFT_SDK_${prefix}_PATH}/System/Library/Frameworks/module.map")
73+
message(FATAL_ERROR "${name} SDK not found at ${SWIFT_SDK_${prefix}_PATH}.")
10874
endif()
109-
else()
110-
set(SWIFT_SDK_${prefix}_INTERNAL_PATH "${SWIFT_SDK_${prefix}_PATH}")
11175
endif()
11276

11377
if(NOT EXISTS "${SWIFT_SDK_${prefix}_PATH}/System/Library/Frameworks/module.map")
114-
message(FATAL_ERROR "${name} SDK not found at SWIFT_SDK_${prefix}_PATH.")
78+
message(FATAL_ERROR "${name} SDK not found at ${SWIFT_SDK_${prefix}_PATH}.")
11579
endif()
11680

11781
# Determine the SDK version we found.
@@ -151,8 +115,6 @@ macro(configure_sdk_unix
151115

152116
set(SWIFT_SDK_${prefix}_NAME "${name}")
153117
set(SWIFT_SDK_${prefix}_PATH "/")
154-
set(SWIFT_SDK_${prefix}_PUBLIC_PATH "/")
155-
set(SWIFT_SDK_${prefix}_INTERNAL_PATH "/")
156118
set(SWIFT_SDK_${prefix}_VERSION "don't use")
157119
set(SWIFT_SDK_${prefix}_BUILD_NUMBER "don't use")
158120
set(SWIFT_SDK_${prefix}_DEPLOYMENT_VERSION "don't use")

0 commit comments

Comments
 (0)