From 862dbe1367ed123b0a6eb8171bae0064fd7fa79f Mon Sep 17 00:00:00 2001 From: Gregor Jasny Date: Thu, 13 Aug 2020 17:59:35 +0200 Subject: Xcode: Link matching zlib for iOS Simulator SDK The XcodeRemoveExcessiveISystem test runs `find_package(ZLIB)` which returns an SDK-relative path to `zlib.tlb`. When the test switches the SDK for building to something different than the SDK used for configuration the linker rightfully complains about the mismatch. The fix is to configure and build with the same SDK. --- Tests/RunCMake/XcodeProject/RunCMakeTest.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Tests/RunCMake/XcodeProject/RunCMakeTest.cmake b/Tests/RunCMake/XcodeProject/RunCMakeTest.cmake index cd6fd06..ed300bb 100644 --- a/Tests/RunCMake/XcodeProject/RunCMakeTest.cmake +++ b/Tests/RunCMake/XcodeProject/RunCMakeTest.cmake @@ -310,10 +310,10 @@ endif() if(XCODE_VERSION VERSION_GREATER_EQUAL 8) function(XcodeRemoveExcessiveISystemSDK SDK) set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/XcodeRemoveExcessiveISystemSDK-${SDK}-build) - set(RunCMake_TEST_OPTIONS "-DCMAKE_SYSTEM_NAME=iOS") + set(RunCMake_TEST_OPTIONS "-DCMAKE_SYSTEM_NAME=iOS" "-DCMAKE_OSX_SYSROOT=${SDK}") run_cmake(XcodeRemoveExcessiveISystem) set(RunCMake_TEST_NO_CLEAN 1) - run_cmake_command(XcodeRemoveExcessiveISystemSDK-${SDK}-build ${CMAKE_COMMAND} --build . -- -sdk ${SDK}) + run_cmake_command(XcodeRemoveExcessiveISystemSDK-${SDK}-build ${CMAKE_COMMAND} --build .) endfunction() XcodeRemoveExcessiveISystemSDK(iphoneos) -- cgit v0.12