diff options
author | Brad King <brad.king@kitware.com> | 2023-09-27 14:37:59 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2023-09-27 14:38:14 (GMT) |
commit | ab2149e6da27d8a7a278034773d00b64236059de (patch) | |
tree | 11fab03afbdb5ded05b233cb4f34af989dc25af9 | |
parent | a314fbe4b26714962ce87330cc27c1ee830bbd61 (diff) | |
parent | f8e0722e75c657506c7e4bf7c82cc6e27067ad36 (diff) | |
download | CMake-ab2149e6da27d8a7a278034773d00b64236059de.zip CMake-ab2149e6da27d8a7a278034773d00b64236059de.tar.gz CMake-ab2149e6da27d8a7a278034773d00b64236059de.tar.bz2 |
Merge topic 'ci-xcode-15.0'
f8e0722e75 gitlab-ci: update macOS jobs to use Xcode 15.0
9ba1883ea6 Tests: Fix RunCMake.XcFramework in symlinked paths with Xcode 15
84a1e529ee Tests: Fix failures on macOS arm64 due to Xcode 15 skipping ad-hoc signature
cc5d6134ad Tests: Disable visionOS cases because Xcode 15.0 excludes support
f9f5751d18 Tests: Clarify RunCMake.XcFramework conditions testing Xcode version
e0765c2c46 Tests: Teach RunCMake to ignore Xcode DVTAssertions warnings
Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !8830
-rw-r--r-- | .gitlab/os-macos.yml | 12 | ||||
-rw-r--r-- | Tests/RunCMake/CMakeLists.txt | 2 | ||||
-rw-r--r-- | Tests/RunCMake/GoogleTest/xcode_sign_adhoc.cmake | 14 | ||||
-rw-r--r-- | Tests/RunCMake/ObjectLibrary/LinkObjLHSShared.cmake | 12 | ||||
-rw-r--r-- | Tests/RunCMake/RunCMake.cmake | 2 | ||||
-rw-r--r-- | Tests/RunCMake/XcFramework/RunCMakeTest.cmake | 52 | ||||
-rw-r--r-- | Tests/RunCMake/XcodeProject-Device/RunCMakeTest.cmake | 46 |
7 files changed, 85 insertions, 55 deletions
diff --git a/.gitlab/os-macos.yml b/.gitlab/os-macos.yml index 9212ecc..b3165fa 100644 --- a/.gitlab/os-macos.yml +++ b/.gitlab/os-macos.yml @@ -7,7 +7,7 @@ GIT_CLONE_PATH: "$CI_BUILDS_DIR/cmake ci ext/$CI_CONCURRENT_ID" # TODO: Factor this out so that each job selects the Xcode version to # use so that different versions can be tested in a single pipeline. - DEVELOPER_DIR: "/Applications/Xcode-14.3.app/Contents/Developer" + DEVELOPER_DIR: "/Applications/Xcode-15.0.app/Contents/Developer" # Avoid conflicting with other projects running on the same machine. SCCACHE_SERVER_PORT: 4227 @@ -135,7 +135,7 @@ - cmake # Since this is a bare runner, pin to a project. - macos-x86_64 - shell - - xcode-14.3 + - xcode-15.0 - nonconcurrent .macos_x86_64_tags_ext: @@ -143,7 +143,7 @@ - cmake # Since this is a bare runner, pin to a project. - macos-x86_64 - shell - - xcode-14.3 + - xcode-15.0 - concurrent .macos_arm64_tags: @@ -151,7 +151,7 @@ - cmake # Since this is a bare runner, pin to a project. - macos-arm64 - shell - - xcode-14.3 + - xcode-15.0 - nonconcurrent .macos_arm64_tags_ext: @@ -159,7 +159,7 @@ - cmake # Since this is a bare runner, pin to a project. - macos-arm64 - shell - - xcode-14.3 + - xcode-15.0 - concurrent .macos_arm64_tags_package: @@ -167,7 +167,7 @@ - cmake # Since this is a bare runner, pin to a project. - macos-arm64 - shell - - xcode-14.3 + - xcode-15.0 - nonconcurrent - finder diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt index 14b94c7..4387c5b 100644 --- a/Tests/RunCMake/CMakeLists.txt +++ b/Tests/RunCMake/CMakeLists.txt @@ -722,7 +722,7 @@ if((CMAKE_C_COMPILER_ID STREQUAL "AppleClang" set(CMake_TEST_XcFramework ON) endif() if(CMake_TEST_XcFramework AND NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 11.0) - set(XcFramework_ARGS -DCMAKE_C_COMPILER_VERSION=${CMAKE_C_COMPILER_VERSION}) + set(XcFramework_ARGS -DCMake_TEST_XCODE_VERSION=${CMake_TEST_XCODE_VERSION}) add_RunCMake_test(XcFramework) # This test can take a very long time due to lots of combinations. diff --git a/Tests/RunCMake/GoogleTest/xcode_sign_adhoc.cmake b/Tests/RunCMake/GoogleTest/xcode_sign_adhoc.cmake index d2dc530..571e4aa 100644 --- a/Tests/RunCMake/GoogleTest/xcode_sign_adhoc.cmake +++ b/Tests/RunCMake/GoogleTest/xcode_sign_adhoc.cmake @@ -1,8 +1,14 @@ function(xcode_sign_adhoc target) if(CMAKE_GENERATOR STREQUAL "Xcode" AND - "${CMAKE_SYSTEM_NAME};${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "Darwin;arm64") - # Xcode runs POST_BUILD before signing, so let the linker use ad-hoc signing. - # See CMake Issue 21845. - target_link_options(${target} PRIVATE LINKER:-adhoc_codesign) + "${CMAKE_SYSTEM_NAME};${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "Darwin;arm64") + if(XCODE_VERSION VERSION_GREATER_EQUAL 15) + # Xcode 15+ enforces '-Xlinker -no_adhoc_codesign' after user flags, + # so we cannot convince the linker to add an adhoc signature. + add_custom_command(TARGET ${target} POST_BUILD COMMAND codesign --sign - --force "$<TARGET_FILE:${target}>") + else() + # Xcode runs POST_BUILD before signing, so let the linker use ad-hoc signing. + # See CMake Issue 21845. + target_link_options(${target} PRIVATE LINKER:-adhoc_codesign) + endif() endif() endfunction() diff --git a/Tests/RunCMake/ObjectLibrary/LinkObjLHSShared.cmake b/Tests/RunCMake/ObjectLibrary/LinkObjLHSShared.cmake index 3d60556..a1fa7b3 100644 --- a/Tests/RunCMake/ObjectLibrary/LinkObjLHSShared.cmake +++ b/Tests/RunCMake/ObjectLibrary/LinkObjLHSShared.cmake @@ -14,8 +14,14 @@ target_link_libraries(LinkObjLHSShared AnObjLib) # Verify that our dependency on OtherLib generated its versioning symlinks. if(CMAKE_GENERATOR STREQUAL "Xcode" AND "${CMAKE_SYSTEM_NAME};${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "Darwin;arm64") - # Xcode runs POST_BUILD before signing, so let the linker use ad-hoc signing. - # See CMake Issue 21845. - target_link_options(LinkObjLHSShared PRIVATE LINKER:-adhoc_codesign) + if(XCODE_VERSION VERSION_GREATER_EQUAL 15) + # Xcode 15+ enforces '-Xlinker -no_adhoc_codesign' after user flags, + # so we cannot convince the linker to add an adhoc signature. + add_custom_command(TARGET LinkObjLHSShared POST_BUILD COMMAND codesign --sign - --force "$<TARGET_FILE:LinkObjLHSShared>") + else() + # Xcode runs POST_BUILD before signing, so let the linker use ad-hoc signing. + # See CMake Issue 21845. + target_link_options(LinkObjLHSShared PRIVATE LINKER:-adhoc_codesign) + endif() endif() add_custom_command(TARGET LinkObjLHSShared POST_BUILD COMMAND LinkObjLHSShared) diff --git a/Tests/RunCMake/RunCMake.cmake b/Tests/RunCMake/RunCMake.cmake index 8939cb7..fcf904e 100644 --- a/Tests/RunCMake/RunCMake.cmake +++ b/Tests/RunCMake/RunCMake.cmake @@ -201,6 +201,8 @@ function(run_cmake test) "|ic(p?c|l): remark #10441: The Intel\\(R\\) C\\+\\+ Compiler Classic \\(ICC\\) is deprecated" "|[^\n]*install_name_tool: warning: changes being made to the file will invalidate the code signature in:" + "|[^\n]*(createItemModels|_NSMainThread|Please file a bug at)" + "|[^\n]*xcodebuild[^\n]*DVTAssertions: Warning" "|[^\n]*xcodebuild[^\n]*DVTCoreDeviceEnabledState: DVTCoreDeviceEnabledState_Disabled set via user default" "|[^\n]*xcodebuild[^\n]*DVTPlugInManager" "|[^\n]*xcodebuild[^\n]*DVTSDK: Warning: SDK path collision for path" diff --git a/Tests/RunCMake/XcFramework/RunCMakeTest.cmake b/Tests/RunCMake/XcFramework/RunCMakeTest.cmake index 22c28b4..9a13892 100644 --- a/Tests/RunCMake/XcFramework/RunCMakeTest.cmake +++ b/Tests/RunCMake/XcFramework/RunCMakeTest.cmake @@ -14,25 +14,36 @@ function(create_libraries type) create_library(${type} ios iOS "arm64" iphoneos) create_library(${type} tvos tvOS "arm64" appletvos) create_library(${type} watchos watchOS "armv7k\\\\;arm64_32" watchos) - if(CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 15) - create_library(${type} visionos visionOS "arm64" xros) - endif() + #FIXME(#25266): Xcode 15.0 does not have visionOS. Improve this condition. + #if(CMake_TEST_XCODE_VERSION VERSION_GREATER_EQUAL 15) + # create_library(${type} visionos visionOS "arm64" xros) + #endif() create_library(${type} ios-simulator iOS "${macos_archs_2}" iphonesimulator) create_library(${type} tvos-simulator tvOS "${macos_archs_2}" appletvsimulator) create_library(${type} watchos-simulator watchOS "${watch_sim_archs_2}" watchsimulator) - if(CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 15) - create_library(${type} visionos-simulator visionOS "${macos_archs_2}" xrsimulator) - endif() + #FIXME(#25266): Xcode 15.0 does not have visionOS. Improve this condition. + #if(CMake_TEST_XCODE_VERSION VERSION_GREATER_EQUAL 15) + # create_library(${type} visionos-simulator visionOS "${macos_archs_2}" xrsimulator) + #endif() endfunction() function(create_xcframework name type platforms) set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/create-xcframework-${name}-build) + if(CMake_TEST_XCODE_VERSION VERSION_GREATER_EQUAL 15) + # 'xcodebuild -create-xcframework' fails on symlinked paths. + file(REAL_PATH "${RunCMake_SOURCE_DIR}" src_dir) + file(REAL_PATH "${RunCMake_BINARY_DIR}" bld_dir) + else() + set(src_dir "${RunCMake_SOURCE_DIR}") + set(bld_dir "${RunCMake_BINARY_DIR}") + endif() set(args) foreach(platform IN LISTS platforms) + set(lib_dir "${bld_dir}/create-${type}-${platform}-build/install/lib") if(type STREQUAL "framework") - list(APPEND args -framework ${RunCMake_BINARY_DIR}/create-${type}-${platform}-build/install/lib/mylib.framework) + list(APPEND args -framework ${lib_dir}/mylib.framework) else() - list(APPEND args -library ${RunCMake_BINARY_DIR}/create-${type}-${platform}-build/install/lib/libmylib.a -headers ${RunCMake_SOURCE_DIR}/mylib/include) + list(APPEND args -library ${lib_dir}/libmylib.a -headers ${src_dir}/mylib/include) endif() endforeach() run_cmake_command(create-xcframework-${name} xcodebuild -create-xcframework ${args} -output ${RunCMake_TEST_BINARY_DIR}/mylib.xcframework) @@ -51,22 +62,25 @@ function(create_executables name type) create_executable(${name}-ios ${type} iOS "arm64" iphoneos) create_executable(${name}-tvos ${type} tvOS "arm64" appletvos) create_executable(${name}-watchos ${type} watchOS "armv7k\\\\;arm64_32" watchos) - if(CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 15) - create_executable(${name}-visionos ${type} visionOS "arm64" xros) - endif() + #FIXME(#25266): Xcode 15.0 does not have visionOS. Improve this condition. + #if(CMake_TEST_XCODE_VERSION VERSION_GREATER_EQUAL 15) + # create_executable(${name}-visionos ${type} visionOS "arm64" xros) + #endif() create_executable(${name}-ios-simulator ${type} iOS "${macos_archs_2}" iphonesimulator) create_executable(${name}-tvos-simulator ${type} tvOS "${macos_archs_2}" appletvsimulator) create_executable(${name}-watchos-simulator ${type} watchOS "${watch_sim_archs_2}" watchsimulator) - if(CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 15) - create_executable(${name}-visionos-simulator ${type} visionOS "${macos_archs_2}" xrsimulator) - endif() + #FIXME(#25266): Xcode 15.0 does not have visionOS. Improve this condition. + #if(CMake_TEST_XCODE_VERSION VERSION_GREATER_EQUAL 15) + # create_executable(${name}-visionos-simulator ${type} visionOS "${macos_archs_2}" xrsimulator) + #endif() endfunction() set(xcframework_platforms macos ios tvos watchos ios-simulator tvos-simulator watchos-simulator) -if(CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 15) - list(APPEND xcframework_platforms visionos visionos-simulator) -endif() -if(CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 12) +#FIXME(#25266): Xcode 15.0 does not have visionOS. Improve this condition. +#if(CMake_TEST_XCODE_VERSION VERSION_GREATER_EQUAL 15) +# list(APPEND xcframework_platforms visionos visionos-simulator) +#endif() +if(CMake_TEST_XCODE_VERSION VERSION_GREATER_EQUAL 12) set(macos_archs_1 "x86_64\\;arm64") set(macos_archs_2 "x86_64\\\\;arm64") set(watch_sim_archs_2 "x86_64") @@ -87,7 +101,7 @@ run_cmake_with_options(create-executable-incomplete -DCMAKE_SYSTEM_NAME=Darwin " create_executables(target-library library) create_executables(target-framework framework) run_cmake_with_options(create-executable-target-incomplete -DCMAKE_SYSTEM_NAME=Darwin "-DCMAKE_OSX_ARCHITECTURES=${macos_archs_1}" -DMYLIB_LIBRARY=${RunCMake_BINARY_DIR}/create-xcframework-incomplete-build/mylib.xcframework) -if(RunCMake_GENERATOR STREQUAL "Xcode" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 12) +if(RunCMake_GENERATOR STREQUAL "Xcode" AND CMake_TEST_XCODE_VERSION VERSION_GREATER_EQUAL 12) create_executables(library-link-phase library) create_executables(framework-link-phase framework) run_cmake_with_options(create-executable-incomplete-link-phase -DCMAKE_SYSTEM_NAME=Darwin "-DCMAKE_OSX_ARCHITECTURES=${macos_archs_1}" -DMYLIB_LIBRARY=${RunCMake_BINARY_DIR}/create-xcframework-incomplete-build/mylib.xcframework) diff --git a/Tests/RunCMake/XcodeProject-Device/RunCMakeTest.cmake b/Tests/RunCMake/XcodeProject-Device/RunCMakeTest.cmake index abb357b..e4dbb90 100644 --- a/Tests/RunCMake/XcodeProject-Device/RunCMakeTest.cmake +++ b/Tests/RunCMake/XcodeProject-Device/RunCMakeTest.cmake @@ -93,24 +93,25 @@ if(NOT XCODE_VERSION VERSION_LESS 7.1) unset(RunCMake_TEST_OPTIONS) endif() -if(NOT XCODE_VERSION VERSION_LESS 15) - set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/XcodeBundlesVisionOS-build) - set(RunCMake_TEST_NO_CLEAN 1) - set(RunCMake_TEST_OPTIONS - "-DCMAKE_SYSTEM_NAME=visionOS" - "-DCMAKE_INSTALL_PREFIX:PATH=${RunCMake_TEST_BINARY_DIR}/_install") - - file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}") - file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}") - - run_cmake(XcodeBundles) - run_cmake_command(XcodeBundles-build-visionOS ${CMAKE_COMMAND} --build .) - run_cmake_command(XcodeBundles-install-visionOS ${CMAKE_COMMAND} --build . --target install) - - unset(RunCMake_TEST_BINARY_DIR) - unset(RunCMake_TEST_NO_CLEAN) - unset(RunCMake_TEST_OPTIONS) -endif() +#FIXME(#25266): Xcode 15.0 does not have visionOS. Improve this condition. +#if(NOT XCODE_VERSION VERSION_LESS 15) +# set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/XcodeBundlesVisionOS-build) +# set(RunCMake_TEST_NO_CLEAN 1) +# set(RunCMake_TEST_OPTIONS +# "-DCMAKE_SYSTEM_NAME=visionOS" +# "-DCMAKE_INSTALL_PREFIX:PATH=${RunCMake_TEST_BINARY_DIR}/_install") +# +# file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}") +# file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}") +# +# run_cmake(XcodeBundles) +# run_cmake_command(XcodeBundles-build-visionOS ${CMAKE_COMMAND} --build .) +# run_cmake_command(XcodeBundles-install-visionOS ${CMAKE_COMMAND} --build . --target install) +# +# unset(RunCMake_TEST_BINARY_DIR) +# unset(RunCMake_TEST_NO_CLEAN) +# unset(RunCMake_TEST_OPTIONS) +#endif() if(NOT XCODE_VERSION VERSION_LESS 7) set(RunCMake_TEST_OPTIONS "-DCMAKE_TOOLCHAIN_FILE=${RunCMake_SOURCE_DIR}/osx.cmake") @@ -261,10 +262,11 @@ if(XCODE_VERSION VERSION_GREATER_EQUAL 8) deployment_target_test(tvOS appletvsimulator) deployment_target_test(watchOS watchos) deployment_target_test(watchOS watchsimulator) - if(XCODE_VERSION VERSION_GREATER_EQUAL 15) - deployment_target_test(visionOS xros) - deployment_target_test(visionOS xrsimulator) - endif() + #FIXME(#25266): Xcode 15.0 does not have visionOS. Improve this condition. + #if(XCODE_VERSION VERSION_GREATER_EQUAL 15) + # deployment_target_test(visionOS xros) + # deployment_target_test(visionOS xrsimulator) + #endif() endif() if(XCODE_VERSION VERSION_GREATER_EQUAL 8) |