Merge tag 'v3.19.3' into backport-3.19-rel-file-table

This commit is contained in:
Brad King
2021-04-05 13:44:49 -04:00
45 changed files with 724 additions and 96 deletions

View File

@@ -186,6 +186,29 @@ build:linux-x86_64-package:
variables:
RSYNC_DESTINATION: dev
build:linux-aarch64-package:
extends:
- .linux_package_aarch64
- .cmake_build_linux_package
- .cmake_release_artifacts
- .linux_builder_tags_aarch64
- .run_only_for_package
dependencies:
- prep:doc-package
needs:
- prep:doc-package
.upload:linux-aarch64-package:
extends:
- .rsync_upload
- .run_only_for_package
dependencies:
- build:linux-aarch64-package
needs:
- build:linux-aarch64-package
variables:
RSYNC_DESTINATION: dev
# macOS builds
build:macos-ninja:
@@ -261,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:

View File

@@ -74,7 +74,8 @@
paths:
# Any packages made.
- build/cmake-*-Linux-x86_64.*
- build/cmake-*-macos-universal.*
- build/cmake-*-Linux-aarch64.*
- build/cmake-*-macos*-universal.*
# Any source packages made.
- build/cmake-*.tar.gz
- build/cmake-*.zip

View File

@@ -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")

View File

@@ -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 "")
set(CMAKE_OSX_DEPLOYMENT_TARGET "10.13" CACHE STRING "")
# 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")
include("${CMAKE_CURRENT_LIST_DIR}/configure_macos_package_common.cmake")

View File

@@ -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")

View File

@@ -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")

View File

@@ -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)

View File

@@ -2,21 +2,30 @@
set -e
case "$( uname -s )" in
Linux)
readonly kernel="$(uname -s)-$(uname -m)"
case $kernel in
Linux-x86_64)
version="0.2.13"
shatool="sha256sum"
sha256sum="28a5499e340865b08b632306b435913beb590fbd7b49a3f887a623b459fabdeb"
platform="x86_64-unknown-linux-musl"
;;
Darwin)
Linux-aarch64)
version="g6628e1f"
shatool="sha256sum"
sha256sum="bb88adbb5a29c166ecaa78d0593493b609a7f84d91d1228502a908f319b513f0"
platform="aarch64-unknown-linux-musl"
url="https://github.com/hwinit/sccache/releases/download/$version"
;;
Darwin-x86_64)
version="gfe63078"
shatool="shasum -a 256"
sha256sum="60a0302b1d7227f7ef56abd82266353f570d27c6e850c56c6448bf62def38888"
platform="x86_64-apple-darwin"
url="https://paraview.org/files/dependencies"
;;
*)
echo "Unrecognized platform $( uname -s )"
echo "Unrecognized platform $kernel"
exit 1
;;
esac
@@ -28,9 +37,7 @@ readonly platform
readonly filename="sccache-$version-$platform"
readonly tarball="$filename.tar.gz"
if [ "$( uname -s )" = "Darwin" ]; then
url="https://paraview.org/files/dependencies"
else
if [ -z "$url" ]; then
url="https://github.com/mozilla/sccache/releases/download/$version"
fi
readonly url

View File

@@ -17,19 +17,22 @@
variables:
GIT_CLONE_PATH: "$CI_BUILDS_DIR/cmake ci"
.linux_package:
variables:
GIT_CLONE_PATH: "$CI_BUILDS_DIR/cmake ci"
LAUNCHER: "scl enable devtoolset-6 rh-python36 --"
.linux_package_x86_64:
extends: .linux_package
image: "kitware/cmake:build-linux-x86_64-deps-2020-04-02@sha256:77e9ab183f34680990db9da5945473e288f0d6556bce79ecc1589670d656e157"
variables:
GIT_CLONE_PATH: "$CI_BUILDS_DIR/cmake ci"
LAUNCHER: "scl enable devtoolset-6 rh-python36 --"
CMAKE_ARCH: x86_64
.linux_package_aarch64:
image: "kitware/cmake:build-linux-aarch64-deps-2020-12-21@sha256:0bd7dfe4e45593b04e39cd21e44011034610cfd376900558c5ef959bb1af15af"
variables:
GIT_CLONE_PATH: "$CI_BUILDS_DIR/cmake ci"
LAUNCHER: "scl enable devtoolset-7 --"
CMAKE_ARCH: aarch64
### Debian
.debian10:
@@ -160,6 +163,13 @@
- docker
- linux
.linux_builder_tags_aarch64:
tags:
- cmake
- build
- docker
- linux-aarch64
## Linux-specific scripts
.before_script_linux: &before_script_linux

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-12.2.app/Contents/Developer"
DEVELOPER_DIR: "/Applications/Xcode-12.3.app/Contents/Developer"
# Avoid conflicting with other projects running on the same machine.
SCCACHE_SERVER_PORT: 4227
@@ -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:
@@ -63,7 +71,7 @@
- cmake # Since this is a bare runner, pin to a project.
- macos
- shell
- xcode-12.2
- xcode-12.3
- nonconcurrent
.macos_builder_tags_package:
@@ -71,7 +79,7 @@
- cmake # Since this is a bare runner, pin to a project.
- macos
- shell
- xcode-12.2
- xcode-12.3
- nonconcurrent
- finder
@@ -80,7 +88,7 @@
- cmake # Since this is a bare runner, pin to a project.
- macos
- shell
- xcode-12.2
- xcode-12.3
- concurrent
## macOS-specific scripts

View File

