Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 19 additions & 13 deletions ports/qt5-base/cmake/configure_qt.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,17 @@ function(configure_qt)
if(NOT _csc_TARGET_PLATFORM)
message(FATAL_ERROR "configure_qt requires a TARGET_PLATFORM argument.")
endif()

if(DEFINED _csc_HOST_PLATFORM)
list(APPEND _csc_OPTIONS -platform ${_csc_HOST_PLATFORM})
endif()


if(VCPKG_TARGET_IS_OSX AND VCPKG_CROSSCOMPILING)
set(PLATFORM_FLAG -xplatform)
else()
set(PLATFORM_FLAG -platform)
endif()

if(DEFINED _csc_HOST_TOOLS_ROOT)
## vcpkg internal file struture assumed here!
message(STATUS "Building Qt with prepared host tools from ${_csc_HOST_TOOLS_ROOT}!")
Expand Down Expand Up @@ -39,7 +45,7 @@ function(configure_qt)
else()
#list(APPEND _csc_OPTIONS_DEBUG -separate-debug-info)
endif()

if(VCPKG_TARGET_IS_WINDOWS AND "${VCPKG_CRT_LINKAGE}" STREQUAL "static")
list(APPEND _csc_OPTIONS -static-runtime)
endif()
Expand Down Expand Up @@ -69,7 +75,7 @@ function(configure_qt)
set(ENV{PKG_CONFIG} "${PKGCONFIG}")
get_filename_component(PKGCONFIG_PATH "${PKGCONFIG}" DIRECTORY)
vcpkg_add_to_path("${PKGCONFIG_PATH}")

foreach(_buildname ${BUILDTYPES})
set(PKGCONFIG_INSTALLED_DIR "${_VCPKG_INSTALLED_PKGCONF}${_path_suffix_${_buildname}}/lib/pkgconfig")
set(PKGCONFIG_INSTALLED_SHARE_DIR "${_VCPKG_INSTALLED_PKGCONF}/share/pkgconfig")
Expand All @@ -95,8 +101,8 @@ function(configure_qt)
-hostprefix ${CURRENT_INSTALLED_DIR}/tools/qt5${_path_suffix_${_buildname}}
#-hostprefix ${CURRENT_INSTALLED_DIR}/tools/qt5
-hostlibdir ${CURRENT_INSTALLED_DIR}/tools/qt5${_path_suffix_${_buildname}}/lib # could probably be move to manual-link
-hostbindir ${CURRENT_INSTALLED_DIR}/tools/qt5${_path_suffix_${_buildname}}/bin
#-hostbindir ${CURRENT_INSTALLED_DIR}/tools/qt5/bin
-hostbindir ${CURRENT_INSTALLED_DIR}/tools/qt5${_path_suffix_${_buildname}}/bin
#-hostbindir ${CURRENT_INSTALLED_DIR}/tools/qt5/bin
# Qt VS Plugin requires a /bin subfolder with the executables in the root dir. But to use the wizard a correctly setup lib folder is also required
# So with the vcpkg layout there is no way to make it work unless all dll are are copied to tools/qt5/bin and all libs to tools/qt5/lib
-archdatadir ${CURRENT_INSTALLED_DIR}/tools/qt5${_path_suffix_${_buildname}}
Expand All @@ -109,11 +115,11 @@ function(configure_qt)
-libdir ${CURRENT_INSTALLED_DIR}${_path_suffix_${_buildname}}/lib
-I ${CURRENT_INSTALLED_DIR}/include
-I ${CURRENT_INSTALLED_DIR}/include/qt5
-L ${CURRENT_INSTALLED_DIR}${_path_suffix_${_buildname}}/lib
-L ${CURRENT_INSTALLED_DIR}${_path_suffix_${_buildname}}/lib
-L ${CURRENT_INSTALLED_DIR}${_path_suffix_${_buildname}}/lib/manual-link
-platform ${_csc_TARGET_PLATFORM}
${PLATFORM_FLAG} ${_csc_TARGET_PLATFORM}
)

if(DEFINED _csc_HOST_TOOLS_ROOT) #use qmake
if(WIN32)
set(INVOKE_OPTIONS "QMAKE_CXX.QMAKE_MSC_VER=1911" "QMAKE_MSC_VER=1911")
Expand All @@ -131,9 +137,9 @@ function(configure_qt)
)
endif()

# Note archdatadir and datadir are required to be prefixed with the hostprefix?
# Note archdatadir and datadir are required to be prefixed with the hostprefix?
message(STATUS "Configuring ${_build_triplet} done")

