From bd22779965db220aa7a6c068cb1849013b96b80d Mon Sep 17 00:00:00 2001 From: Petr Bena Date: Fri, 19 Jul 2024 10:06:14 +0200 Subject: [PATCH] updated linux build scripts --- README.md | 2 +- configure | 10 ++++++++++ src/CMakeLists.txt | 10 +++++++--- 3 files changed, 18 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index eee14d4a7..277eae20e 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,7 @@ Libraries and tools you need to have to build: * C++11 compiler * [CMake](https://github.com/Kitware/CMake) 2.8.9 or higher is required -* QT5 sdk (recommended 5.7 or newer, with WebEngine and QJSEngine) +* QT5 or QT6 sdk [NEW] It is now possible to use a VirtualBox VM as a portable development environment for Huggle. [ยป Wiki page](https://github.com/huggle/huggle3-qt-lx/wiki/Portable-development-environment) diff --git a/configure b/configure index 9462326f4..faf56606b 100755 --- a/configure +++ b/configure @@ -38,6 +38,8 @@ CMAKE_ARGS='' _BUILD=0 _Q=0 QTPATH='' +WEBENG=0 +QTVERSION=5 USEDEBUG=0 HAS_PREFIX=0 PREFIX="" @@ -55,6 +57,7 @@ do echo " --debug: build a debuggable huggle" echo " --disable-dependency-tracking: skip all package checks" echo " --extension: will build all extensions as well" + echo " --qt6: use qt6 instead of qt5" echo " --qtpath: path to Qt (for example C:\\Qt\\5.4\\mingw\\" echo " --folder : change the default build folder" echo " --no-audio: don't build huggle with audio engine" @@ -115,6 +118,7 @@ do exit 0 fi if [ "$var" = "--web-engine" ];then + WEBENG=1 CMAKE_ARGS="$CMAKE_ARGS -DWEB_ENGINE=true" continue fi @@ -134,6 +138,12 @@ do CMAKE_ARGS="$CMAKE_ARGS -DHUGGLE_TEST=true" continue fi + if [ "$var" = "--qt6" ];then + QTVERSION=6 + WEBENG=1 + CMAKE_ARGS="$CMAKE_ARGS -DQT6_BUILD=true -DWEB_ENGINE=true" + continue + fi done ok() diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index af43c8451..5ef0b27a5 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -28,7 +28,7 @@ option(WEB_ENGINE "Use Qt WebEngine instead of WebKit library" false) option(AUDIO "Enable audio backend" true) if (QT6_BUILD) - set (QT5_BUILD true) + set (QT5_BUILD false) add_definitions( -DQT6_BUILD ) endif() @@ -50,13 +50,17 @@ if (LINUX_SNAP) add_definitions(-DHUGGLE_SNAP) endif() -# Enable c++11 +# Enable c++11 or c++17 in case of Qt6 if(WIN32) if(MINGW) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mwindows -std=c++11") endif() else() - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") + if (QT6_BUILD) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17") + else() + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") + endif() endif() # This will ensure that produced binaries go to right place on windows