diff options
author | Brad King <brad.king@kitware.com> | 2020-12-10 17:05:11 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2020-12-10 17:05:17 (GMT) |
commit | fd6c1e5a737f47d0dfd28d3b77e4b8e6dc8ff5d6 (patch) | |
tree | 1c0b4c547bd0ab3faeb2e9e709a9115fcacc1be8 | |
parent | 9109475bfb9371e74c6ddbf64a66054e5aaea795 (diff) | |
parent | 56a075eb5df3fc6a1bc400e1c1322985dc1ca3c9 (diff) | |
download | CMake-fd6c1e5a737f47d0dfd28d3b77e4b8e6dc8ff5d6.zip CMake-fd6c1e5a737f47d0dfd28d3b77e4b8e6dc8ff5d6.tar.gz CMake-fd6c1e5a737f47d0dfd28d3b77e4b8e6dc8ff5d6.tar.bz2 |
Merge topic 'rel-macos-apple-silicon'
56a075eb5d ci: update macOS package to produce universal binaries
b184cc256b ci: do not use sccache for macOS packaging
41bddf1028 ci: update to pre-built Qt 5.9.9 universal binaries for macOS packages
b201dc0d42 Utilities/Release: Add script to build Qt 5.9.9 macOS universal binaries
Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Ben Boeckel <ben.boeckel@kitware.com>
Merge-request: !5595
-rw-r--r-- | .gitlab/artifacts.yml | 2 | ||||
-rw-r--r-- | .gitlab/ci/configure_common.cmake | 4 | ||||
-rw-r--r-- | .gitlab/ci/configure_macos_package.cmake | 10 | ||||
-rw-r--r-- | .gitlab/ci/download_qt.cmake | 4 | ||||
-rw-r--r-- | .gitlab/ci/download_qt_hashes.cmake | 2 | ||||
-rw-r--r-- | .gitlab/os-macos.yml | 5 | ||||
-rw-r--r-- | Help/release/3.19.rst | 9 | ||||
-rw-r--r-- | Utilities/Release/README.rst | 6 | ||||
-rwxr-xr-x | Utilities/Release/macos/qt-5.9.9-macosx10.10-x86_64-arm64.bash | 132 |
9 files changed, 161 insertions, 13 deletions
diff --git a/.gitlab/artifacts.yml b/.gitlab/artifacts.yml index 0506e99..589b16c 100644 --- a/.gitlab/artifacts.yml +++ b/.gitlab/artifacts.yml @@ -74,7 +74,7 @@ paths: # Any packages made. - build/cmake-*-Linux-x86_64.* - - build/cmake-*-Darwin-x86_64.* + - build/cmake-*-macos-universal.* # Any source packages made. - build/cmake-*.tar.gz - build/cmake-*.zip diff --git a/.gitlab/ci/configure_common.cmake b/.gitlab/ci/configure_common.cmake index df49b2d..436e582 100644 --- a/.gitlab/ci/configure_common.cmake +++ b/.gitlab/ci/configure_common.cmake @@ -10,4 +10,6 @@ if (NOT "$ENV{CMAKE_BUILD_TYPE}" STREQUAL "") set(CMAKE_BUILD_TYPE "$ENV{CMAKE_BUILD_TYPE}" CACHE STRING "") endif () -include("${CMAKE_CURRENT_LIST_DIR}/configure_sccache.cmake") +if (NOT configure_no_sccache) + include("${CMAKE_CURRENT_LIST_DIR}/configure_sccache.cmake") +endif() diff --git a/.gitlab/ci/configure_macos_package.cmake b/.gitlab/ci/configure_macos_package.cmake index 424bc2b..a1dbdb9 100644 --- a/.gitlab/ci/configure_macos_package.cmake +++ b/.gitlab/ci/configure_macos_package.cmake @@ -9,10 +9,10 @@ set(CPACK_DMG_FORMAT "UDBZ" CACHE STRING "") set(CMAKE_CXX_FLAGS "-stdlib=libc++" CACHE STRING "") set(CMAKE_C_STANDARD "11" CACHE STRING "") set(CMAKE_CXX_STANDARD "14" CACHE STRING "") -set(CMAKE_OSX_ARCHITECTURES "x86_64" CACHE STRING "") -set(CMAKE_OSX_DEPLOYMENT_TARGET "10.7" CACHE STRING "") +set(CMAKE_OSX_ARCHITECTURES "x86_64;arm64" CACHE STRING "") +set(CMAKE_OSX_DEPLOYMENT_TARGET "10.10" CACHE STRING "") set(CMAKE_SKIP_BOOTSTRAP_TEST "TRUE" CACHE STRING "") -set(CPACK_SYSTEM_NAME "Darwin-x86_64" CACHE STRING "") +set(CPACK_SYSTEM_NAME "macos-universal" CACHE STRING "") set(BUILD_CursesDialog "ON" CACHE BOOL "") set(BUILD_QtDialog "TRUE" CACHE BOOL "") set(CMake_GUI_DISTRIBUTE_WITH_Qt_LGPL "3" CACHE STRING "") @@ -20,5 +20,9 @@ set(CMake_INSTALL_DEPENDENCIES "ON" CACHE BOOL "") set(CMAKE_SKIP_RPATH "TRUE" CACHE BOOL "") set(CMake_TEST_NO_FindPackageModeMakefileTest "TRUE" CACHE BOOL "") +# XXX(sccache): restore sccache when it works for multiple architectures: +# https://github.com/mozilla/sccache/issues/847 +set(configure_no_sccache 1) + include("${CMAKE_CURRENT_LIST_DIR}/configure_macos_common.cmake") include("${CMAKE_CURRENT_LIST_DIR}/configure_common.cmake") diff --git a/.gitlab/ci/download_qt.cmake b/.gitlab/ci/download_qt.cmake index c7e3717..4a33f12 100644 --- a/.gitlab/ci/download_qt.cmake +++ b/.gitlab/ci/download_qt.cmake @@ -50,8 +50,8 @@ if (qt_platform STREQUAL "windows_x86") elseif (qt_platform STREQUAL "mac_x64") if ("$ENV{CMAKE_CONFIGURATION}" MATCHES "package") list(APPEND qt_files - "qt-5.6.2-macosx10.7-x86_64.tar.xz") - set(qt_subdir "qt-5.6.2-macosx10.7-x86_64") + "qt-5.9.9-macosx10.10-x86_64-arm64.tar.xz") + set(qt_subdir "qt-5.9.9-macosx10.10-x86_64-arm64") else () set(qt_build_stamp "202009071110") set(qt_file_name_prefix "${qt_version}-0-${qt_build_stamp}") diff --git a/.gitlab/ci/download_qt_hashes.cmake b/.gitlab/ci/download_qt_hashes.cmake index 02a6fdd..0d286b5 100644 --- a/.gitlab/ci/download_qt_hashes.cmake +++ b/.gitlab/ci/download_qt_hashes.cmake @@ -10,4 +10,4 @@ set("5.15.1-0-202009071110qtwinextras-Windows-Windows_10-MSVC2015-Windows-Window set("5.15.1-0-202009071110qtbase-MacOS-MacOS_10_13-Clang-MacOS-MacOS_10_13-X86_64.7z_hash" df2813ce7c6cb4287abd7956cd1cb9d08312e4ac1208b6cb57af4df11b8ebba1) -set("qt-5.6.2-macosx10.7-x86_64.tar.xz_hash" 2b60373ea60037ce356d4c9f5a8c1df9854127a2c55118252e1a2f5a5f4e0010) +set("qt-5.9.9-macosx10.10-x86_64-arm64.tar.xz_hash" aa6229bc6bd01a44d18b07023417698fdf4de7a02b14e971b473d80956a57a1c) diff --git a/.gitlab/os-macos.yml b/.gitlab/os-macos.yml index d9df621..8a006b1 100644 --- a/.gitlab/os-macos.yml +++ b/.gitlab/os-macos.yml @@ -115,13 +115,8 @@ script: - *before_script_macos - - .gitlab/ci/sccache.sh - # Allow the server to already be running. - - "sccache --start-server || :" - - sccache --show-stats - ctest -VV -S .gitlab/ci/ctest_configure.cmake - ctest -VV -S .gitlab/ci/ctest_build.cmake - - sccache --show-stats - cd build - cpack -G TGZ - cpack -G DragNDrop diff --git a/Help/release/3.19.rst b/Help/release/3.19.rst index a29dc07..899e745 100644 --- a/Help/release/3.19.rst +++ b/Help/release/3.19.rst @@ -348,3 +348,12 @@ Changes made since CMake 3.19.0 include the following. been reverted to restore behavior from CMake 3.18 and below. * CUDA 11.1 support for Clang. + +3.19.2 +------ + +* The precompiled macOS binary provided on ``cmake.org`` is now a + universal binary with ``x86_64`` and ``arm64`` architectures. + It requires macOS 10.10 or newer. + The package file naming pattern has been changed from + ``cmake-$ver-Darwin-x86_64`` to ``cmake-$ver-macos-universal``. diff --git a/Utilities/Release/README.rst b/Utilities/Release/README.rst index 2d3525d..6e55dff 100644 --- a/Utilities/Release/README.rst +++ b/Utilities/Release/README.rst @@ -74,3 +74,9 @@ Each ``<os>/<arch>/`` directory contains the following: argument specifying either ``x86_64`` or ``i386``. .. _`kitware/cmake Docker Hub Repository`: https://hub.docker.com/r/kitware/cmake + +macOS +----- + +The ``macos/`` directory contains scripts used to produce dependencies +for building CMake binaries on macOS. diff --git a/Utilities/Release/macos/qt-5.9.9-macosx10.10-x86_64-arm64.bash b/Utilities/Release/macos/qt-5.9.9-macosx10.10-x86_64-arm64.bash new file mode 100755 index 0000000..b0973f4 --- /dev/null +++ b/Utilities/Release/macos/qt-5.9.9-macosx10.10-x86_64-arm64.bash @@ -0,0 +1,132 @@ +#!/usr/bin/env bash + +# Run this script on a macOS x86_64 host to generate Qt universal binaries. +# +# This script requires the 'makeuniversal' tool from: +# +# https://github.com/fizzyade/makeuniversal +# +# Build it with an existing local Qt installation first. +# +# Set the PATH environment variable to contain the location of 'makeuniversal'. + +set -e +set -x + +# Verify that 'makeuniversal' is available in the PATH. +type -p makeuniversal >/dev/null + +# Download, verify, and extract sources. +curl -OL https://download.qt.io/archive/qt/5.9/5.9.9/single/qt-everywhere-opensource-src-5.9.9.tar.xz +shasum -a 256 qt-everywhere-opensource-src-5.9.9.tar.xz | grep -q 5ce285209290a157d7f42ec8eb22bf3f1d76f2e03a95fc0b99b553391be01642 +tar xjf qt-everywhere-opensource-src-5.9.9.tar.xz + +# Build the x86_64 variant. +mkdir qt-5.9.9-x86_64 +cd qt-5.9.9-x86_64 +../qt-everywhere-opensource-src-5.9.9/configure \ + --prefix=/ \ + -platform macx-clang \ + -device-option QMAKE_APPLE_DEVICE_ARCHS=x86_64 \ + -device-option QMAKE_MACOSX_DEPLOYMENT_TARGET=10.10 \ + -release \ + -opensource -confirm-license \ + -gui \ + -widgets \ + -no-gif \ + -no-icu \ + -no-pch \ + -no-angle \ + -no-opengl \ + -no-dbus \ + -no-harfbuzz \ + -skip declarative \ + -skip multimedia \ + -skip qtcanvas3d \ + -skip qtcharts \ + -skip qtconnectivity \ + -skip qtdeclarative \ + -skip qtgamepad \ + -skip qtlocation \ + -skip qtmultimedia \ + -skip qtnetworkauth \ + -skip qtpurchasing \ + -skip qtremoteobjects \ + -skip qtscript \ + -skip qtsensors \ + -skip qtserialbus \ + -skip qtserialport \ + -skip qtsvg \ + -skip qtwebchannel \ + -skip qtwebengine \ + -skip qtwebsockets \ + -skip qtxmlpatterns \ + -nomake examples \ + -nomake tests \ + -nomake tools +make -j 8 +cd .. + +# Build the arm64 variant. +mkdir qt-5.9.9-arm64 +cd qt-5.9.9-arm64 +../qt-everywhere-opensource-src-5.9.9/configure \ + --prefix=/ \ + -platform macx-clang \ + -device-option QMAKE_APPLE_DEVICE_ARCHS=arm64 \ + -device-option QMAKE_MACOSX_DEPLOYMENT_TARGET=10.10 \ + -release \ + -opensource -confirm-license \ + -gui \ + -widgets \ + -no-gif \ + -no-icu \ + -no-pch \ + -no-angle \ + -no-opengl \ + -no-dbus \ + -no-harfbuzz \ + -skip declarative \ + -skip multimedia \ + -skip qtcanvas3d \ + -skip qtcharts \ + -skip qtconnectivity \ + -skip qtdeclarative \ + -skip qtgamepad \ + -skip qtlocation \ + -skip qtmultimedia \ + -skip qtnetworkauth \ + -skip qtpurchasing \ + -skip qtremoteobjects \ + -skip qtscript \ + -skip qtsensors \ + -skip qtserialbus \ + -skip qtserialport \ + -skip qtsvg \ + -skip qtwebchannel \ + -skip qtwebengine \ + -skip qtwebsockets \ + -skip qtxmlpatterns \ + -nomake examples \ + -nomake tests \ + -nomake tools +# Some executables fail to link due to architecture mismatch. +# Build what we can first. +make -j 8 -k || true +# Provide needed executables using the x86_64 variants. +cp ../qt-5.9.9-x86_64/qtbase/bin/uic qtbase/bin/uic +install_name_tool -add_rpath @executable_path/../../../qt-5.9.9-x86_64/qtbase/lib qtbase/bin/uic +cp ../qt-5.9.9-x86_64/qtbase/bin/qlalr qtbase/bin/qlalr +install_name_tool -add_rpath @executable_path/../../../qt-5.9.9-x86_64/qtbase/lib qtbase/bin/qlalr +# Some parts still fail to build, but the parts we need can finish. +make -j 8 -k || true +cd .. + +# Combine the two builds into universal binaries. +makeuniversal qt-5.9.9-univ qt-5.9.9-x86_64 qt-5.9.9-arm64 +cd qt-5.9.9-univ +make install -j 8 INSTALL_ROOT=/tmp/qt-5.9.9-macosx10.10-x86_64-arm64 +cd .. + +# Create the final tarball containing universal binaries. +tar cjf qt-5.9.9-macosx10.10-x86_64-arm64.tar.xz -C /tmp qt-5.9.9-macosx10.10-x86_64-arm64 |