@@ -15,4 +15,4 @@
- dnf install -y --setopt=install_weak_deps=False rsync openssh-clients
- chmod 400 $RSYNC_BINARY_KEY
- ssh-keygen -y -f $RSYNC_BINARY_KEY > $RSYNC_BINARY_KEY.pub
- rsync -tv --recursive -e "ssh -i $RSYNC_BINARY_KEY -o StrictHostKeyChecking=no -o LogLevel=ERROR" build/ kitware@public.kitware.com:$RSYNC_DESTINATION/
- rsync -tv --recursive -e "ssh -i $RSYNC_BINARY_KEY -o StrictHostKeyChecking=no -o LogLevel=ERROR" build/ kitware@cmake.org:$RSYNC_DESTINATION/

View File

@@ -31,6 +31,7 @@ Possible values are:
* ``KNOWN_LOCATION``
The "Link Binary With Libraries" build phase will be used to link to another
target under the same conditions as with ``BUILT_ONLY`` and also:
- Imported library targets except those of type ``UNKNOWN``.
- Any non-target library specified directly with a path.

View File

@@ -385,3 +385,18 @@ Changes made since CMake 3.19.0 include the following.
* The :variable:`CMAKE_ISPC_HEADER_SUFFIX` variable and corresponding
:prop_tgt:`ISPC_HEADER_SUFFIX` target property were added to control
the header suffix used by ``ISPC`` compiler generated headers.
3.19.3
------
* 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.

View File

@@ -1053,7 +1053,14 @@ function(FetchContent_Populate contentName)
# so no population is required. The build directory may still be specified
# by the declared details though.
if(NOT EXISTS "${FETCHCONTENT_SOURCE_DIR_${contentNameUpper}}")
if(NOT IS_ABSOLUTE "${FETCHCONTENT_SOURCE_DIR_${contentNameUpper}}")
# Don't check this directory because we don't know what location it is
# expected to be relative to. We can't make this a hard error for backward
# compatibility reasons.
message(WARNING "Relative source directory specified. This is not safe, "
"as it depends on the calling directory scope.\n"
" FETCHCONTENT_SOURCE_DIR_${contentNameUpper} --> ${FETCHCONTENT_SOURCE_DIR_${contentNameUpper}}")
elseif(NOT EXISTS "${FETCHCONTENT_SOURCE_DIR_${contentNameUpper}}")
message(FATAL_ERROR "Manually specified source directory is missing:\n"
" FETCHCONTENT_SOURCE_DIR_${contentNameUpper} --> ${FETCHCONTENT_SOURCE_DIR_${contentNameUpper}}")
endif()

View File

@@ -991,10 +991,10 @@ if (HDF5_FOUND)
add_library(HDF5::HDF5 INTERFACE IMPORTED)
string(REPLACE "-D" "" _hdf5_definitions "${HDF5_DEFINITIONS}")
set_target_properties(HDF5::HDF5 PROPERTIES
INTERFACE_LINK_LIBRARIES "${HDF5_LIBRARIES}"
INTERFACE_INCLUDE_DIRECTORIES "${HDF5_INCLUDE_DIRS}"
INTERFACE_COMPILE_DEFINITIONS "${_hdf5_definitions}")
unset(_hdf5_definitions)
target_link_libraries(HDF5::HDF5 INTERFACE ${HDF5_LIBRARIES})
endif ()
foreach (hdf5_lang IN LISTS HDF5_LANGUAGE_BINDINGS)

View File

@@ -646,6 +646,7 @@ function (_MPI_interrogate_compiler LANG)
foreach(_MPI_INCLUDE_PATH IN LISTS MPI_ALL_INCLUDE_PATHS)
string(REGEX REPLACE "^ ?${_MPI_PREPROCESSOR_FLAG_REGEX}${CMAKE_INCLUDE_FLAG_${LANG}} *" "" _MPI_INCLUDE_PATH "${_MPI_INCLUDE_PATH}")
string(REPLACE "\"" "" _MPI_INCLUDE_PATH "${_MPI_INCLUDE_PATH}")
string(REPLACE "'" "" _MPI_INCLUDE_PATH "${_MPI_INCLUDE_PATH}")
get_filename_component(_MPI_INCLUDE_PATH "${_MPI_INCLUDE_PATH}" REALPATH)
list(APPEND MPI_INCLUDE_DIRS_WORK "${_MPI_INCLUDE_PATH}")
endforeach()

View File

@@ -1,7 +1,7 @@
# CMake version number components.
set(CMake_VERSION_MAJOR 3)
set(CMake_VERSION_MINOR 19)
set(CMake_VERSION_PATCH 2)
set(CMake_VERSION_PATCH 3)
#set(CMake_VERSION_RC 0)
set(CMake_VERSION_IS_DIRTY 0)

View File

