Merge topic 'ci-xcode-14.0'

9cdf4c9be4 gitlab-ci: update macOS jobs to use Xcode 14.0
5d2c2b2558 Tests: Update RunCMake.XcodeProject iOS cases for Xcode 14.0
12c6fec6b4 Xcode: Drop CMAKE_INTDIR= definition in Swift targets

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7732
This commit is contained in:
Brad King
2022-10-03 14:31:07 +00:00
committed by Kitware Robot
7 changed files with 66 additions and 37 deletions
+6 -6
View File
@@ -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-13.4.app/Contents/Developer"
DEVELOPER_DIR: "/Applications/Xcode-14.0.app/Contents/Developer"
# Avoid conflicting with other projects running on the same machine.
SCCACHE_SERVER_PORT: 4227
@@ -95,7 +95,7 @@
- cmake # Since this is a bare runner, pin to a project.
- macos
- shell
- xcode-13.4
- xcode-14.0
- nonconcurrent
.macos_x86_64_builder_tags_package:
@@ -103,7 +103,7 @@
- cmake # Since this is a bare runner, pin to a project.
- macos
- shell
- xcode-13.4
- xcode-14.0
- nonconcurrent
- finder
@@ -112,7 +112,7 @@
- cmake # Since this is a bare runner, pin to a project.
- macos
- shell
- xcode-13.4
- xcode-14.0
- concurrent
.macos_arm64_builder_tags:
@@ -120,7 +120,7 @@
- cmake # Since this is a bare runner, pin to a project.
- macos-arm64
- shell
- xcode-13.4
- xcode-14.0
- nonconcurrent
.macos_arm64_builder_ext_tags:
@@ -128,7 +128,7 @@
- cmake # Since this is a bare runner, pin to a project.
- macos-arm64
- shell
- xcode-13.4
- xcode-14.0
- concurrent
## macOS-specific scripts
+7 -2
View File
@@ -2404,8 +2404,13 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmGeneratorTarget* gtgt,
// Add preprocessor definitions for this target and configuration.
BuildObjectListOrString ppDefs(this, true);
this->AppendDefines(
ppDefs, "CMAKE_INTDIR=\"$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)\"");
if (languages.count("Swift")) {
// FIXME: Xcode warns that Swift does not support definition values.
// C/CXX sources mixed in Swift targets will not see CMAKE_INTDIR.
} else {
this->AppendDefines(
ppDefs, "CMAKE_INTDIR=\"$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)\"");
}
if (const std::string* exportMacro = gtgt->GetExportMacro()) {
// Add the export symbol definition for shared library objects.
this->AppendDefines(ppDefs, exportMacro->c_str());
+24 -21
View File
@@ -298,30 +298,33 @@ if(XCODE_VERSION VERSION_GREATER_EQUAL 6)
unset(RunCMake_TEST_OPTIONS)
# XcodeIOSInstallCombinedPrune
set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/XcodeIOSInstallCombinedPrune-build)
set(RunCMake_TEST_NO_CLEAN 1)
set(RunCMake_TEST_OPTIONS
"-DCMAKE_SYSTEM_NAME=iOS"
"-DCMAKE_IOS_INSTALL_COMBINED=YES"
"-DCMAKE_INSTALL_PREFIX:PATH=${RunCMake_TEST_BINARY_DIR}/_install")
# FIXME(#24011): Xcode 14 removed support for older architectures the test needs.
if(XCODE_VERSION VERSION_LESS 14)
set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/XcodeIOSInstallCombinedPrune-build)
set(RunCMake_TEST_NO_CLEAN 1)
set(RunCMake_TEST_OPTIONS
"-DCMAKE_SYSTEM_NAME=iOS"
"-DCMAKE_IOS_INSTALL_COMBINED=YES"
"-DCMAKE_INSTALL_PREFIX:PATH=${RunCMake_TEST_BINARY_DIR}/_install")
file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}")
file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}")
file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}")
file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}")
run_cmake(XcodeIOSInstallCombinedPrune)
run_cmake_command(XcodeIOSInstallCombinedPrune-build ${CMAKE_COMMAND} --build .)
if(XCODE_VERSION VERSION_LESS 12)
run_cmake_command(XcodeIOSInstallCombinedPrune-install ${CMAKE_COMMAND} --build . --target install)
run_cmake(XcodeIOSInstallCombinedPrune)
run_cmake_command(XcodeIOSInstallCombinedPrune-build ${CMAKE_COMMAND} --build .)
if(XCODE_VERSION VERSION_LESS 12)
run_cmake_command(XcodeIOSInstallCombinedPrune-install ${CMAKE_COMMAND} --build . --target install)
endif()
# --build defaults to Debug, --install defaults to Release, so we have to
# specify the configuration explicitly
run_cmake_command(XcodeIOSInstallCombinedPrune-cmakeinstall
${CMAKE_COMMAND} --install . --config Debug
)
unset(RunCMake_TEST_BINARY_DIR)
unset(RunCMake_TEST_NO_CLEAN)
unset(RunCMake_TEST_OPTIONS)
endif()
# --build defaults to Debug, --install defaults to Release, so we have to
# specify the configuration explicitly
run_cmake_command(XcodeIOSInstallCombinedPrune-cmakeinstall
${CMAKE_COMMAND} --install . --config Debug
)
unset(RunCMake_TEST_BINARY_DIR)
unset(RunCMake_TEST_NO_CLEAN)
unset(RunCMake_TEST_OPTIONS)
# XcodeIOSInstallCombinedSingleArch
set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/XcodeIOSInstallCombinedSingleArch-build)
@@ -9,11 +9,18 @@ function(verify_architectures file)
return()
endif()
string(REGEX MATCHALL "\narchitecture [^ \n\t()]+" architectures ${otool_out})
string(REGEX MATCHALL "\narchitecture [^ \n\t()]+" architectures "${otool_out}")
string(REPLACE "\narchitecture " "" actual "${architectures}")
list(SORT actual)
set(expected arm64 armv7 i386 x86_64)
if(XCODE_VERSION VERSION_LESS 14)
set(maybe_armv7 armv7)
set(maybe_i386 i386)
else()
set(maybe_armv7 "")
set(maybe_i386 "")
endif()
set(expected arm64 ${maybe_armv7} ${maybe_i386} x86_64)
if(NOT actual STREQUAL expected)
message(SEND_ERROR
@@ -2,7 +2,13 @@ cmake_minimum_required(VERSION 3.3)
project(IOSInstallCombined CXX)
if(XCODE_VERSION VERSION_GREATER_EQUAL 9)
set(maybe_armv7 armv7)
set(maybe_i386 i386)
if(XCODE_VERSION VERSION_GREATER_EQUAL 14)
set(CMAKE_OSX_DEPLOYMENT_TARGET 16)
set(maybe_armv7 "")
set(maybe_i386 "")
elseif(XCODE_VERSION VERSION_GREATER_EQUAL 9)
set(CMAKE_OSX_DEPLOYMENT_TARGET 10)
endif()
@@ -16,7 +22,7 @@ set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "")
set(CMAKE_XCODE_ATTRIBUTE_DEBUG_INFORMATION_FORMAT "dwarf")
set(CMAKE_XCODE_ATTRIBUTE_ENABLE_BITCODE "NO")
set(CMAKE_OSX_ARCHITECTURES "armv7;arm64;i386;x86_64")
set(CMAKE_OSX_ARCHITECTURES ${maybe_armv7} arm64 ${maybe_i386} x86_64)
add_executable(foo_app MACOSX_BUNDLE main.cpp)
install(TARGETS foo_app BUNDLE DESTINATION bin)
@@ -12,7 +12,11 @@ function(verify_architecture file)
string(REGEX MATCHALL "is architecture: [^ \n\t]+" architecture "${lipo_out}")
string(REGEX REPLACE "is architecture: " "" actual "${architecture}")
set(expected armv7)
if(XCODE_VERSION VERSION_GREATER_EQUAL 14)
set(expected arm64)
else()
set(expected armv7)
endif()
if(NOT actual STREQUAL expected)
message(SEND_ERROR
@@ -2,7 +2,11 @@ cmake_minimum_required(VERSION 3.3)
project(XcodeIOSInstallCombinedSingleArch CXX)
if(XCODE_VERSION VERSION_GREATER_EQUAL 9)
set(iphoneos_arch armv7)
if(XCODE_VERSION VERSION_GREATER_EQUAL 14)
set(CMAKE_OSX_DEPLOYMENT_TARGET 16)
set(iphoneos_arch arm64)
elseif(XCODE_VERSION VERSION_GREATER_EQUAL 9)
set(CMAKE_OSX_DEPLOYMENT_TARGET 10)
endif()
@@ -17,8 +21,8 @@ install(TARGETS foo DESTINATION lib)
set_target_properties(
foo
PROPERTIES
XCODE_ATTRIBUTE_ARCHS[sdk=iphoneos*] armv7
XCODE_ATTRIBUTE_VALID_ARCHS[sdk=iphoneos*] armv7
XCODE_ATTRIBUTE_ARCHS[sdk=iphoneos*] ${iphoneos_arch}
XCODE_ATTRIBUTE_VALID_ARCHS[sdk=iphoneos*] ${iphoneos_arch}
XCODE_ATTRIBUTE_ARCHS[sdk=iphonesimulator*] ""
XCODE_ATTRIBUTE_VALID_ARCHS[sdk=iphonesimulator*] ""
)