# Copy configuration dependent qt.conf
file(TO_CMAKE_PATH "${CURRENT_PACKAGES_DIR}" CMAKE_CURRENT_PACKAGES_DIR_PATH)
file(TO_CMAKE_PATH "${CURRENT_INSTALLED_DIR}" CMAKE_CURRENT_INSTALLED_DIR_PATH)
Expand All @@ -145,7 +151,7 @@ function(configure_qt)
string(REGEX REPLACE "\\[EffectiveSourcePaths\\]\r?\nPrefix=[^\r\n]+\r?\n" "" _contents ${_contents})
string(REPLACE "Sysroot=\n" "" _contents ${_contents})
string(REPLACE "SysrootifyPrefix=false\n" "" _contents ${_contents})
file(WRITE "${CURRENT_PACKAGES_DIR}/tools/qt5/qt_${_build_type_${_buildname}}.conf" "${_contents}")
endforeach()
file(WRITE "${CURRENT_PACKAGES_DIR}/tools/qt5/qt_${_build_type_${_buildname}}.conf" "${_contents}")
endforeach()

endfunction()
38 changes: 21 additions & 17 deletions ports/qt5-base/cmake/find_qt_mkspec.cmake
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
function(find_qt_mkspec TARGET_PLATFORM_MKSPEC_OUT HOST_PLATFORM_MKSPEC_OUT EXT_HOST_TOOLS_OUT)
## Figure out QTs target mkspec
if(NOT DEFINED VCPKG_QT_TARGET_MKSPEC)
message(STATUS "Figuring out qt target mkspec. Target arch ${VCPKG_TARGET_ARCHITECTURE}")
if(VCPKG_TARGET_IS_WINDOWS)
message(STATUS "Figuring out qt target mkspec. Target arch ${VCPKG_TARGET_ARCHITECTURE}")
if(VCPKG_TARGET_IS_WINDOWS)
if(VCPKG_TARGET_IS_UWP)
if(VCPKG_PLATFORM_TOOLSET STREQUAL "v140")
set(msvc_year "2015")
Expand All @@ -14,9 +14,9 @@ function(find_qt_mkspec TARGET_PLATFORM_MKSPEC_OUT HOST_PLATFORM_MKSPEC_OUT EXT_
message(FATAL_ERROR "No target mkspec found!")
endif()
set(_tmp_targ_out "winrt-${VCPKG_TARGET_ARCHITECTURE}-msvc${msvc_year}")
else()
else()
if("${VCPKG_TARGET_ARCHITECTURE}" MATCHES "arm64")
message(STATUS "Figuring out arm64")
message(STATUS "Figuring out arm64")
set(_tmp_targ_out "win32-arm64-msvc2017") #mkspec does not have anything defined related to msvc2017 so this should work
else()
set(_tmp_targ_out "win32-msvc")
Expand All @@ -25,14 +25,18 @@ function(find_qt_mkspec TARGET_PLATFORM_MKSPEC_OUT HOST_PLATFORM_MKSPEC_OUT EXT_
elseif(VCPKG_TARGET_IS_LINUX)
set(_tmp_targ_out "linux-g++" )
elseif(VCPKG_TARGET_IS_OSX)
set(_tmp_targ_out "macx-clang") # switch to macx-g++ since vcpkg requires g++ to compile any way?
if("${VCPKG_TARGET_ARCHITECTURE}" MATCHES "arm64")
set(_tmp_targ_out "arm64-macx-clang") # switch to macx-g++ since vcpkg requires g++ to compile any way?
else()
set(_tmp_targ_out "macx-clang") # switch to macx-g++ since vcpkg requires g++ to compile any way?
endif()
endif()
else()
set(_tmp_targ_out ${VCPKG_QT_TARGET_MKSPEC})
endif()
message(STATUS "Target mkspec set to: ${_tmp_targ_out}")
message(STATUS "Target mkspec set to: ${_tmp_targ_out}")
set(${TARGET_PLATFORM_MKSPEC_OUT} ${_tmp_targ_out} PARENT_SCOPE)

## Figure out QTs host mkspec
if(NOT DEFINED VCPKG_QT_HOST_MKSPEC)
#if(WIN32)
Expand All @@ -43,9 +47,9 @@ function(find_qt_mkspec TARGET_PLATFORM_MKSPEC_OUT HOST_PLATFORM_MKSPEC_OUT EXT_
# set(_tmp_host_out "macx-clang")
#endif()
if(DEFINED _tmp_host_out)
message(STATUS "Host mkspec set to: ${_tmp_host_out}")
message(STATUS "Host mkspec set to: ${_tmp_host_out}")
else()
message(STATUS "Host mkspec not set. Qt's own buildsystem will try to figure out the host system")
message(STATUS "Host mkspec not set. Qt's own buildsystem will try to figure out the host system")
endif()
else()
set(_tmp_host_out ${VCPKG_QT_HOST_MKSPEC})
Expand All @@ -54,12 +58,12 @@ function(find_qt_mkspec TARGET_PLATFORM_MKSPEC_OUT HOST_PLATFORM_MKSPEC_OUT EXT_
if(DEFINED _tmp_host_out)
set(${HOST_PLATFORM_MKSPEC_OUT} ${_tmp_host_out} PARENT_SCOPE)
endif()
## Figure out VCPKG qt-tools directory for the port.
if(NOT DEFINED VCPKG_QT_HOST_TOOLS_ROOT AND DEFINED VCPKG_QT_HOST_PLATFORM) ## Root dir of the required host tools

## Figure out VCPKG qt-tools directory for the port.
if(NOT DEFINED VCPKG_QT_HOST_TOOLS_ROOT AND DEFINED VCPKG_QT_HOST_PLATFORM) ## Root dir of the required host tools
if(NOT "${_tmp_host_out}" MATCHES "${_tmp_host_out}")
if(CMAKE_HOST_WIN32)

if($ENV{PROCESSOR_ARCHITECTURE} MATCHES "[aA][rR][mM]64")
list(APPEND _test_triplets arm64-windows)
elseif($ENV{PROCESSOR_ARCHITECTURE} MATCHES "[aA][mM][dD]64")
Expand All @@ -84,16 +88,16 @@ function(find_qt_mkspec TARGET_PLATFORM_MKSPEC_OUT HOST_PLATFORM_MKSPEC_OUT EXT_
set(_tmp_host_qmake ${QMAKE_PATH} PARENT_SCOPE)
message(STATUS "Qt host tools root dir within vcpkg: ${_tmp_host_root}")
break()
endif()
endif()
endforeach()
if(NOT DEFINED _tmp_host_root)
message(FATAL_ERROR "Unable to locate required host tools. Please define VCPKG_QT_HOST_TOOLS_ROOT to the required root dir of the host tools")
endif()
message(FATAL_ERROR "Unable to locate required host tools. Please define VCPKG_QT_HOST_TOOLS_ROOT to the required root dir of the host tools")
endif()
endif()
else()
set(_tmp_host_root ${VCPKG_QT_HOST_TOOLS_ROOT})
endif()

if(DEFINED _tmp_host_root)
set(${EXT_HOST_TOOLS_OUT} ${_tmp_host_root} PARENT_SCOPE)
endif()
Expand Down
208 changes: 208 additions & 0 deletions ports/qt5-base/patches/arm64-osx.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,208 @@
diff --git a/mkspecs/arm64-macx-clang/Info.plist.app b/mkspecs/arm64-macx-clang/Info.plist.app
new file mode 100644
index 0000000000..4d64a77704
--- /dev/null
+++ b/mkspecs/arm64-macx-clang/Info.plist.app
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>CFBundleExecutable</key>
+ <string>${EXECUTABLE_NAME}</string>
+ <key>CFBundleGetInfoString</key>
+ <string>Created by Qt/QMake</string>
+ <key>CFBundleIconFile</key>
+ <string>${ASSETCATALOG_COMPILER_APPICON_NAME}</string>
+ <key>CFBundleIdentifier</key>
+ <string>${PRODUCT_BUNDLE_IDENTIFIER}</string>
+ <key>CFBundlePackageType</key>
+ <string>APPL</string>
+ <key>CFBundleSignature</key>
+ <string>${QMAKE_PKGINFO_TYPEINFO}</string>
+ <key>LSMinimumSystemVersion</key>
+ <string>${MACOSX_DEPLOYMENT_TARGET}</string>
+ <key>NOTE</key>
+ <string>This file was generated by Qt/QMake.</string>
+ <key>NSPrincipalClass</key>
+ <string>NSApplication</string>
+ <key>NSSupportsAutomaticGraphicsSwitching</key>
+ <true/>
+</dict>
+</plist>
diff --git a/mkspecs/arm64-macx-clang/Info.plist.dSYM.in b/mkspecs/arm64-macx-clang/Info.plist.dSYM.in
new file mode 100644
index 0000000000..a8c8d0d4fb
--- /dev/null
+++ b/mkspecs/arm64-macx-clang/Info.plist.dSYM.in
@@ -0,0 +1,18 @@
+<?xml version=\"1.0\" encoding=\"UTF-8\"?>
+<!DOCTYPE plist PUBLIC \"-//Apple Computer//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">
+<plist version=\"1.0\">
+ <dict>
+ <key>CFBundleIdentifier</key>
+ <string>com.apple.xcode.dsym.$${BUNDLEIDENTIFIER}</string>
+ <key>CFBundlePackageType</key>
+ <string>dSYM</string>
+ <key>CFBundleSignature</key>
+ <string>????</string>
+!!IF !isEmpty(VERSION)
+ <key>CFBundleShortVersionString</key>
+ <string>$${VER_MAJ}.$${VER_MIN}</string>
+ <key>CFBundleVersion</key>
+ <string>$${VER_MAJ}.$${VER_MIN}.$${VER_PAT}</string>
+!!ENDIF
+ </dict>
+</plist>
diff --git a/mkspecs/arm64-macx-clang/Info.plist.disable_highdpi b/mkspecs/arm64-macx-clang/Info.plist.disable_highdpi
new file mode 100644
index 0000000000..a9b89888ad
--- /dev/null
+++ b/mkspecs/arm64-macx-clang/Info.plist.disable_highdpi
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>NSHighResolutionCapable</key>
+ <string>NO</string>
+</dict>
+</plist>
diff --git a/mkspecs/arm64-macx-clang/Info.plist.lib b/mkspecs/arm64-macx-clang/Info.plist.lib
new file mode 100644
index 0000000000..ce28365500
--- /dev/null
+++ b/mkspecs/arm64-macx-clang/Info.plist.lib
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>CFBundleExecutable</key>
+ <string>${EXECUTABLE_NAME}</string>
+ <key>CFBundleGetInfoString</key>
+ <string>Created by Qt/QMake</string>
+ <key>CFBundleIdentifier</key>
+ <string>${PRODUCT_BUNDLE_IDENTIFIER}</string>
+ <key>CFBundlePackageType</key>
+ <string>FMWK</string>
+ <key>CFBundleShortVersionString</key>
+ <string>${QMAKE_SHORT_VERSION}</string>
+ <key>CFBundleSignature</key>
+ <string>${QMAKE_PKGINFO_TYPEINFO}</string>
+ <key>CFBundleVersion</key>
+ <string>${QMAKE_FULL_VERSION}</string>
+ <key>NOTE</key>
+ <string>Please, do NOT change this file -- It was generated by Qt/QMake.</string>
+</dict>
+</plist>
diff --git a/mkspecs/arm64-macx-clang/qmake.conf b/mkspecs/arm64-macx-clang/qmake.conf
new file mode 100644
index 0000000000..7dd4e9e201
--- /dev/null
+++ b/mkspecs/arm64-macx-clang/qmake.conf
@@ -0,0 +1,33 @@
+#
+# qmake configuration for Clang on OS X
+#
+
+# Opt-in xcb QPA support with XQuartz:
+#
+# configure \
+# -pkg-config \
+# -fontconfig -system-freetype \
+# -system-xcb -no-opengl
+#
+# Ensure that pkg-config is properly configured, or that
+# PKG_CONFIG_PATH=/opt/X11/lib/pkgconfig:/opt/X11/share/pkgconfig
+# is set in your build environment.
+#
+# If you don't want to use pkg-config, you can add:
+# -L/opt/X11/lib -I/opt/X11/include
+# to the configure options.
+#
+# Due to irreconcilable differences between Cocoa
+# and X11, OpenGL is currently not supported.
+
+QMAKE_LIBS_X11 = -lX11 -lXext -lm
+QMAKE_LIBDIR_X11 = /opt/X11/lib
+QMAKE_INCDIR_X11 = /opt/X11/include
+QMAKE_APPLE_DEVICE_ARCHS = arm64
+
+include(../common/macx.conf)
+include(../common/gcc-base-mac.conf)
+include(../common/clang.conf)
+include(../common/clang-mac.conf)
+
+load(qt_config)
diff --git a/mkspecs/arm64-macx-clang/qplatformdefs.h b/mkspecs/arm64-macx-clang/qplatformdefs.h
new file mode 100644
index 0000000000..063491dd90
--- /dev/null
+++ b/mkspecs/arm64-macx-clang/qplatformdefs.h
@@ -0,0 +1,41 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the qmake spec of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "../common/mac/qplatformdefs.h"
+
diff --git a/mkspecs/common/macx.conf b/mkspecs/common/macx.conf
index 67552dcc6c..265c0328d6 100644
--- a/mkspecs/common/macx.conf
+++ b/mkspecs/common/macx.conf
@@ -6,7 +6,6 @@
QMAKE_MAC_SDK = macosx

QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.13
-QMAKE_APPLE_DEVICE_ARCHS = x86_64

# Should be 10.15, but as long as the CI builds with
# older SDKs we have to keep this.
diff --git a/mkspecs/macx-clang/qmake.conf b/mkspecs/macx-clang/qmake.conf
index 464f327ac4..297282e6e6 100644
--- a/mkspecs/macx-clang/qmake.conf
+++ b/mkspecs/macx-clang/qmake.conf
@@ -23,6 +23,7 @@
QMAKE_LIBS_X11 = -lX11 -lXext -lm
QMAKE_LIBDIR_X11 = /opt/X11/lib
QMAKE_INCDIR_X11 = /opt/X11/include
+QMAKE_APPLE_DEVICE_ARCHS = x86_64

include(../common/macx.conf)
include(../common/gcc-base-mac.conf)
Loading