@@ -57,6 +57,9 @@ if(CMake_INSTALL_DEPENDENCIES AND (APPLE OR WIN32))
endmacro()
if(APPLE)
install_qt5_plugin("Qt5::QCocoaIntegrationPlugin" QT_PLUGINS)
if(TARGET Qt5::QMacStylePlugin)
install_qt5_plugin("Qt5::QMacStylePlugin" QT_PLUGINS)
endif()
file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/qt.conf"
"[Paths]\nPlugins = ${_qt_plugin_dir}\n")
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/qt.conf"
@@ -129,6 +132,7 @@ qt5_wrap_cpp(MOC_SRCS
WarningMessagesDialog.h
)
qt5_add_resources(RC_SRCS CMakeSetup.qrc)
add_library(CMakeGUIQRCLib OBJECT ${RC_SRCS})
if (FALSE) # CMake's bootstrap binary does not support automoc
set(CMAKE_AUTOMOC 1)
@@ -137,8 +141,7 @@ if (FALSE) # CMake's bootstrap binary does not support automoc
else ()
list(APPEND SRCS
${UI_SRCS}
${MOC_SRCS}
${RC_SRCS})
${MOC_SRCS})
endif ()
if(USE_LGPL)
@@ -161,6 +164,7 @@ target_link_libraries(CMakeGUIMainLib PUBLIC CMakeGUILib)
add_executable(cmake-gui WIN32 MACOSX_BUNDLE CMakeGUIExec.cxx ${MANIFEST_FILE})
target_link_libraries(cmake-gui CMakeGUIMainLib Qt5::Core)
target_sources(CMakeGUIMainLib INTERFACE $<TARGET_OBJECTS:CMakeGUIQRCLib>)
if(WIN32)
target_sources(CMakeGUIMainLib INTERFACE $<TARGET_OBJECTS:CMakeVersion> CMakeSetup.rc)
endif()

View File

