Merge pull request #4120 from nextcloud/feature/qtquick-compile

Add option of enabling QtQuick compiler
This commit is contained in:
Matthieu Gallien 2022-01-07 23:32:46 +01:00 committed by GitHub
commit a7c1f58f99
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 21 additions and 22 deletions

View file

@ -9,7 +9,7 @@ steps:
path: /drone/build path: /drone/build
commands: commands:
- cd /drone/build - cd /drone/build
- cmake -DCMAKE_C_COMPILER=gcc-10 -DCMAKE_CXX_COMPILER=g++-10 -DCMAKE_BUILD_TYPE=Debug -DBUILD_UPDATER=ON -DBUILD_TESTING=1 -DECM_ENABLE_SANITIZERS=address -DCMAKE_CXX_FLAGS=-Werror ../src - cmake -DCMAKE_C_COMPILER=gcc-10 -DCMAKE_CXX_COMPILER=g++-10 -DCMAKE_BUILD_TYPE=Debug -DQUICK_COMPILER=ON -DBUILD_UPDATER=ON -DBUILD_TESTING=1 -DECM_ENABLE_SANITIZERS=address -DCMAKE_CXX_FLAGS=-Werror ../src
- name: compile - name: compile
image: ghcr.io/nextcloud/continuous-integration-client:client-5.15-4 image: ghcr.io/nextcloud/continuous-integration-client:client-5.15-4
volumes: volumes:
@ -53,7 +53,7 @@ steps:
path: /drone/build path: /drone/build
commands: commands:
- cd /drone/build - cd /drone/build
- cmake -GNinja -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DCMAKE_C_COMPILER=clang-10 -DCMAKE_CXX_COMPILER=clang++-10 -DCMAKE_BUILD_TYPE=Debug -DBUILD_UPDATER=ON -DBUILD_TESTING=1 -DECM_ENABLE_SANITIZERS=address -DCMAKE_CXX_FLAGS=-Werror ../src - cmake -GNinja -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DCMAKE_C_COMPILER=clang-10 -DCMAKE_CXX_COMPILER=clang++-10 -DCMAKE_BUILD_TYPE=Debug -DQUICK_COMPILER=ON -DBUILD_UPDATER=ON -DBUILD_TESTING=1 -DECM_ENABLE_SANITIZERS=address -DCMAKE_CXX_FLAGS=-Werror ../src
- name: compile - name: compile
image: ghcr.io/nextcloud/continuous-integration-client:client-5.15-4 image: ghcr.io/nextcloud/continuous-integration-client:client-5.15-4
volumes: volumes:

View file

@ -1,5 +1,6 @@
cmake_minimum_required(VERSION 3.6) cmake_minimum_required(VERSION 3.6)
set(CMAKE_CXX_STANDARD 14) set(CMAKE_CXX_STANDARD 14)
cmake_policy(SET CMP0071 NEW) # Enable use of QtQuick compiler/generated code
project(client) project(client)
@ -106,6 +107,9 @@ if(APPLE AND BUILD_OWNCLOUD_OSX_BUNDLE)
set(BIN_INSTALL_DIR "${APPLICATION_NAME}.app/Contents/MacOS") set(BIN_INSTALL_DIR "${APPLICATION_NAME}.app/Contents/MacOS")
endif() endif()
option(QUICK_COMPILER "Use QtQuick compiler to improve performance" ON)
# this option removes Http authentication, keychain, shibboleth etc and is intended for # this option removes Http authentication, keychain, shibboleth etc and is intended for
# external authentication mechanisms # external authentication mechanisms
option(TOKEN_AUTH_ONLY "TOKEN_AUTH_ONLY" OFF) option(TOKEN_AUTH_ONLY "TOKEN_AUTH_ONLY" OFF)

View file

