diff options
author | Michal Klocek <michal.klocek@qt.io> | 2020-01-10 17:00:36 +0100 |
---|---|---|
committer | Shawn Rutledge <shawn.rutledge@qt.io> | 2020-01-17 17:06:27 +0000 |
commit | 07f2353ee1688eaf55d7d82c71ec42c80fcf4ee2 (patch) | |
tree | 9e5ed89ce5a78ea18a1bbfeef8cafac18e9653b3 | |
parent | 093cf56fc30f7aab9c7b7b34b6ce7b51e9f9e6d7 (diff) |
Add support for qtpdf ios builds
Fix platform checks, add initial gn args,
use shared library template for gn to get all
the linker objects. This is just debug build.
Task-number: QTBUG-77931
Change-Id: I9b3f7d3440aec66433ed19f4976e14506fba45dd
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
-rw-r--r-- | configure.pri | 13 | ||||
-rw-r--r-- | mkspecs/features/functions.prf | 1 | ||||
-rw-r--r-- | mkspecs/features/gn_generator.prf | 7 | ||||
-rw-r--r-- | src/buildtools/config/ios.pri | 64 | ||||
-rw-r--r-- | src/pdf/pdfcore.pro | 2 | ||||
-rw-r--r-- | src/pdf/pdfcore_generator.pro | 1 |
6 files changed, 82 insertions, 6 deletions
diff --git a/configure.pri b/configure.pri index 3a144e3f8..f89df5273 100644 --- a/configure.pri +++ b/configure.pri @@ -114,7 +114,7 @@ defineTest(qtwebengine_platformError) { defineTest(qtConfTest_detectPlatform) { QT_FOR_CONFIG += gui-private - !linux:!win32:!macos { + !linux:!win32:!macos:!ios { qtwebengine_platformError("Unknown platform. Qt WebEngine only supports Linux, Windows, and macOS.") } else { linux:qtwebengine_isLinuxPlatformSupported() { @@ -126,6 +126,9 @@ defineTest(qtConfTest_detectPlatform) { macos:qtwebengine_isMacOsPlatformSupported() { $${1}.platform = "macos" } + ios:qtwebengine_isMacOsPlatformSupported() { + $${1}.platform = "ios" + } } !isEmpty(platformError) { @@ -423,21 +426,21 @@ defineTest(qtwebengine_isWindowsPlatformSupported) { defineTest(qtwebengine_isMacOsPlatformSupported) { # FIXME: Try to get it back down to 8.2 for building on OS X 10.11 !qtwebengine_isMinXcodeVersion(8, 3, 3) { - qtwebengine_platformError("Using Xcode version $$QMAKE_XCODE_VERSION, but at least version 8.3.3 is required to build Qt WebEngine.") + qtwebengine_platformError("Using Xcode version $$QMAKE_XCODE_VERSION, but at least version 8.3.3 is required to build Qt WebEngine or Qt Pdf.") return(false) } !clang|intel_icc { - qtwebengine_platformError("Qt WebEngine on macOS requires Clang.") + qtwebengine_platformError("Qt WebEngine and Qt Pdf requires Clang.") return(false) } # We require macOS 10.12 (darwin version 16.0.0) or newer. darwin_major_version = $$section(QMAKE_HOST.version, ., 0, 0) lessThan(darwin_major_version, 16) { - qtwebengine_platformError("Building Qt WebEngine requires macOS version 10.12 or newer.") + qtwebengine_platformError("Building Qt WebEngine or Qt Pdf requires macOS version 10.12 or newer.") return(false) } !qtwebengine_isMinOSXSDKVersion(10, 12): { - qtwebengine_platformError("Building Qt WebEngine requires a macOS SDK version of 10.12 or newer. Current version is $${WEBENGINE_OSX_SDK_PRODUCT_VERSION}.") + qtwebengine_platformError("Building Qt WebEngine or Qt Pdf requires a macOS SDK version of 10.12 or newer. Current version is $${WEBENGINE_OSX_SDK_PRODUCT_VERSION}.") return(false) } return(true) diff --git a/mkspecs/features/functions.prf b/mkspecs/features/functions.prf index 512e2523b..db0b072a7 100644 --- a/mkspecs/features/functions.prf +++ b/mkspecs/features/functions.prf @@ -74,6 +74,7 @@ defineReplace(gnPath) { defineReplace(gnArgs) { linux: include($$QTWEBENGINE_ROOT/src/buildtools/config/linux.pri) macos: include($$QTWEBENGINE_ROOT/src/buildtools/config/mac_osx.pri) + ios: include($$QTWEBENGINE_ROOT/src/buildtools/config/ios.pri) win32: include($$QTWEBENGINE_ROOT/src/buildtools/config/windows.pri) isEmpty(gn_args): error(No gn_args found please make sure you have valid configuration.) return($$gn_args) diff --git a/mkspecs/features/gn_generator.prf b/mkspecs/features/gn_generator.prf index 358084e59..6ff09d851 100644 --- a/mkspecs/features/gn_generator.prf +++ b/mkspecs/features/gn_generator.prf @@ -12,13 +12,18 @@ defineReplace(getTargetType) { defineReplace(filter_flag_values) { value_to_check = $$1 - macos:equals(value_to_check, "$(EXPORT_ARCH_ARGS)") { + if (macos|ios):equals(value_to_check, "$(EXPORT_ARCH_ARGS)") { # EXPORT_ARCH_ARGS comes from qtbase/mkspecs/features/mac/default_post.prf which is a way # to figure out the architectures to pass to the compiler at Makefile time. Because this # variable expansion is not supported by GN, we filter it out. GN takes care of assigning # the architecture itself. return("") } + if (ios) { + equals(value_to_check, "$(EXPORT_QMAKE_XARCH_LFLAGS)"): return("") + equals(value_to_check, "$(EXPORT_QMAKE_XARCH_CFLAGS)"): return("") + } + return($$value_to_check) } diff --git a/src/buildtools/config/ios.pri b/src/buildtools/config/ios.pri new file mode 100644 index 000000000..36ea183ca --- /dev/null +++ b/src/buildtools/config/ios.pri @@ -0,0 +1,64 @@ +load(functions) + +include($$QTWEBENGINE_OUT_ROOT/src/buildtools/qtbuildtools-config.pri) +include($$QTWEBENGINE_OUT_ROOT/src/pdf/qtpdf-config.pri) +QT_FOR_CONFIG += buildtools-private pdf-private + + +QMAKE_MAC_SDK_VERSION = $$eval(QMAKE_MAC_SDK.$${QMAKE_MAC_SDK}.SDKVersion) +isEmpty(QMAKE_MAC_SDK_VERSION) { + QMAKE_MAC_SDK_VERSION = $$system("/usr/bin/xcodebuild -sdk $${QMAKE_MAC_SDK} -version SDKVersion 2>/dev/null") + isEmpty(QMAKE_MAC_SDK_VERSION): error("Could not resolve SDK version for \'$${QMAKE_MAC_SDK}\'") +} +QMAKE_CLANG_DIR = "/usr" +QMAKE_CLANG_PATH = $$eval(QMAKE_MAC_SDK.macx-clang.$${QMAKE_MAC_SDK}.QMAKE_CXX) +!isEmpty(QMAKE_CLANG_PATH) { + clang_dir = $$clean_path("$$dirname(QMAKE_CLANG_PATH)/../") + exists($$clang_dir): QMAKE_CLANG_DIR = $$clang_dir +} +QMAKE_CLANG_PATH = "$${QMAKE_CLANG_DIR}/bin/clang++" +message("Using clang++ from $${QMAKE_CLANG_PATH}") +system("$${QMAKE_CLANG_PATH} --version") + +gn_args += \ +use_qt=true \ +closure_compile=false \ +is_component_build=false \ +is_shared=true \ +is_debug=true \ +enable_message_center=false \ +enable_nacl=false \ +enable_remoting=false \ +enable_reporting=false \ +enable_resource_whitelist_generation=false \ +enable_swiftshader=false \ +enable_web_speech=false \ +has_native_accessibility=false \ +enable_debugallocation=false \ +use_allocator_shim=false \ +use_allocator=\"none\" \ +use_custom_libcxx=false \ +v8_use_external_startup_data=false \ +v8_use_snapshot=false \ +toolkit_views=false \ +treat_warnings_as_errors=false \ +safe_browsing_mode=0 \ +optimize_webui=false \ +forbid_non_component_debug_builds=false \ +clang_use_chrome_plugins=false \ +use_xcode_clang=true \ +clang_base_path=\"$${QMAKE_CLANG_DIR}\" \ +ios_enable_code_signing=false \ +target_os=\"ios\" \ +#target_cpu=\"$${QMAKE_APPLE_SIMULATOR_ARCHS}\" \ +#target_cpu=\"$${QMAKE_APPLE_DEVICE_ARCHS}\" \ +target_cpu=\"x64\" \ +ios_deployment_target=\"$${QMAKE_IOS_DEPLOYMENT_TARGET}\" \ +enable_ios_bitcode=true \ +use_jumbo_build=false \ +pdf_enable_v8=false \ +pdf_enable_xfa=false \ +pdf_enable_xfa_bmp=false \ +pdf_enable_xfa_gif=false \ +pdf_enable_xfa_png=false \ +pdf_enable_xfa_tiff=false diff --git a/src/pdf/pdfcore.pro b/src/pdf/pdfcore.pro index 752ae4468..5314d30d2 100644 --- a/src/pdf/pdfcore.pro +++ b/src/pdf/pdfcore.pro @@ -56,6 +56,8 @@ msvc { QMAKE_CXXFLAGS_WARN_ON += -wd"4100" } +ios: OBJECTS += $$NINJA_OBJECTS + SOURCES += \ qpdfbookmarkmodel.cpp \ qpdfdocument.cpp \ diff --git a/src/pdf/pdfcore_generator.pro b/src/pdf/pdfcore_generator.pro index dc978988b..c8eb13b81 100644 --- a/src/pdf/pdfcore_generator.pro +++ b/src/pdf/pdfcore_generator.pro @@ -3,6 +3,7 @@ qtConfig(debug_and_release): CONFIG += debug_and_release TARGET = QtPdf TEMPLATE = lib CONFIG = gn_generator $$CONFIG +ios: CONFIG -=static # note we still do static on ios when linking GN_SRC_DIR = $$PWD GN_FILE = $$OUT_PWD/$$getConfigDir()/BUILD.gn GN_FIND_MOCABLES_SCRIPT = $$shell_path($$QTWEBENGINE_ROOT/tools/scripts/gn_find_mocables.py) |