@@ -18,6 +18,7 @@
#include "cmsys/RegularExpression.hxx"
#include "cmComputeLinkInformation.h"
#include "cmCryptoHash.h"
#include "cmCustomCommand.h"
#include "cmCustomCommandGenerator.h"
#include "cmCustomCommandLines.h"
@@ -797,9 +798,10 @@ void cmGlobalXCodeGenerator::addObject(std::unique_ptr<cmXCodeObject> obj)
}
cmXCodeObject* cmGlobalXCodeGenerator::CreateObject(
cmXCodeObject::PBXType ptype)
cmXCodeObject::PBXType ptype, cm::string_view key)
{
auto obj = cm::make_unique<cmXCode21Object>(ptype, cmXCodeObject::OBJECT);
auto obj = cm::make_unique<cmXCode21Object>(ptype, cmXCodeObject::OBJECT,
this->GetObjectId(ptype, key));
auto ptr = obj.get();
this->addObject(std::move(obj));
return ptr;
@@ -807,7 +809,9 @@ cmXCodeObject* cmGlobalXCodeGenerator::CreateObject(
cmXCodeObject* cmGlobalXCodeGenerator::CreateObject(cmXCodeObject::Type type)
{
auto obj = cm::make_unique<cmXCodeObject>(cmXCodeObject::None, type);
auto obj = cm::make_unique<cmXCodeObject>(
cmXCodeObject::None, type,
"Temporary cmake object, should not be referred to in Xcode file");
auto ptr = obj.get();
this->addObject(std::move(obj));
return ptr;
@@ -1725,13 +1729,13 @@ void cmGlobalXCodeGenerator::CreateCustomCommands(
if (this->XcodeBuildSystem >= BuildSystem::Twelve) {
// create prebuild phase
preBuildPhase =
this->CreateRunScriptBuildPhase("CMake PreBuild Rules", prebuild);
this->CreateRunScriptBuildPhase("CMake PreBuild Rules", gtgt, prebuild);
// create prelink phase
preLinkPhase =
this->CreateRunScriptBuildPhase("CMake PreLink Rules", prelink);
this->CreateRunScriptBuildPhase("CMake PreLink Rules", gtgt, prelink);
// create postbuild phase
postBuildPhase =
this->CreateRunScriptBuildPhase("CMake PostBuild Rules", postbuild);
postBuildPhase = this->CreateRunScriptBuildPhase("CMake PostBuild Rules",
gtgt, postbuild);
} else {
std::vector<cmSourceFile*> classes;
if (!gtgt->GetConfigCommonSourceFiles(classes)) {
@@ -1859,7 +1863,8 @@ cmXCodeObject* cmGlobalXCodeGenerator::CreateRunScriptBuildPhase(
}
cmXCodeObject* buildPhase =
this->CreateObject(cmXCodeObject::PBXShellScriptBuildPhase);
this->CreateObject(cmXCodeObject::PBXShellScriptBuildPhase,
cmStrCat(gt->GetName(), ':', sf->GetFullPath()));
buildPhase->AddAttribute("buildActionMask",
this->CreateString("2147483647"));
cmXCodeObject* buildFiles = this->CreateObject(cmXCodeObject::OBJECT_LIST);
@@ -1918,7 +1923,8 @@ cmXCodeObject* cmGlobalXCodeGenerator::CreateRunScriptBuildPhase(
}
cmXCodeObject* cmGlobalXCodeGenerator::CreateRunScriptBuildPhase(
std::string const& name, std::vector<cmCustomCommand> const& commands)
std::string const& name, cmGeneratorTarget const* gt,
std::vector<cmCustomCommand> const& commands)
{
if (commands.empty()) {
return nullptr;
@@ -1941,7 +1947,8 @@ cmXCodeObject* cmGlobalXCodeGenerator::CreateRunScriptBuildPhase(
}
cmXCodeObject* buildPhase =
this->CreateObject(cmXCodeObject::PBXShellScriptBuildPhase);
this->CreateObject(cmXCodeObject::PBXShellScriptBuildPhase,
cmStrCat(gt->GetName(), ':', name));
buildPhase->AddAttribute("buildActionMask",
this->CreateString("2147483647"));
cmXCodeObject* buildFiles = this->CreateObject(cmXCodeObject::OBJECT_LIST);
@@ -2909,8 +2916,8 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmGeneratorTarget* gtgt,
cmXCodeObject* cmGlobalXCodeGenerator::CreateUtilityTarget(
cmGeneratorTarget* gtgt)
{
cmXCodeObject* shellBuildPhase =
this->CreateObject(cmXCodeObject::PBXShellScriptBuildPhase);
cmXCodeObject* shellBuildPhase = this->CreateObject(
cmXCodeObject::PBXShellScriptBuildPhase, gtgt->GetName());
shellBuildPhase->AddAttribute("buildActionMask",
this->CreateString("2147483647"));
cmXCodeObject* buildFiles = this->CreateObject(cmXCodeObject::OBJECT_LIST);
@@ -3138,6 +3145,32 @@ cmXCodeObject* cmGlobalXCodeGenerator::FindXCodeTarget(
return i->second;
}
std::string cmGlobalXCodeGenerator::GetObjectId(cmXCodeObject::PBXType ptype,
cm::string_view key)
{
std::string objectId;
if (!key.empty()) {
cmCryptoHash hash(cmCryptoHash::AlgoSHA256);
hash.Initialize();
hash.Append(&ptype, sizeof(ptype));
hash.Append(key);
objectId = cmSystemTools::UpperCase(hash.FinalizeHex().substr(0, 24));
} else {
char cUuid[40] = { 0 };
CFUUIDRef uuid = CFUUIDCreate(kCFAllocatorDefault);
CFStringRef s = CFUUIDCreateString(kCFAllocatorDefault, uuid);
CFStringGetCString(s, cUuid, sizeof(cUuid), kCFStringEncodingUTF8);
objectId = cUuid;
CFRelease(s);
CFRelease(uuid);
cmSystemTools::ReplaceString(objectId, "-", "");
if (objectId.size() > 24) {
objectId = objectId.substr(0, 24);
}
}
return objectId;
}
std::string cmGlobalXCodeGenerator::GetOrCreateId(const std::string& name,
const std::string& id)
{

View File

@@ -11,6 +11,8 @@
#include <string>
#include <vector>
#include <cm/string_view>
#include "cmGlobalGenerator.h"
#include "cmXCodeObject.h"
@@ -162,11 +164,13 @@ private:
const std::string& configName);
cmXCodeObject* FindXCodeTarget(const cmGeneratorTarget*);
std::string GetObjectId(cmXCodeObject::PBXType ptype, cm::string_view key);
std::string GetOrCreateId(const std::string& name, const std::string& id);
// create cmXCodeObject from these functions so that memory can be managed
// correctly. All objects created are stored in this->XCodeObjects.
cmXCodeObject* CreateObject(cmXCodeObject::PBXType ptype);
cmXCodeObject* CreateObject(cmXCodeObject::PBXType ptype,
cm::string_view key = {});
cmXCodeObject* CreateObject(cmXCodeObject::Type type);
cmXCodeObject* CreateString(const std::string& s);
cmXCodeObject* CreateObjectReference(cmXCodeObject*);
@@ -250,7 +254,8 @@ private:
cmGeneratorTarget const* gt,
cmCustomCommand const& cc);
cmXCodeObject* CreateRunScriptBuildPhase(
std::string const& name, std::vector<cmCustomCommand> const& commands);
std::string const& name, cmGeneratorTarget const* gt,
std::vector<cmCustomCommand> const& commands);
std::string ConstructScript(cmCustomCommandGenerator const& ccg);
void CreateReRunCMakeFile(cmLocalGenerator* root,
std::vector<cmLocalGenerator*> const& gens);

View File

@@ -308,7 +308,7 @@ void cmMakefile::PrintCommandTrace(
args.reserve(lff.Arguments().size());
for (cmListFileArgument const& arg : lff.Arguments()) {
if (expand) {
if (expand && arg.Delim != cmListFileArgument::Bracket) {
temp = arg.Value;
this->ExpandVariablesInString(temp);
args.push_back(temp);

View File

@@ -952,9 +952,8 @@ bool cmMoveFile(std::wstring const& oldname, std::wstring const& newname)
SetLastError(0);
// Use MOVEFILE_REPLACE_EXISTING to replace an existing destination file.
// Use MOVEFILE_WRITE_THROUGH to flush the change to disk before returning.
return MoveFileExW(oldname.c_str(), newname.c_str(),
MOVEFILE_REPLACE_EXISTING | MOVEFILE_WRITE_THROUGH);
MOVEFILE_REPLACE_EXISTING);
}
}
#endif

View File

@@ -4,11 +4,12 @@
#include <ostream>
#include <string>
#include <utility>
#include "cmSystemTools.h"
cmXCode21Object::cmXCode21Object(PBXType ptype, Type type)
: cmXCodeObject(ptype, type)
cmXCode21Object::cmXCode21Object(PBXType ptype, Type type, std::string id)
: cmXCodeObject(ptype, type, std::move(id))
{
this->Version = 21;
}

View File

@@ -13,7 +13,7 @@
class cmXCode21Object : public cmXCodeObject
{
public:
cmXCode21Object(PBXType ptype, Type type);
cmXCode21Object(PBXType ptype, Type type, std::string id);
void PrintComment(std::ostream&) override;
static void PrintList(std::vector<std::unique_ptr<cmXCodeObject>> const&,
std::ostream& out, PBXType t);

View File

@@ -40,7 +40,7 @@ cmXCodeObject::~cmXCodeObject()
this->Version = 15;
}
cmXCodeObject::cmXCodeObject(PBXType ptype, Type type)
cmXCodeObject::cmXCodeObject(PBXType ptype, Type type, std::string id)
{
this->Version = 15;
this->Target = nullptr;
@@ -48,27 +48,7 @@ cmXCodeObject::cmXCodeObject(PBXType ptype, Type type)
this->IsA = ptype;
if (type == OBJECT) {
// Set the Id of an Xcode object to a unique string for each instance.
// However the Xcode user file references certain Ids: for those cases,
// override the generated Id using SetId().
//
char cUuid[40] = { 0 };
CFUUIDRef uuid = CFUUIDCreate(kCFAllocatorDefault);
CFStringRef s = CFUUIDCreateString(kCFAllocatorDefault, uuid);
CFStringGetCString(s, cUuid, sizeof(cUuid), kCFStringEncodingUTF8);
this->Id = cUuid;
CFRelease(s);
CFRelease(uuid);
} else {
this->Id =
"Temporary cmake object, should not be referred to in Xcode file";
}
cmSystemTools::ReplaceString(this->Id, "-", "");
if (this->Id.size() > 24) {
this->Id = this->Id.substr(0, 24);
}
this->Id = std::move(id);
this->TypeValue = type;
if (this->TypeValue == OBJECT) {

View File

@@ -57,7 +57,7 @@ public:
};
static const char* PBXTypeNames[];
virtual ~cmXCodeObject();
cmXCodeObject(PBXType ptype, Type type);
cmXCodeObject(PBXType ptype, Type type, std::string id);
Type GetType() const { return this->TypeValue; }
PBXType GetIsA() const { return this->IsA; }

View File

@@ -1,7 +1,7 @@
cmake_minimum_required(VERSION 3.0)
get_property(_isMultiConfig GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
if(NOT _isMultiConfig AND NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Debug CACHE STRING "Choose the type of build")
set(CMAKE_BUILD_TYPE Debug CACHE STRING "Choose the type of build" FORCE)
endif()
project(ConfigSources CXX)

View File

@@ -0,0 +1,4 @@
if(EXISTS "${CMAKE_CURRENT_BINARY_DIR}/exists-for-build2")
message(FATAL_ERROR "Custom command incorrectly re-ran after CMake re-ran!")
endif()
file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/out.txt")

View File

@@ -0,0 +1,5 @@
add_custom_command(OUTPUT out.txt
COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_LIST_DIR}/RepeatCMake-Custom-Script.cmake
DEPENDS ${CMAKE_CURRENT_LIST_DIR}/RepeatCMake-Custom-Script.cmake
)
add_custom_target(drive ALL DEPENDS out.txt)

View File

@@ -70,6 +70,23 @@ if(RunCMake_GENERATOR MATCHES "Make")
endif()
endif()
function(run_RepeatCMake CASE)
set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/${CASE}-build)
if(RunCMake_GENERATOR_IS_MULTI_CONFIG)
set(RunCMake_TEST_OPTIONS -DCMAKE_CONFIGURATION_TYPES=Debug)
else()
set(RunCMake_TEST_OPTIONS -DCMAKE_BUILD_TYPE=Debug)
endif()
run_cmake(${CASE})
set(RunCMake_TEST_NO_CLEAN 1)
run_cmake_command(${CASE}-build1 ${CMAKE_COMMAND} --build . --config Debug)
run_cmake_command(${CASE}-rerun1 ${CMAKE_COMMAND} .)
file(WRITE ${RunCMake_TEST_BINARY_DIR}/exists-for-build2 "")
run_cmake_command(${CASE}-build2 ${CMAKE_COMMAND} --build . --config Debug)
endfunction()
run_RepeatCMake(RepeatCMake-Custom)
function(run_ReGeneration)
# test re-generation of project even if CMakeLists.txt files disappeared

View File

@@ -0,0 +1 @@
set(a [[\B]])

View File

@@ -0,0 +1,3 @@
*Relative source directory specified. This is not safe, as it depends on
*the calling directory scope.
+ *FETCHCONTENT_SOURCE_DIR_WITHPROJECT --> WithProject

View File

@@ -0,0 +1 @@
include(ManualSourceDirectory.cmake)

View File

@@ -21,6 +21,11 @@ run_cmake_with_options(ManualSourceDirectory
run_cmake_with_options(ManualSourceDirectoryMissing
-D "FETCHCONTENT_SOURCE_DIR_WITHPROJECT=${CMAKE_CURRENT_LIST_DIR}/ADirThatDoesNotExist"
)
# Need to use :STRING to prevent CMake from automatically converting it to an
# absolute path
run_cmake_with_options(ManualSourceDirectoryRelative
-D "FETCHCONTENT_SOURCE_DIR_WITHPROJECT:STRING=WithProject"
)
function(run_FetchContent_DirOverrides)
set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/DirOverrides-build)

View File

@@ -0,0 +1,35 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
# Produce an image containing a portable CMake binary package for Linux/aarch64.
# Build using the CMake source directory as the build context.
# The resulting image will have an '/out' directory containing the package.
# Keep this in sync with the `.gitlab-ci.yml` `release_linux` image.
ARG FROM_IMAGE_NAME=kitware/cmake:build-linux-aarch64-deps-2020-12-21
ARG FROM_IMAGE_DIGEST=@sha256:0bd7dfe4e45593b04e39cd21e44011034610cfd376900558c5ef959bb1af15af
ARG FROM_IMAGE=$FROM_IMAGE_NAME$FROM_IMAGE_DIGEST
FROM $FROM_IMAGE
COPY . /opt/cmake/src/cmake
ARG TEST=true
RUN : \
&& mkdir -p /opt/cmake/src/cmake-build \
&& cd /opt/cmake/src/cmake-build \
&& cp ../cmake/Utilities/Release/linux/aarch64/cache.txt CMakeCache.txt \
&& source /opt/rh/devtoolset-7/enable \
&& set -x \
&& ../cmake/bootstrap --parallel=$(nproc) --docdir=doc/cmake \
&& nice make -j $(nproc) \
&& if $TEST; then \
# Run tests that require the full build tree.
bin/ctest --output-on-failure -j 8 -R '^(CMake\.|CMakeLib\.|CMakeServerLib\.|RunCMake\.ctest_memcheck)'; \
fi \
&& bin/cpack -G TGZ \
&& bin/cpack -G STGZ \
&& set +x \
&& mkdir /out \
&& mv cmake-*-Linux-aarch64.* /out \
&& :

View File

@@ -0,0 +1,31 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
# Produce a base image with a build environment for portable CMake binaries.
# Build using the directory containing this file as its own build context.
ARG FROM_IMAGE_NAME=centos:7
ARG FROM_IMAGE_DIGEST=@sha256:43964203bf5d7fe38c6fca6166ac89e4c095e2b0c0a28f6c7c678a1348ddc7fa
ARG FROM_IMAGE=$FROM_IMAGE_NAME$FROM_IMAGE_DIGEST
FROM $FROM_IMAGE
RUN : \
&& yum install -y centos-release-scl \
&& yum install -y \
ca-certificates \
curl \
devtoolset-7-gcc \
devtoolset-7-gcc-c++ \
fontconfig-devel \
freetype-devel \
git \
libX11-devel \
libxcb-devel \
make \
patch \
perl \
python3-pip \
xz \
which \
&& yum clean all \
&& :

View File

@@ -0,0 +1,44 @@
CMAKE_BUILD_TYPE:STRING=Release
CMAKE_C_STANDARD:STRING=11
CMAKE_CXX_STANDARD:STRING=14
# Require only older APIs where possible.
CMAKE_C_FLAGS:STRING=-D_POSIX_C_SOURCE=199506L -D_POSIX_SOURCE=1 -D_SVID_SOURCE=1 -D_BSD_SOURCE=1
# Link C++ library statically.
CMAKE_EXE_LINKER_FLAGS:STRING=-static-libstdc++ -static-libgcc
# Enable ssl support in curl
CMAKE_USE_OPENSSL:BOOL=ON
OPENSSL_CRYPTO_LIBRARY:STRING=/opt/openssl/lib/libcrypto.a;-pthread
OPENSSL_INCLUDE_DIR:PATH=/opt/openssl/include
OPENSSL_SSL_LIBRARY:FILEPATH=/opt/openssl/lib/libssl.a
# Enable ccmake
BUILD_CursesDialog:BOOL=ON
CURSES_FORM_LIBRARY:FILEPATH=/opt/ncurses/lib/libform.a
CURSES_INCLUDE_PATH:PATH=/opt/ncurses/include
CURSES_NCURSES_LIBRARY:FILEPATH=/opt/ncurses/lib/libncurses.a
# Enable cmake-gui with static qt plugins
BUILD_QtDialog:BOOL=TRUE
CMake_GUI_DISTRIBUTE_WITH_Qt_LGPL:STRING=3
CMAKE_PREFIX_PATH:STRING=/opt/qt
CMake_QT_STATIC_QXcbIntegrationPlugin_LIBRARIES:STRING=/opt/qt/plugins/platforms/libqxcb.a;/opt/qt/lib/libQt5XcbQpa.a;/opt/qt/lib/libQt5ServiceSupport.a;/opt/qt/lib/libQt5EdidSupport.a;/opt/qt/lib/libQt5EventDispatcherSupport.a;/opt/qt/lib/libQt5FontDatabaseSupport.a;/opt/qt/lib/libQt5ThemeSupport.a;/opt/qt/lib/libxcb-static.a;-lxcb;-lfontconfig;-lfreetype
# Build documentation.
SPHINX_EXECUTABLE:FILEPATH=/usr/local/bin/sphinx-build
SPHINX_HTML:BOOL=ON
SPHINX_MAN:BOOL=ON
SPHINX_QTHELP:BOOL=ON
QCOLLECTIONGENERATOR_EXECUTABLE:PATH=/opt/qt/bin/qhelpgenerator
# We bootstrap as part of the build so skip its test.
CMAKE_SKIP_BOOTSTRAP_TEST:STRING=TRUE
# Skip Qt5 tests because our Qt is static.
CMake_TEST_Qt5:BOOL=FALSE
# CPack package file name component for this platform.
CPACK_SYSTEM_NAME:STRING=Linux-aarch64

View File

@@ -0,0 +1,141 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
# Produce an image with custom-built dependencies for portable CMake binaries.
# Build using the directory containing this file as its own build context.
ARG FROM_IMAGE_NAME=kitware/cmake:build-linux-aarch64-base-2020-12-21
ARG FROM_IMAGE_DIGEST=@sha256:c8d9fa279ef09c26e74ff28770ae0db1f4cb75ef53b782ace604daba71a41f65
ARG FROM_IMAGE=$FROM_IMAGE_NAME$FROM_IMAGE_DIGEST
FROM $FROM_IMAGE
# Sphinx
RUN : \
&& pip3 install sphinx==2.1.2 \
&& :
# Qt
# Version 5.12.0 was the last to bundle xkbcommon.
COPY qt-install.patch /opt/qt/src/
RUN : \
&& mkdir -p /opt/qt/src/qt-build \
&& cd /opt/qt/src \
&& curl -OL https://download.qt.io/archive/qt/5.12/5.12.0/single/qt-everywhere-src-5.12.0.tar.xz \
&& sha512sum qt-everywhere-src-5.12.0.tar.xz | grep -q 0dd03d2645fb6dac5b58c8caf92b4a0a6900131f1ccfb02443a0df4702b5da0458f4c45e758d1b929ec709b0f4b36900df2fd60a058af9cc8c1a0748b6d57aae \
&& tar xJf qt-everywhere-src-5.12.0.tar.xz \
&& cd qt-build \
&& source /opt/rh/devtoolset-7/enable \
&& ../qt-everywhere-src-5.12.0/configure \
-prefix /opt/qt \
-static \
-release \
-c++std c++11 \
-opensource -confirm-license \
-gui \
-widgets \
-xcb \
-fontconfig \
-sql-sqlite \
-qt-doubleconversion \
-qt-libjpeg \
-qt-libpng \
-qt-pcre \
-qt-sqlite \
-qt-xcb \
-qt-xkbcommon \
-qt-zlib \
-system-freetype \
-no-accessibility \
-no-compile-examples \
-no-cups \
-no-dbus \
-no-directfb \
-no-egl \
-no-eglfs \
-no-evdev \
-no-gbm \
-no-gif \
-no-glib \
-no-gtk \
-no-harfbuzz \
-no-iconv \
-no-icu \
-no-journald \
-no-kms \
-no-libinput \
-no-libproxy \
-no-linuxfb \
-no-ltcg \
-no-mirclient \
-no-mtdev \
-no-opengl \
-no-openssl \
-no-pch \
-no-sql-mysql \
-no-sql-psql \
-no-sql-sqlite2 \
-no-syslog \
-no-system-proxies \
-no-tslib \
-no-use-gold-linker \
-skip declarative \
-skip multimedia \
-skip qtcanvas3d \
-skip qtconnectivity \
-skip qtdeclarative \
-skip qtlocation \
-skip qtmultimedia \
-skip qtsensors \
-skip qtserialport \
-skip qtsvg \
-skip qtwayland \
-skip qtwebchannel \
-skip qtwebengine \
-skip qtwebsockets \
-skip qtwinextras \
-skip qtxmlpatterns \
-nomake examples \
-nomake tests \
&& make install -j $(nproc) \
&& cd /opt/qt \
&& patch -p1 -i src/qt-install.patch \
&& cd /opt \
&& rm -rf /opt/qt/src \
&& :
# Curses
RUN : \
&& mkdir -p /opt/ncurses/src/ncurses-build \
&& cd /opt/ncurses/src \
&& curl -O https://ftp.gnu.org/pub/gnu/ncurses/ncurses-6.1.tar.gz \
&& sha512sum ncurses-6.1.tar.gz | grep -q e308af43f8b7e01e98a55f4f6c4ee4d1c39ce09d95399fa555b3f0cdf5fd0db0f4c4d820b4af78a63f6cf6d8627587114a40af48cfc066134b600520808a77ee \
&& tar xzf ncurses-6.1.tar.gz \
&& cd ncurses-build \
&& source /opt/rh/devtoolset-7/enable \
&& ../ncurses-6.1/configure \
--prefix=/opt/ncurses \
--with-terminfo-dirs=/etc/terminfo:/lib/terminfo:/usr/share/terminfo \
--with-default-terminfo-dir=/usr/share/terminfo \
--without-shared \
&& make -j $(nproc) \
&& make install.libs install.includes \
&& cd /opt \
&& rm -rf /opt/ncurses/src \
&& :
# OpenSSL
COPY openssl-source.patch /opt/openssl/src/
RUN : \
&& mkdir -p /opt/openssl/src \
&& cd /opt/openssl/src \
&& curl -O https://www.openssl.org/source/openssl-1.1.1f.tar.gz \
&& sha512sum openssl-1.1.1f.tar.gz | grep -q b00bd9b5ad5298fbceeec6bb19c1ab0c106ca5cfb31178497c58bf7e0e0cf30fcc19c20f84e23af31cc126bf2447d3e4f8461db97bafa7bd78f69561932f000c \
&& tar xzf openssl-1.1.1f.tar.gz \
&& cd openssl-1.1.1f \
&& patch -p1 -i ../openssl-source.patch \
&& source /opt/rh/devtoolset-7/enable \
&& ./Configure --prefix=/opt/openssl linux-elf no-asm no-shared -D_POSIX_C_SOURCE=199506L -D_POSIX_SOURCE=1 -D_SVID_SOURCE=1 -D_BSD_SOURCE=1 \
&& make install_dev -j $(nproc) \
&& cd /opt \
&& rm -rf /opt/openssl/src \
&& :

View File

@@ -0,0 +1,12 @@
# enable pthread APIs disabled by our _POSIX_SOURCE definitions
--- openssl-source/crypto/threads_pthread.c.orig
+++ openssl-source/crypto/threads_pthread.c
@@ -6,6 +6,8 @@
* in the file LICENSE in the source distribution or at
* https://www.openssl.org/source/license.html
*/
+#undef _POSIX_C_SOURCE
+#undef _POSIX_SOURCE
#include <openssl/crypto.h>
#include "internal/cryptlib.h"

View File

@@ -0,0 +1,24 @@
# Add Qt Core dependencies missing from static Qt build.
--- qt-install/lib/cmake/Qt5Core/Qt5CoreConfig.cmake.orig
+++ qt-install/lib/cmake/Qt5Core/Qt5CoreConfig.cmake
@@ -111,7 +111,7 @@
list(REMOVE_DUPLICATES Qt5Core_COMPILE_DEFINITIONS)
list(REMOVE_DUPLICATES Qt5Core_EXECUTABLE_COMPILE_FLAGS)
- set(_Qt5Core_LIB_DEPENDENCIES "")
+ set(_Qt5Core_LIB_DEPENDENCIES "${_qt5Core_install_prefix}/lib/libqtpcre2.a")
add_library(Qt5::Core STATIC IMPORTED)
# Add Qt Gui dependencies missing from static Qt build.
--- qt-install/lib/cmake/Qt5Gui/Qt5GuiConfig.cmake.orig
+++ qt-install/lib/cmake/Qt5Gui/Qt5GuiConfig.cmake
@@ -111,7 +111,7 @@
list(REMOVE_DUPLICATES Qt5Gui_COMPILE_DEFINITIONS)
list(REMOVE_DUPLICATES Qt5Gui_EXECUTABLE_COMPILE_FLAGS)
- set(_Qt5Gui_LIB_DEPENDENCIES "Qt5::Core")
+ set(_Qt5Gui_LIB_DEPENDENCIES "Qt5::Core;${_qt5Gui_install_prefix}/lib/libqtlibpng.a")
add_library(Qt5::Gui STATIC IMPORTED)

View File

@@ -0,0 +1,26 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
# Produce a base image with a test environment for packaged CMake binaries.
# Build using the directory containing this file as its own build context.
ARG FROM_IMAGE_NAME=debian:10
ARG FROM_IMAGE_DIGEST=@sha256:ab0ba5b78bfe01d61ac4f9919cd0e7bef8beefa0a77d3d710bfc8630d96804b8
ARG FROM_IMAGE=$FROM_IMAGE_NAME$FROM_IMAGE_DIGEST
FROM $FROM_IMAGE
RUN : \
&& apt-get update \
&& apt-get install -y \
dpkg \
file \
gcc \
g++ \
gfortran \
qt5-default \
make \
ninja-build \
&& apt-get clean \
&& :
COPY test-make.bash test-ninja.bash /

View File

@@ -0,0 +1,17 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
set -e
set -x
mkdir -p /opt/cmake/src/cmake-make
cd /opt/cmake/src/cmake-make
echo >CMakeCache.txt '
CMake_TEST_IPO_WORKS_C:BOOL=ON
CMake_TEST_IPO_WORKS_CXX:BOOL=ON
CMake_TEST_IPO_WORKS_Fortran:BOOL=ON
CMake_TEST_NO_NETWORK:BOOL=ON
CMake_TEST_Qt5:BOOL=ON
'
cmake ../cmake -DCMake_TEST_HOST_CMAKE=1 -G "Unix Makefiles"
make -j $(nproc)
ctest --output-on-failure -j $(nproc)

View File

@@ -0,0 +1,17 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
set -e
set -x
mkdir -p /opt/cmake/src/cmake-ninja
cd /opt/cmake/src/cmake-ninja
echo >CMakeCache.txt '
CMAKE_Fortran_COMPILER:STRING=
CMake_TEST_IPO_WORKS_C:BOOL=ON
CMake_TEST_IPO_WORKS_CXX:BOOL=ON
CMake_TEST_NO_NETWORK:BOOL=ON
CMake_TEST_Qt5:BOOL=ON
'
cmake ../cmake -DCMake_TEST_HOST_CMAKE=1 -G "Ninja"
ninja
ctest --output-on-failure -j $(nproc)

View File

@@ -0,0 +1,125 @@
#!/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
umask 022
# 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.15/5.15.2/single/qt-everywhere-src-5.15.2.tar.xz
shasum -a 256 qt-everywhere-src-5.15.2.tar.xz | grep -q 3a530d1b243b5dec00bc54937455471aaa3e56849d2593edb8ded07228202240
tar xjf qt-everywhere-src-5.15.2.tar.xz
# Build the x86_64 variant.
mkdir qt-5.15.2-x86_64
cd qt-5.15.2-x86_64
../qt-everywhere-src-5.15.2/configure \
--prefix=/ \
-platform macx-clang \
-device-option QMAKE_APPLE_DEVICE_ARCHS=x86_64 \
-device-option QMAKE_MACOSX_DEPLOYMENT_TARGET=10.13 \
-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.15.2-arm64
cd qt-5.15.2-arm64
../qt-everywhere-src-5.15.2/configure \
--prefix=/ \
-platform macx-clang \
-device-option QMAKE_APPLE_DEVICE_ARCHS=arm64 \
-device-option QMAKE_MACOSX_DEPLOYMENT_TARGET=10.13 \
-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 -k
cd ..
# Combine the two builds into universal binaries.
makeuniversal qt-5.15.2-univ qt-5.15.2-x86_64 qt-5.15.2-arm64
cd qt-5.15.2-univ
make install -j 8 INSTALL_ROOT=/tmp/qt-5.15.2-macosx10.13-x86_64-arm64
cd ..
# Create the final tarball containing universal binaries.
tar cjf qt-5.15.2-macosx10.13-x86_64-arm64.tar.xz -C /tmp qt-5.15.2-macosx10.13-x86_64-arm64

View File

@@ -13,6 +13,8 @@
set -e
set -x
umask 022
# Verify that 'makeuniversal' is available in the PATH.
type -p makeuniversal >/dev/null