Skip to content

Commit

Permalink
updated linux build scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
benapetr committed Jul 19, 2024
1 parent 216b394 commit bd22779
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
10 changes: 10 additions & 0 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ CMAKE_ARGS=''
_BUILD=0
_Q=0
QTPATH=''
WEBENG=0
QTVERSION=5
USEDEBUG=0
HAS_PREFIX=0
PREFIX=""
Expand All @@ -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 <folder>: change the default build folder"
echo " --no-audio: don't build huggle with audio engine"
Expand Down Expand Up @@ -115,6 +118,7 @@ do
exit 0
fi
if [ "$var" = "--web-engine" ];then
WEBENG=1
CMAKE_ARGS="$CMAKE_ARGS -DWEB_ENGINE=true"
continue
fi
Expand All @@ -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()
Expand Down
10 changes: 7 additions & 3 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand All @@ -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
Expand Down

0 comments on commit bd22779

Please sign in to comment.