@ -1,5 +1,14 @@
project(gui) project(gui)
find_package(Qt5 REQUIRED COMPONENTS Widgets Svg Qml Quick QuickControls2 Xml Network) find_package(Qt5 REQUIRED COMPONENTS Widgets Svg Qml Quick QuickControls2 Xml Network)
if(QUICK_COMPILER)
find_package(Qt5QuickCompiler)
set_package_properties(Qt5QuickCompiler PROPERTIES
DESCRIPTION "Compile QML at build time"
TYPE REQUIRED
)
endif()
if (NOT TARGET Qt5::GuiPrivate) if (NOT TARGET Qt5::GuiPrivate)
message(FATAL_ERROR "Could not find GuiPrivate component of Qt5. It might be shipped as a separate package, please check that.") message(FATAL_ERROR "Could not find GuiPrivate component of Qt5. It might be shipped as a separate package, please check that.")
endif() endif()
@ -13,9 +22,6 @@ IF(BUILD_UPDATER)
endif() endif()
configure_file(${CMAKE_SOURCE_DIR}/theme.qrc.in ${CMAKE_SOURCE_DIR}/theme.qrc) configure_file(${CMAKE_SOURCE_DIR}/theme.qrc.in ${CMAKE_SOURCE_DIR}/theme.qrc)
set(MIRALL_RC_SRC ../../resources.qrc)
list(APPEND MIRALL_RC_SRC ${CMAKE_SOURCE_DIR}/theme.qrc)
set(theme_dir ${CMAKE_SOURCE_DIR}/theme) set(theme_dir ${CMAKE_SOURCE_DIR}/theme)
set(client_UI_SRCS set(client_UI_SRCS
@ -39,21 +45,6 @@ set(client_UI_SRCS
addcertificatedialog.ui addcertificatedialog.ui
proxyauthdialog.ui proxyauthdialog.ui
mnemonicdialog.ui mnemonicdialog.ui
UserStatusSelector.qml
UserStatusSelectorDialog.qml
tray/ActivityActionButton.qml
tray/ActivityItem.qml
tray/ActivityList.qml
tray/Window.qml
tray/UserLine.qml
tray/UnifiedSearchInputContainer.qml
tray/UnifiedSearchResultFetchMoreTrigger.qml
tray/UnifiedSearchResultItem.qml
tray/UnifiedSearchResultItemSkeleton.qml
tray/UnifiedSearchResultItemSkeletonContainer.qml
tray/UnifiedSearchResultListItem.qml
tray/UnifiedSearchResultNothingFound.qml
tray/UnifiedSearchResultSectionItem.qml
wizard/flow2authwidget.ui wizard/flow2authwidget.ui
wizard/owncloudadvancedsetuppage.ui wizard/owncloudadvancedsetuppage.ui
wizard/owncloudconnectionmethoddialog.ui wizard/owncloudconnectionmethoddialog.ui
@ -64,6 +55,12 @@ set(client_UI_SRCS
wizard/welcomepage.ui wizard/welcomepage.ui
) )
if(QUICK_COMPILER)
qtquick_compiler_add_resources(client_UI_SRCS ../../resources.qrc ${CMAKE_SOURCE_DIR}/theme.qrc)
else()
qt_add_resources(client_UI_SRCS ../../resources.qrc ${CMAKE_SOURCE_DIR}/theme.qrc)
endif()
set(client_SRCS set(client_SRCS
accountmanager.cpp accountmanager.cpp
accountsettings.cpp accountsettings.cpp
@ -232,7 +229,6 @@ IF( WIN32 )
ENDIF() ENDIF()
set( final_src set( final_src
${MIRALL_RC_SRC}
${client_SRCS} ${client_SRCS}
${client_UI_SRCS} ${client_UI_SRCS}
${guiMoc} ${guiMoc}
@ -451,7 +447,6 @@ endif()
set_target_properties(nextcloudCore set_target_properties(nextcloudCore
PROPERTIES PROPERTIES
AUTOUIC ON AUTOUIC ON
AUTORCC ON
AUTOMOC ON AUTOMOC ON
) )