File tree Expand file tree Collapse file tree 3 files changed +5
-2
lines changed Expand file tree Collapse file tree 3 files changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -543,6 +543,9 @@ set(SWIFT_DARWIN_EMBEDDED_VARIANTS "^(iphoneos|iphonesimulator|appletvos|appletv
543
543
# endif()
544
544
set (SWIFT_APPLE_PLATFORMS "IOS" "IOS_SIMULATOR" "TVOS" "TVOS_SIMULATOR" "WATCHOS" "WATCHOS_SIMULATOR" "OSX" )
545
545
546
+ # A convenient list of platforms that should use -isysroot ... when building.
547
+ set (SWIFT_PLATFORMS_USING_ISYSROOT SWIFT_APPLE_PLATFORMS "FREESTANDING" )
548
+
546
549
# Configuration flags passed to all of our invocations of gyb. Try to
547
550
# avoid making up new variable names here if you can find a CMake
548
551
# variable that will do the job.
Original file line number Diff line number Diff line change @@ -93,7 +93,7 @@ function(_add_host_variant_c_compile_link_flags name)
93
93
94
94
set (_sysroot
95
95
"${SWIFT_SDK_${SWIFT_HOST_VARIANT_SDK} _ARCH_${SWIFT_HOST_VARIANT_ARCH} _PATH}" )
96
- if (SWIFT_HOST_VARIANT_SDK IN_LIST SWIFT_APPLE_PLATFORMS )
96
+ if (SWIFT_HOST_VARIANT_SDK IN_LIST SWIFT_PLATFORMS_USING_ISYSROOT )
97
97
target_compile_options (${name} PRIVATE -isysroot;${_sysroot} )
98
98
elseif (NOT SWIFT_COMPILER_IS_MSVC_LIKE AND NOT "${_sysroot} " STREQUAL "/" )
99
99
target_compile_options (${name} PRIVATE --sysroot=${_sysroot} )
Original file line number Diff line number Diff line change @@ -98,7 +98,7 @@ function(_add_target_variant_c_compile_link_flags)
98
98
endif ()
99
99
100
100
set (_sysroot "${SWIFT_SDK_${CFLAGS_SDK} _ARCH_${CFLAGS_ARCH} _PATH}" )
101
- if (IS_DARWIN )
101
+ if (CFLAGS_SDK IN_LIST SWIFT_PLATFORMS_USING_ISYSROOT )
102
102
list (APPEND result "-isysroot" "${_sysroot} " )
103
103
elseif (NOT SWIFT_COMPILER_IS_MSVC_LIKE AND NOT "${_sysroot} " STREQUAL "/" )
104
104
list (APPEND result "--sysroot=${_sysroot} " )
You can’t perform that action at this time.
0 commit comments