Skip to content

Commit

Permalink
ci: build separate macOS packages for macOS 10.13+ and macOS 10.10+
Browse files Browse the repository at this point in the history
In order to support modern macOS features like Dark Mode, we need to use
Qt 5.15, which requires macOS 10.13.  However, we still want to support
macOS 10.10 as well, for which we need to use Qt 5.9.  Build separate
macOS packages for these use cases.

Fixes: #21606
Issue: #20825
  • Loading branch information
bradking committed Jan 7, 2021
1 parent bbec5a0 commit 6410425
Show file tree
Hide file tree
Showing 9 changed files with 69 additions and 28 deletions.
12 changes: 12 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,18 @@ build:macos-package:
variables:
RSYNC_DESTINATION: dev

build:macos10.10-package:
extends:
- .macos10.10_package
- .cmake_build_macos_package
- .cmake_release_artifacts
- .macos_builder_tags_package
- .run_only_for_package
dependencies:
- prep:doc-package
needs:
- prep:doc-package

# Windows builds

build:windows-vs2019-x64-ninja:
Expand Down
2 changes: 1 addition & 1 deletion .gitlab/artifacts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
# Any packages made.
- build/cmake-*-Linux-x86_64.*
- build/cmake-*-Linux-aarch64.*
- build/cmake-*-macos-universal.*
- build/cmake-*-macos*-universal.*
# Any source packages made.
- build/cmake-*.tar.gz
- build/cmake-*.zip
Expand Down
4 changes: 4 additions & 0 deletions .gitlab/ci/configure_macos10.10_package.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
set(CPACK_SYSTEM_NAME "macos10.10-universal" CACHE STRING "")
set(CMAKE_OSX_DEPLOYMENT_TARGET "10.10" CACHE STRING "")

include("${CMAKE_CURRENT_LIST_DIR}/configure_macos_package_common.cmake")
28 changes: 2 additions & 26 deletions .gitlab/ci/configure_macos_package.cmake
Original file line number Diff line number Diff line change
@@ -1,28 +1,4 @@
set(CMake_DOC_ARTIFACT_PREFIX "$ENV{CI_PROJECT_DIR}/build/install-doc" CACHE PATH "")

# Set up install destinations as expected by the packaging scripts.
set(CMAKE_INSTALL_PREFIX "/" CACHE PATH "")
set(CMAKE_DOC_DIR "doc/cmake" CACHE STRING "")

# Settings for CMake packages for macOS.
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;arm64" CACHE STRING "")
set(CMAKE_OSX_DEPLOYMENT_TARGET "10.10" CACHE STRING "")
set(CMAKE_SKIP_BOOTSTRAP_TEST "TRUE" 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 "")
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)
set(CMAKE_OSX_DEPLOYMENT_TARGET "10.13" CACHE STRING "")

include("${CMAKE_CURRENT_LIST_DIR}/configure_macos_common.cmake")
include("${CMAKE_CURRENT_LIST_DIR}/configure_common.cmake")
include("${CMAKE_CURRENT_LIST_DIR}/configure_macos_package_common.cmake")
26 changes: 26 additions & 0 deletions .gitlab/ci/configure_macos_package_common.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
set(CMake_DOC_ARTIFACT_PREFIX "$ENV{CI_PROJECT_DIR}/build/install-doc" CACHE PATH "")

# Set up install destinations as expected by the packaging scripts.
set(CMAKE_INSTALL_PREFIX "/" CACHE PATH "")
set(CMAKE_DOC_DIR "doc/cmake" CACHE STRING "")

# Settings for CMake packages for macOS.
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;arm64" CACHE STRING "")
set(CMAKE_SKIP_BOOTSTRAP_TEST "TRUE" CACHE STRING "")
set(BUILD_CursesDialog "ON" CACHE BOOL "")
set(BUILD_QtDialog "TRUE" CACHE BOOL "")
set(CMake_GUI_DISTRIBUTE_WITH_Qt_LGPL "3" CACHE STRING "")
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")
6 changes: 5 additions & 1 deletion .gitlab/ci/download_qt.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,11 @@ if (qt_platform STREQUAL "windows_x86")

set(qt_subdir "${qt_version}/msvc${msvc_year}_64")
elseif (qt_platform STREQUAL "mac_x64")
if ("$ENV{CMAKE_CONFIGURATION}" MATCHES "package")
if ("$ENV{CMAKE_CONFIGURATION}" MATCHES "macos_package")
list(APPEND qt_files
"qt-5.15.2-macosx10.13-x86_64-arm64.tar.xz")
set(qt_subdir "qt-5.15.2-macosx10.13-x86_64-arm64")
elseif ("$ENV{CMAKE_CONFIGURATION}" MATCHES "macos10.10_package")
list(APPEND qt_files
"qt-5.9.9-macosx10.10-x86_64-arm64.tar.xz")
set(qt_subdir "qt-5.9.9-macosx10.10-x86_64-arm64")
Expand Down
1 change: 1 addition & 0 deletions .gitlab/ci/download_qt_hashes.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,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.9.9-macosx10.10-x86_64-arm64.tar.xz_hash" d4449771afa0bc6a809c14f1e6d939e7732494cf059503ae451e2bfe8fc60cc1)
set("qt-5.15.2-macosx10.13-x86_64-arm64.tar.xz_hash" 7b9463a01c8beeee5bf8d01c70deff2d08561cd20aaf6f7a2f41cf8b68ce8a6b)
8 changes: 8 additions & 0 deletions .gitlab/os-macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,14 @@
CTEST_NO_WARNINGS_ALLOWED: 1
CMake_SKIP_INSTALL: 1

.macos10.10_package:
extends: .macos_build

variables:
CMAKE_CONFIGURATION: macos10.10_package
CTEST_NO_WARNINGS_ALLOWED: 1
CMake_SKIP_INSTALL: 1

### External testing

.macos_xcode:
Expand Down
10 changes: 10 additions & 0 deletions Help/release/3.19.rst
Original file line number Diff line number Diff line change
Expand Up @@ -390,3 +390,13 @@ Changes made since CMake 3.19.0 include the following.
------

* A precompiled Linux ``aarch64`` binary is now provided on ``cmake.org``.

* Two precompiled macOS binaries are now provided on ``cmake.org``:

* The naming pattern ``cmake-$ver-macos-universal`` is a universal
binary with ``x86_64`` and ``arm64`` architectures. It requires
macOS 10.13 or newer.

* The naming pattern ``cmake-$ver-macos10.10-universal`` is a universal
binary with ``x86_64`` and ``arm64`` architectures. It requires
macOS 10.10 or newer.

0 comments on commit 6410425

Please sign in to comment.