Skip to content

Commit 205aaf7

Browse files
committed
[CMake] Manually set the OS X SDK and deployment target.
...so that CMake doesn't try to "helpfully" pass -mmacosx-version-min= when linking libraries for other platforms. (This only came up in certain build configurations.) Fix by @cwakamo. rdar://problem/25271364
1 parent 405df02 commit 205aaf7

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

CMakeLists.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -699,6 +699,13 @@ if(SWIFT_PARALLEL_LINK_JOBS)
699699
endif()
700700
endif()
701701

702+
# Set the CMAKE_OSX_* variables in a way that minimizes conflicts.
703+
if("${CMAKE_SYSTEM_NAME}" STREQUAL "Darwin")
704+
set(CMAKE_OSX_SYSROOT "${SWIFT_SDK_${SWIFT_HOST_VARIANT_SDK}_PATH}")
705+
set(CMAKE_OSX_ARCHITECTURES "")
706+
set(CMAKE_OSX_DEPLOYMENT_TARGET "")
707+
endif()
708+
702709
message(STATUS "Building host Swift tools for ${SWIFT_HOST_VARIANT_SDK} ${SWIFT_HOST_VARIANT_ARCH}")
703710
message(STATUS " Build type: ${CMAKE_BUILD_TYPE}")
704711
message(STATUS " Assertions: ${LLVM_ENABLE_ASSERTIONS}")

0 commit comments

Comments
 (0)