summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2018-06-20 13:42:16 (GMT)
committerKitware Robot <kwrobot@kitware.com>2018-06-20 13:42:25 (GMT)
commite11f660ae1b31f730212af43e1094f8dc3d42ef8 (patch)
treec2640181f8d0361b6682fb004d5fa6b8d4d8ac19 /Tests
parent20f042374730b2e1ee756c3b5939b63d6769cac3 (diff)
parentca6920689300249f67c4914cef521963c72a0d3f (diff)
downloadCMake-e11f660ae1b31f730212af43e1094f8dc3d42ef8.zip
CMake-e11f660ae1b31f730212af43e1094f8dc3d42ef8.tar.gz
CMake-e11f660ae1b31f730212af43e1094f8dc3d42ef8.tar.bz2
Merge topic 'xcode-10-legacy-build-system'
ca69206893 Tests: Do not use i386 architecture with Xcode 10 and above 71fa78ff7a Tests: Teach RunCMake to ignore Xcode missing file type warnings 057ecb8f6f C++ feature checks: Ignore Xcode warnings 985d3a162c Xcode: Use legacy build system Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !2151
Diffstat (limited to 'Tests')
-rw-r--r--Tests/BuildDepends/Project/CMakeLists.txt34
-rw-r--r--Tests/CMakeLists.txt4
-rw-r--r--Tests/RunCMake/RunCMake.cmake1
3 files changed, 22 insertions, 17 deletions
diff --git a/Tests/BuildDepends/Project/CMakeLists.txt b/Tests/BuildDepends/Project/CMakeLists.txt
index 3aa57fc..127b365 100644
--- a/Tests/BuildDepends/Project/CMakeLists.txt
+++ b/Tests/BuildDepends/Project/CMakeLists.txt
@@ -1,30 +1,30 @@
cmake_minimum_required(VERSION 2.6)
project(testRebuild)
-function(test_for_xcode4 result_var)
- set(${result_var} 0 PARENT_SCOPE)
- if(APPLE)
- execute_process(COMMAND xcodebuild -version
- OUTPUT_VARIABLE ov RESULT_VARIABLE rv
+if(APPLE)
+ set(CMake_TEST_XCODE_VERSION 0)
+ if(XCODE_VERSION)
+ set(CMake_TEST_XCODE_VERSION "${XCODE_VERSION}")
+ else()
+ execute_process(
+ COMMAND xcodebuild -version
+ OUTPUT_VARIABLE _version ERROR_VARIABLE _version
)
- if("${rv}" STREQUAL "0" AND ov MATCHES "^Xcode ([0-9]+)\\.")
- if(NOT CMAKE_MATCH_1 VERSION_LESS 4)
- set(${result_var} 1 PARENT_SCOPE)
- endif()
+ if(_version MATCHES "^Xcode ([0-9]+(\\.[0-9]+)*)")
+ set(CMake_TEST_XCODE_VERSION "${CMAKE_MATCH_1}")
endif()
endif()
-endfunction()
-
-if(APPLE)
# only use multi-arch if the sysroot exists on this machine
# Ninja needs -M which could not be used with multiple -arch flags
if(EXISTS "${CMAKE_OSX_SYSROOT}" AND NOT "${CMAKE_GENERATOR}" MATCHES "Ninja")
- set(CMAKE_OSX_ARCHITECTURES "ppc;i386")
- test_for_xcode4(is_xcode4)
- if(is_xcode4)
- # Xcode 4, use modern architectures as defaults
- # Arch 'ppc' no longer works: tools no longer available starting with Xcode 4
+ if(CMake_TEST_XCODE_VERSION VERSION_GREATER_EQUAL 10)
+ # Arch 'i386' no longer works in Xcode 10.
+ set(CMAKE_OSX_ARCHITECTURES x86_64)
+ elseif(CMake_TEST_XCODE_VERSION VERSION_GREATER_EQUAL 4)
+ # Arch 'ppc' no longer works in Xcode 4.
set(CMAKE_OSX_ARCHITECTURES i386 x86_64)
+ else()
+ set(CMAKE_OSX_ARCHITECTURES ppc i386)
endif()
endif()
endif()
diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt
index 9aed3ba..89babe4 100644
--- a/Tests/CMakeLists.txt
+++ b/Tests/CMakeLists.txt
@@ -252,6 +252,10 @@ if(BUILD_TESTING)
set(CMake_TEST_XCODE_VERSION "${CMAKE_MATCH_1}")
endif()
endif()
+ if(NOT CMake_TEST_XCODE_VERSION VERSION_LESS 10)
+ # Since Xcode 10 we do not have two supported architectures for the host.
+ set(CTEST_TEST_OSX_ARCH 0)
+ endif()
if(CMAKE_OSX_SYSROOT)
execute_process(
COMMAND xcodebuild -sdk ${CMAKE_OSX_SYSROOT} -version ProductName
diff --git a/Tests/RunCMake/RunCMake.cmake b/Tests/RunCMake/RunCMake.cmake
index b2b38ef..69c96cc 100644
--- a/Tests/RunCMake/RunCMake.cmake
+++ b/Tests/RunCMake/RunCMake.cmake
@@ -109,6 +109,7 @@ function(run_cmake test)
"|clang[^:]*: warning: the object size sanitizer has no effect at -O0, but is explicitly enabled:"
"|Error kstat returned"
"|Hit xcodebuild bug"
+ "|[^\n]*xcodebuild[^\n]*warning: file type[^\n]*is based on missing file type"
"|ld: 0711-224 WARNING: Duplicate symbol: .__init_aix_libgcc_cxa_atexit"
"|ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more information"
"|[^\n]*is a member of multiple groups"