Browse Source

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.
Gregor Jasny 5 years ago
parent
commit
862dbe1367
1 changed files with 2 additions and 2 deletions
  1. 2 2
      Tests/RunCMake/XcodeProject/RunCMakeTest.cmake

+ 2 - 2
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)