Skip to content

Commit

Permalink
Require Qt 6.3 as minimum (ezEngine#1016)
Browse files Browse the repository at this point in the history
Qt 6.3 contains a important bug fix for the 3D view port of the Editor on Linux. With this bug fix the editor 3d view port finally fully works and does so without requiring shared textures.
  • Loading branch information
Ingrater authored Jul 23, 2023
1 parent 3c90cba commit 6636967
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 10 deletions.
4 changes: 2 additions & 2 deletions Code/BuildSystem/AzurePipelines/Linux-x64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ jobs:
targetType: inline
script: |
sudo apt-get update
sudo apt-get install -y cmake uuid-dev gcc-12 g++-12 libx11-dev build-essential qt6-base-dev libqt6svg6-dev qt6-base-private-dev libxrandr-dev libxinerama-dev libxcursor-dev libxi-dev xvfb lightdm libtinfo5 vulkan-tools
sudo apt-get install -y cmake uuid-dev gcc-12 g++-12 libx11-dev build-essential libxrandr-dev libxinerama-dev libxcursor-dev libxi-dev xvfb lightdm libtinfo5 vulkan-tools
# sudo add-apt-repository ppa:kisak/kisak-mesa -y
# sudo apt-get install -y mesa-vulkan-drivers libgl1-mesa-dev
- task: Bash@3
Expand All @@ -73,7 +73,7 @@ jobs:
- task: CMake@1
displayName: CMake
inputs:
cmakeArgs: -DCMAKE_BUILD_TYPE=Dev -DCMAKE_CXX_COMPILER=g++-12 -DCMAKE_C_COMPILER=gcc-12 -DEZ_ENABLE_FOLDER_UNITY_FILES=$(unityfiles) -DEZ_BUILD_EXPERIMENTAL_VULKAN=ON -DEZ_EXPERIMENTAL_EDITOR_ON_LINUX=ON -G "Unix Makefiles" ../
cmakeArgs: -DCMAKE_BUILD_TYPE=Dev -DCMAKE_CXX_COMPILER=g++-12 -DCMAKE_C_COMPILER=gcc-12 -DEZ_QT_DIR=/opt/qt/6.4.3/gcc_64 -DEZ_ENABLE_FOLDER_UNITY_FILES=$(unityfiles) -DEZ_BUILD_EXPERIMENTAL_VULKAN=ON -DEZ_EXPERIMENTAL_EDITOR_ON_LINUX=ON -G "Unix Makefiles" ../
- task: Bash@3
displayName: Make
inputs:
Expand Down
10 changes: 8 additions & 2 deletions Code/BuildSystem/CMake/CMakeUtils/ezUtilsQt.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,19 @@ macro(ez_find_qt)
Svg
)

# ezEngine requires at least Qt 6.3 because earlier versions have a bug which prevents the 3d viewport in the
# Editor from working correctly.
SET(EZ_REQUIRED_QT_VERSION "6.3")

if(EZ_ENABLE_QT_SUPPORT)
if(EZ_QT_DIR)
find_package(Qt6 COMPONENTS ${EZ_QT_COMPONENTS} REQUIRED PATHS ${EZ_QT_DIR})
find_package(Qt6 ${EZ_REQUIRED_QT_VERSION} COMPONENTS ${EZ_QT_COMPONENTS} REQUIRED PATHS ${EZ_QT_DIR})
else()
find_package(Qt6 COMPONENTS ${EZ_QT_COMPONENTS} REQUIRED)
find_package(Qt6 ${EZ_REQUIRED_QT_VERSION} COMPONENTS ${EZ_QT_COMPONENTS} REQUIRED)
endif()
endif()

message(STATUS "Found Qt6 Version ${Qt6_VERSION} in ${Qt6_DIR}")

mark_as_advanced(FORCE Qt6_DIR)
mark_as_advanced(FORCE Qt6Core_DIR)
Expand Down
37 changes: 32 additions & 5 deletions RunCMake.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# read arguments
opts=$(getopt \
--longoptions help,clang,setup,no-cmake,build-type: \
--longoptions help,clang,setup,no-cmake,no-unity,build-type: \
--name "$(basename "$0")" \
--options "" \
-- "$@"
Expand All @@ -12,16 +12,18 @@ eval set --$opts

RunCMake=true
BuildType="Dev"
NoUnity=""


while [[ $# -gt 0 ]]; do
case "$1" in
--help)
echo "Usage: $(basename $0) [--setup] [--clang] [--no-cmake] [--build-type Debug|Dev|Shipping]"
echo "Usage: $(basename $0) [--setup] [--clang] [--no-cmake] [--build-type Debug|Dev|Shipping] [--no-unity]"
echo " --setup Run first time setup. This installs dependencies and makes sure the git repository is setup correctly."
echo " --clang Use clang instead of gcc"
echo " --no-cmake Do not invoke cmake (usefull when only --setup is needed)"
echo " --build-type Which build type cmake should be invoked with Debug|Dev|Shipping"
echo " --no-unity Disable unity builds. This might help to improve code completion in various editors"
exit 0
;;

Expand All @@ -40,10 +42,16 @@ while [[ $# -gt 0 ]]; do
shift 1
;;

--no-unity)
NoUnity="-DEZ_ENABLE_FOLDER_UNITY_FILES=OFF"
shift 1
;;

--build-type)
BuildType=$2
shift 2
;;


*)
break
Expand Down Expand Up @@ -74,8 +82,17 @@ elif [[ $Issue =~ $MintPattern ]]; then
Version=${BASH_REMATCH[1]}
fi

if [ "$Distribution" = "Ubuntu" -a "$Version" = "22" ] || [ "$Distribution" = "Mint" -a "$Version" = "21" ] ; then
packages=(cmake build-essential ninja-build qt6-base-dev libqt6svg6-dev qt6-base-private-dev libxrandr-dev libxinerama-dev libxcursor-dev libxi-dev uuid-dev mold libfreetype-dev libtinfo5)
# This requires a 'sort' that supports '-V'
verlte() {
[ "$1" = "`echo -e "$1\n$2" | sort -V | head -n1`" ]
}

verlt() {
[ "$1" = "$2" ] && return 1 || verlte $1 $2
}

if [ "$Distribution" = "Ubuntu" -a "$Version" = "22" ] || [ "$Distribution" = "Mint" -a "$Version" = "21" ]; then
packages=(cmake build-essential ninja-build libxrandr-dev libxinerama-dev libxcursor-dev libxi-dev uuid-dev mold libfreetype-dev libtinfo5)

if [ "$UseClang" = true ]; then
packages+=(clang-14 libstdc++-12-dev)
Expand All @@ -95,6 +112,16 @@ else
fi

if [ "$Setup" = true ]; then
qtVer=$(apt list qt6-base-dev 2>/dev/null | grep -o "6\.[0-9]*\.[0-9]")
echo $qtVer

if verlt $qtVer "6.3.0"; then
>&2 echo -e "\033[0;33mYour distributions package manager does not provide Qt 6.3.0 or newer. Please install Qt manually."
>&2 echo -e "See https://ezengine.net/pages/docs/build/build-linux.html#automatic-setup for details.\033[0m"
else
packages+=(qt6-base-dev libqt6svg6-dev qt6-base-private-dev)
fi

git submodule update --init
echo "Attempting to install the following packages through the package manager:"
echo ${packages[@]}
Expand All @@ -108,6 +135,6 @@ fi

if [ "$RunCMake" = true ]; then
BuildDir="build-${BuildType}-${CompilerShort}"
cmake -B $BuildDir -S . -G Ninja -DCMAKE_CXX_COMPILER=$cxx_compiler -DCMAKE_C_COMPILER=$c_compiler -DEZ_EXPERIMENTAL_EDITOR_ON_LINUX=ON -DEZ_BUILD_EXPERIMENTAL_VULKAN=ON -DCMAKE_BUILD_TYPE=$BuildType -DCMAKE_EXPORT_COMPILE_COMMANDS=ON
cmake -B $BuildDir -S . -G Ninja -DCMAKE_CXX_COMPILER=$cxx_compiler -DCMAKE_C_COMPILER=$c_compiler -DEZ_EXPERIMENTAL_EDITOR_ON_LINUX=ON -DEZ_BUILD_EXPERIMENTAL_VULKAN=ON -DCMAKE_BUILD_TYPE=$BuildType -DCMAKE_EXPORT_COMPILE_COMMANDS=ON $NoUnity && \
echo -e "\nRun 'ninja -C ${BuildDir}' to build"
fi
2 changes: 1 addition & 1 deletion gitClean.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
Change this file to force a clean build on CI.
Increase me: 11
Increase me: 12

0 comments on commit 6636967

Please sign in to comment.