From 9b00a851ae1d19d4e042363b21adf15f1f06daa5 Mon Sep 17 00:00:00 2001 From: Taylor Richards Date: Sat, 4 Jul 2026 23:13:47 -0400 Subject: [PATCH 01/10] enable QtFRED by default Note that Win32 is not supported by Qt6 and so QtFRED is forcibly disabled on 32-bit Windows. --- .github/workflows/build-nightly.yaml | 2 -- .github/workflows/build-release.yaml | 2 -- .github/workflows/build-test.yaml | 2 -- .github/workflows/cache-master.yaml | 2 -- .github/workflows/test-pull_request.yaml | 2 -- .github/workflows/weekly-coverity-scan.yaml | 1 - CMakeLists.txt | 6 +++++- ci/linux/configure_cmake.sh | 6 +++++- 8 files changed, 10 insertions(+), 13 deletions(-) diff --git a/.github/workflows/build-nightly.yaml b/.github/workflows/build-nightly.yaml index 11bd8ea1b86..080b73708a8 100644 --- a/.github/workflows/build-nightly.yaml +++ b/.github/workflows/build-nightly.yaml @@ -31,7 +31,6 @@ jobs: env: CONFIGURATION: ${{ matrix.configuration }} COMPILER: gcc-9 - ENABLE_QTFRED: OFF run: $GITHUB_WORKSPACE/ci/linux/configure_cmake.sh - name: Compile working-directory: ./build @@ -260,7 +259,6 @@ jobs: COMPILER: ${{ matrix.compiler }} ARCHITECTURE: ${{ matrix.arch }} JOB_CMAKE_OPTIONS: ${{ matrix.cmake_options }} - ENABLE_QTFRED: OFF run: $GITHUB_WORKSPACE/ci/linux/configure_cmake.sh - name: Compile working-directory: ./build diff --git a/.github/workflows/build-release.yaml b/.github/workflows/build-release.yaml index 4673e83d04b..90644d68e9e 100644 --- a/.github/workflows/build-release.yaml +++ b/.github/workflows/build-release.yaml @@ -62,7 +62,6 @@ jobs: env: CONFIGURATION: ${{ matrix.configuration }} COMPILER: gcc-9 - ENABLE_QTFRED: OFF run: $GITHUB_WORKSPACE/ci/linux/configure_cmake.sh - name: Compile working-directory: ./build @@ -332,7 +331,6 @@ jobs: COMPILER: ${{ matrix.compiler }} ARCHITECTURE: ${{ matrix.arch }} JOB_CMAKE_OPTIONS: ${{ matrix.cmake_options }} - ENABLE_QTFRED: OFF run: $GITHUB_WORKSPACE/ci/linux/configure_cmake.sh - name: Compile working-directory: ./build diff --git a/.github/workflows/build-test.yaml b/.github/workflows/build-test.yaml index 51c8046d1f3..c9314df7e07 100644 --- a/.github/workflows/build-test.yaml +++ b/.github/workflows/build-test.yaml @@ -37,7 +37,6 @@ jobs: env: CONFIGURATION: ${{ matrix.configuration }} COMPILER: gcc-9 - ENABLE_QTFRED: OFF run: $GITHUB_WORKSPACE/ci/linux/configure_cmake.sh - name: Compile working-directory: ./build @@ -273,7 +272,6 @@ jobs: CONFIGURATION: ${{ matrix.configuration }} COMPILER: ${{ matrix.compiler }} ARCHITECTURE: ${{ matrix.arch }} - ENABLE_QTFRED: OFF run: $GITHUB_WORKSPACE/ci/linux/configure_cmake.sh - name: Compile working-directory: ./build diff --git a/.github/workflows/cache-master.yaml b/.github/workflows/cache-master.yaml index 3ae04ad9298..e26b2126b64 100644 --- a/.github/workflows/cache-master.yaml +++ b/.github/workflows/cache-master.yaml @@ -46,7 +46,6 @@ jobs: COMPILER: ${{ matrix.compiler }} JOB_CMAKE_OPTIONS: ${{ matrix.cmake_options }} CCACHE_PATH: /usr/local/bin/ccache - ENABLE_QTFRED: OFF run: $GITHUB_WORKSPACE/ci/linux/configure_cmake.sh - name: Compile working-directory: ./build @@ -87,7 +86,6 @@ jobs: COMPILER: ${{ matrix.compiler }} JOB_CMAKE_OPTIONS: ${{ matrix.cmake_options }} CCACHE_PATH: /usr/local/bin/ccache - ENABLE_QTFRED: OFF run: $GITHUB_WORKSPACE/ci/linux/configure_cmake.sh - name: Compile working-directory: ./build diff --git a/.github/workflows/test-pull_request.yaml b/.github/workflows/test-pull_request.yaml index 59db321a697..bf1945b9049 100644 --- a/.github/workflows/test-pull_request.yaml +++ b/.github/workflows/test-pull_request.yaml @@ -49,7 +49,6 @@ jobs: COMPILER: ${{ matrix.compiler }} JOB_CMAKE_OPTIONS: ${{ matrix.cmake_options }} CCACHE_PATH: /usr/local/bin/ccache - ENABLE_QTFRED: OFF run: $GITHUB_WORKSPACE/ci/linux/configure_cmake.sh - name: Compile working-directory: ./build @@ -165,7 +164,6 @@ jobs: ARCHITECTURE: ${{ matrix.arch }} JOB_CMAKE_OPTIONS: ${{ matrix.cmake_options }} CCACHE_PATH: /usr/local/bin/ccache - ENABLE_QTFRED: OFF run: $GITHUB_WORKSPACE/ci/linux/configure_cmake.sh - name: Compile working-directory: ./build diff --git a/.github/workflows/weekly-coverity-scan.yaml b/.github/workflows/weekly-coverity-scan.yaml index 8cb44174d85..aacec3c3927 100644 --- a/.github/workflows/weekly-coverity-scan.yaml +++ b/.github/workflows/weekly-coverity-scan.yaml @@ -51,7 +51,6 @@ jobs: env: CONFIGURATION: Release COMPILER: gcc-9 - ENABLE_QTFRED: OFF run: $GITHUB_WORKSPACE/ci/linux/configure_cmake.sh - name: Build FSO with Coverity Wrapper diff --git a/CMakeLists.txt b/CMakeLists.txt index 36c9ab9bdc7..de1f36806df 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -94,7 +94,11 @@ OPTION(FSO_BUILD_TESTS "Build unit tests" OFF) OPTION(FSO_DEVELOPMENT_MODE "Generate binaries in development mode, only use if you know what you're doing!" OFF) -OPTION(FSO_BUILD_QTFRED "Build qtFRED2 binary" OFF) +if(WIN32 AND CMAKE_SIZEOF_VOID_P EQUAL 4) + set(FSO_BUILD_QTFRED OFF CACHE INTERNAL "" FORCE) +else() + OPTION(FSO_BUILD_QTFRED "Build qtFRED2 binary" ON) +endif() IF(WIN32 OR APPLE) # On windows and mac the default should be to always build the included libraries diff --git a/ci/linux/configure_cmake.sh b/ci/linux/configure_cmake.sh index fe93189fe0d..2997befa140 100755 --- a/ci/linux/configure_cmake.sh +++ b/ci/linux/configure_cmake.sh @@ -41,6 +41,10 @@ if [ ! "$CCACHE_PATH" = "" ]; then fi fi +if [ -n "${ENABLE_QTFRED:-}" ]; then + CMAKE_OPTIONS="$CMAKE_OPTIONS -DFSO_BUILD_QTFRED=${ENABLE_QTFRED}" +fi + mkdir build cd build @@ -58,4 +62,4 @@ fi cmake -G Ninja -DFSO_FATAL_WARNINGS=ON -DCMAKE_EXPORT_COMPILE_COMMANDS=ON $CMAKE_OPTIONS $PLATFORM_CMAKE_OPTIONS \ -DCMAKE_INSTALL_PREFIX="$(pwd)/install" -DCMAKE_BUILD_TYPE=$CONFIGURATION \ -DFFMPEG_USE_PRECOMPILED=ON -DFSO_BUILD_TESTS=ON -DFSO_BUILD_INCLUDED_LIBS=ON \ - -DFSO_BUILD_QTFRED=${ENABLE_QTFRED:-OFF} -DCMAKE_JOB_POOLS=link=1 -DCMAKE_JOB_POOL_LINK=link .. + -DCMAKE_JOB_POOLS=link=1 -DCMAKE_JOB_POOL_LINK=link .. From 99b7368863d1256770449ef6ca1b1503db67089b Mon Sep 17 00:00:00 2001 From: Taylor Richards Date: Sat, 4 Jul 2026 23:16:40 -0400 Subject: [PATCH 02/10] update prebuilt ref to Qt6 version --- lib/prebuilt.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/prebuilt.cmake b/lib/prebuilt.cmake index c97d3ef95be..c8872f024d5 100644 --- a/lib/prebuilt.cmake +++ b/lib/prebuilt.cmake @@ -1,5 +1,5 @@ -set(PREBUILT_VERSION_NAME "21d0b52") +set(PREBUILT_VERSION_NAME "ff66793d") set(FSO_PREBUILT_OVERRIDE "" CACHE PATH "Path to the prebuilt binaries, if empty the binaries will be downloaded.") set(PREBUILT_LIB_DIR "${CMAKE_CURRENT_BINARY_DIR}/prebuilt") From e45842061293694019935d386981fb19ca37176e Mon Sep 17 00:00:00 2001 From: Taylor Richards Date: Sat, 4 Jul 2026 23:28:50 -0400 Subject: [PATCH 03/10] use prebuilt Qt libs for CI --- .github/workflows/build-nightly.yaml | 3 ++- .github/workflows/build-release.yaml | 3 ++- .github/workflows/build-test.yaml | 3 ++- .github/workflows/test-pull_request.yaml | 4 ++-- ci/linux/configure_cmake.sh | 2 +- 5 files changed, 9 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build-nightly.yaml b/.github/workflows/build-nightly.yaml index 080b73708a8..5e8a52c0ec1 100644 --- a/.github/workflows/build-nightly.yaml +++ b/.github/workflows/build-nightly.yaml @@ -138,7 +138,8 @@ jobs: cmake -DCMAKE_INSTALL_PREFIX="$(pwd)/install" -DFSO_USE_SPEECH=ON \ -DFSO_USE_VOICEREC=ON -DFORCED_SIMD_INSTRUCTIONS="$SIMD" \ -DFSO_BUILD_TESTS=ON -DFSO_INSTALL_DEBUG_FILES=ON -A "$ARCHITECTURE" \ - -G "Visual Studio 17 2022" -T "v143" -DCMAKE_BUILD_TYPE=$CONFIGURATION .. + -DQT_USE_PRECOMPILED=ON -G "Visual Studio 17 2022" -T "v143" \ + -DCMAKE_BUILD_TYPE=$CONFIGURATION .. - name: Compile working-directory: ./build env: diff --git a/.github/workflows/build-release.yaml b/.github/workflows/build-release.yaml index 90644d68e9e..8309bda26ce 100644 --- a/.github/workflows/build-release.yaml +++ b/.github/workflows/build-release.yaml @@ -193,7 +193,8 @@ jobs: cmake -DCMAKE_INSTALL_PREFIX="$(pwd)/install" -DFSO_USE_SPEECH=ON \ -DFSO_USE_VOICEREC=ON -DFORCED_SIMD_INSTRUCTIONS="$SIMD" \ -DFSO_BUILD_TESTS=ON -DFSO_INSTALL_DEBUG_FILES=ON -A "$ARCHITECTURE" \ - -G "Visual Studio 17 2022" -T "v143" -DCMAKE_BUILD_TYPE=$CONFIGURATION .. + -DQT_USE_PRECOMPILED=ON -G "Visual Studio 17 2022" -T "v143" \ + -DCMAKE_BUILD_TYPE=$CONFIGURATION .. - name: Compile working-directory: ./build env: diff --git a/.github/workflows/build-test.yaml b/.github/workflows/build-test.yaml index c9314df7e07..6c67a9aae82 100644 --- a/.github/workflows/build-test.yaml +++ b/.github/workflows/build-test.yaml @@ -151,7 +151,8 @@ jobs: cmake -DCMAKE_INSTALL_PREFIX="$(pwd)/install" -DFSO_USE_SPEECH=ON \ -DFSO_USE_VOICEREC=ON -DFORCED_SIMD_INSTRUCTIONS="$SIMD" \ -DFSO_BUILD_TESTS=ON -DFSO_INSTALL_DEBUG_FILES=ON -A "$ARCHITECTURE" \ - -G "Visual Studio 17 2022" -T "v143" -DCMAKE_BUILD_TYPE=$CONFIGURATION .. + -DQT_USE_PRECOMPILED=ON -G "Visual Studio 17 2022" -T "v143" \ + -DCMAKE_BUILD_TYPE=$CONFIGURATION .. - name: Compile working-directory: ./build env: diff --git a/.github/workflows/test-pull_request.yaml b/.github/workflows/test-pull_request.yaml index bf1945b9049..ecf853dc6cf 100644 --- a/.github/workflows/test-pull_request.yaml +++ b/.github/workflows/test-pull_request.yaml @@ -101,11 +101,11 @@ jobs: if [ "$COMPILER" = "MinGW" ]; then cmake -DFSO_USE_SPEECH=OFF -DFSO_FATAL_WARNINGS=ON -DFSO_USE_VOICEREC=OFF -DFSO_BUILD_TESTS=ON \ - -DFSO_BUILD_FRED2=OFF -DCMAKE_BUILD_TYPE=$CONFIGURATION -G "Ninja" .. + -DFSO_BUILD_FRED2=OFF -DQT_USE_PRECOMPILED=ON -DCMAKE_BUILD_TYPE=$CONFIGURATION -G "Ninja" .. else cmake -DFSO_USE_SPEECH=ON -DFSO_FATAL_WARNINGS=ON -DFSO_USE_VOICEREC=OFF -DFSO_BUILD_TESTS=ON \ -DFORCED_SIMD_INSTRUCTIONS=SSE2 -G "Visual Studio 17 2022" -T "v143" -A "$ARCHITECTURE" \ - -DCMAKE_BUILD_TYPE=$CONFIGURATION .. + -DQT_USE_PRECOMPILED=ON -DCMAKE_BUILD_TYPE=$CONFIGURATION .. fi - name: Compile working-directory: ./build diff --git a/ci/linux/configure_cmake.sh b/ci/linux/configure_cmake.sh index 2997befa140..4d1a41e4791 100755 --- a/ci/linux/configure_cmake.sh +++ b/ci/linux/configure_cmake.sh @@ -60,6 +60,6 @@ fi # we have some build rules that do not play nice with parallel invocation and that fixes these issues cmake -G Ninja -DFSO_FATAL_WARNINGS=ON -DCMAKE_EXPORT_COMPILE_COMMANDS=ON $CMAKE_OPTIONS $PLATFORM_CMAKE_OPTIONS \ - -DCMAKE_INSTALL_PREFIX="$(pwd)/install" -DCMAKE_BUILD_TYPE=$CONFIGURATION \ + -DCMAKE_INSTALL_PREFIX="$(pwd)/install" -DCMAKE_BUILD_TYPE=$CONFIGURATION -DQT_USE_PRECOMPILED=ON \ -DFFMPEG_USE_PRECOMPILED=ON -DFSO_BUILD_TESTS=ON -DFSO_BUILD_INCLUDED_LIBS=ON \ -DCMAKE_JOB_POOLS=link=1 -DCMAKE_JOB_POOL_LINK=link .. From acba81535db8f9a9b286d374b730a6ea5178ca13 Mon Sep 17 00:00:00 2001 From: Taylor Richards Date: Sun, 5 Jul 2026 00:24:14 -0400 Subject: [PATCH 04/10] fix prebuilt issue when used outside of /lib --- lib/prebuilt.cmake | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/lib/prebuilt.cmake b/lib/prebuilt.cmake index c8872f024d5..bbb077b25b3 100644 --- a/lib/prebuilt.cmake +++ b/lib/prebuilt.cmake @@ -1,9 +1,12 @@ -set(PREBUILT_VERSION_NAME "ff66793d") +# NOTE: These variables must be cached to allow QtFRED to use Qt6 prebuilt libs +# without setting Qt6 up project wide + +set(PREBUILT_VERSION_NAME "ff66793d" CACHE INTERNAL "") set(FSO_PREBUILT_OVERRIDE "" CACHE PATH "Path to the prebuilt binaries, if empty the binaries will be downloaded.") -set(PREBUILT_LIB_DIR "${CMAKE_CURRENT_BINARY_DIR}/prebuilt") -set(CURRENT_ROOT "${CMAKE_CURRENT_BINARY_DIR}") +set(PREBUILT_LIB_DIR "${CMAKE_CURRENT_BINARY_DIR}/prebuilt" CACHE INTERNAL "") +set(CURRENT_ROOT "${CMAKE_CURRENT_BINARY_DIR}" CACHE INTERNAL "") function(get_prebuilt_path OUT_VAR) if (NOT "${FSO_PREBUILT_OVERRIDE}" STREQUAL "" AND IS_DIRECTORY "${FSO_PREBUILT_OVERRIDE}") From 192b4ebe55d25b8237215629f3c80c3cef1a9cb6 Mon Sep 17 00:00:00 2001 From: Taylor Richards Date: Sun, 5 Jul 2026 01:12:43 -0400 Subject: [PATCH 05/10] bump prebuilt version --- lib/prebuilt.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/prebuilt.cmake b/lib/prebuilt.cmake index bbb077b25b3..94aae9ef0b0 100644 --- a/lib/prebuilt.cmake +++ b/lib/prebuilt.cmake @@ -2,7 +2,7 @@ # NOTE: These variables must be cached to allow QtFRED to use Qt6 prebuilt libs # without setting Qt6 up project wide -set(PREBUILT_VERSION_NAME "ff66793d" CACHE INTERNAL "") +set(PREBUILT_VERSION_NAME "62c89ef6" CACHE INTERNAL "") set(FSO_PREBUILT_OVERRIDE "" CACHE PATH "Path to the prebuilt binaries, if empty the binaries will be downloaded.") set(PREBUILT_LIB_DIR "${CMAKE_CURRENT_BINARY_DIR}/prebuilt" CACHE INTERNAL "") From 5d4577acae03f2f7a071868f2c2c17b2824726da Mon Sep 17 00:00:00 2001 From: Taylor Richards Date: Sun, 5 Jul 2026 14:46:14 -0400 Subject: [PATCH 06/10] add prebuilt fallback if system Qt not available --- qtfred/CMakeLists.txt | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/qtfred/CMakeLists.txt b/qtfred/CMakeLists.txt index 793729fa909..f365324817d 100644 --- a/qtfred/CMakeLists.txt +++ b/qtfred/CMakeLists.txt @@ -15,12 +15,12 @@ if(QT_USE_PRECOMPILED) else() SET(QT6_INSTALL_ROOT "" CACHE PATH "The path to the Qt6 installation root. May be necessary on windows if the standard find_package fails to find the Qt installation.") - message(STATUS "Using system Qt libraries. Don't distribute these FSO binaries if these are the GPL libraries/plugins!") endif() if(QT6_INSTALL_ROOT) list(PREPEND CMAKE_PREFIX_PATH "${QT6_INSTALL_ROOT}") endif() + # Must be set before find_package -- CMake snapshots this into each imported target's # MAP_IMPORTED_CONFIG_FASTDEBUG property at target-creation time, not at link time. # The list entries are tried in order: @@ -33,7 +33,20 @@ endif() # Qt5::uic configuration FastDebug". set(CMAKE_MAP_IMPORTED_CONFIG_FASTDEBUG Debug Release "") -find_package(Qt6 REQUIRED COMPONENTS Core Widgets OpenGL Help) +find_package(Qt6 COMPONENTS Core Widgets OpenGL Help) + +# fall back to precompiled version if system install not found +if (NOT Qt6_FOUND AND NOT QT_USE_PRECOMPILED) + message(STATUS "Qt6 libraries could not be found. Using prebuilt version...") + + get_prebuilt_path(PREBUILT_PATH) + list(PREPEND CMAKE_PREFIX_PATH "${PREBUILT_PATH}/Qt6") + + find_package(Qt6 REQUIRED COMPONENTS Core Widgets OpenGL Help) +else() + message(STATUS "Using system Qt libraries. Don't distribute these FSO binaries if these are the GPL libraries/plugins!") +endif() + include(source_groups.cmake) qt_standard_project_setup() add_compile_definitions(QT_DISABLE_DEPRECATED_UP_TO=0x050F00) From 7186c4d415ece193809324475d4625c8225857b6 Mon Sep 17 00:00:00 2001 From: Taylor Richards Date: Sun, 5 Jul 2026 15:34:02 -0400 Subject: [PATCH 07/10] set QtFRED option before toolchain is included --- CMakeLists.txt | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index de1f36806df..0b765474106 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -57,6 +57,13 @@ LIST(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/finder") LIST(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/external/rpavlik-cmake-modules") LIST(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/external/cotire") +# this must be set before include(toolchain) +if(WIN32 AND CMAKE_SIZEOF_VOID_P EQUAL 4) + set(FSO_BUILD_QTFRED OFF CACHE INTERNAL "" FORCE) +else() + OPTION(FSO_BUILD_QTFRED "Build qtFRED2 binary" ON) +endif() + INCLUDE(globals) INCLUDE(toolchain) include(embed_file) @@ -94,12 +101,6 @@ OPTION(FSO_BUILD_TESTS "Build unit tests" OFF) OPTION(FSO_DEVELOPMENT_MODE "Generate binaries in development mode, only use if you know what you're doing!" OFF) -if(WIN32 AND CMAKE_SIZEOF_VOID_P EQUAL 4) - set(FSO_BUILD_QTFRED OFF CACHE INTERNAL "" FORCE) -else() - OPTION(FSO_BUILD_QTFRED "Build qtFRED2 binary" ON) -endif() - IF(WIN32 OR APPLE) # On windows and mac the default should be to always build the included libraries SET(FSO_BUILD_INCLUDED_LIBS_DEFAULT ON) From ceb6cd89ef6b28e3c4c4a026ae5b81bc20020d51 Mon Sep 17 00:00:00 2001 From: Taylor Richards Date: Sun, 5 Jul 2026 16:42:36 -0400 Subject: [PATCH 08/10] fix lib fallback --- qtfred/CMakeLists.txt | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/qtfred/CMakeLists.txt b/qtfred/CMakeLists.txt index f365324817d..59ac509adf7 100644 --- a/qtfred/CMakeLists.txt +++ b/qtfred/CMakeLists.txt @@ -36,15 +36,19 @@ set(CMAKE_MAP_IMPORTED_CONFIG_FASTDEBUG Debug Release "") find_package(Qt6 COMPONENTS Core Widgets OpenGL Help) # fall back to precompiled version if system install not found -if (NOT Qt6_FOUND AND NOT QT_USE_PRECOMPILED) - message(STATUS "Qt6 libraries could not be found. Using prebuilt version...") +if(Qt6_FOUND AND NOT QT_USE_PRECOMPILED) + message(STATUS "Using system Qt libraries. Don't distribute these FSO binaries if these are the GPL libraries/plugins!") +elseif(NOT Qt6_FOUND) + if(NOT QT_USE_PRECOMPILED) + message(STATUS "Qt6 libraries could not be found. Using prebuilt version...") - get_prebuilt_path(PREBUILT_PATH) - list(PREPEND CMAKE_PREFIX_PATH "${PREBUILT_PATH}/Qt6") + get_prebuilt_path(PREBUILT_PATH) + list(PREPEND CMAKE_PREFIX_PATH "${PREBUILT_PATH}/Qt6") - find_package(Qt6 REQUIRED COMPONENTS Core Widgets OpenGL Help) -else() - message(STATUS "Using system Qt libraries. Don't distribute these FSO binaries if these are the GPL libraries/plugins!") + find_package(Qt6 REQUIRED COMPONENTS Core Widgets OpenGL Help) + else() + message(FATAL_ERROR "Required Qt6 libraries were not found!") + endif() endif() include(source_groups.cmake) From 8dfc27afbfad14a751335032a4de2ae0db462f19 Mon Sep 17 00:00:00 2001 From: Taylor Richards Date: Sun, 5 Jul 2026 17:39:33 -0400 Subject: [PATCH 09/10] fix compile error --- qtfred/src/ui/widgets/CampaignMissionGraph.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qtfred/src/ui/widgets/CampaignMissionGraph.h b/qtfred/src/ui/widgets/CampaignMissionGraph.h index 65740baa413..b49000a2d25 100644 --- a/qtfred/src/ui/widgets/CampaignMissionGraph.h +++ b/qtfred/src/ui/widgets/CampaignMissionGraph.h @@ -116,7 +116,7 @@ class CampaignMissionGraph final : public QGraphicsView { public: explicit CampaignMissionGraph(QWidget* parent = nullptr); - bool eventFilter(QObject* watched, QEvent* event); + bool eventFilter(QObject* watched, QEvent* event) override; // Hook up the working campaign data void setModel(fso::fred::dialogs::CampaignEditorDialogModel* model); From ffd6a0ac7fe4ecbd73815ecaec61f692ae73be95 Mon Sep 17 00:00:00 2001 From: Taylor Richards Date: Mon, 6 Jul 2026 10:54:11 -0400 Subject: [PATCH 10/10] address standard c++ lib issues Disable static libstdc++/libc++ by default now that we've moved to using a base of Ubuntu 22.04. Using a static c++ library also poses a possible issue with our prebuilt Qt6 libs since they are dynamically linked. Disable automatic use of libc++ when static c++ library is enabled. The options can and should be used independently. Disable using libc++ for clang by default since it conflicts with the prebuilt Qt6 libs as well as the system Qt6 libs on most Linux distros. An message has been added to QtFRED config to error/warn if this is likely to be a problem. --- ci/linux/configure_cmake.sh | 13 ++++++++++--- cmake/toolchain-clang.cmake | 1 - qtfred/CMakeLists.txt | 9 +++++++++ 3 files changed, 19 insertions(+), 4 deletions(-) diff --git a/ci/linux/configure_cmake.sh b/ci/linux/configure_cmake.sh index 4d1a41e4791..a2791236908 100755 --- a/ci/linux/configure_cmake.sh +++ b/ci/linux/configure_cmake.sh @@ -23,13 +23,20 @@ if [ "$RUNNER_OS" = "macOS" ]; then CCACHE_PATH="$(brew --prefix)/bin/ccache" fi else - PLATFORM_CMAKE_OPTIONS="-DFSO_BUILD_APPIMAGE=ON -DFORCED_SIMD_INSTRUCTIONS=SSE2 -DUSE_STATIC_LIBCXX=ON" + PLATFORM_CMAKE_OPTIONS="-DFSO_BUILD_APPIMAGE=ON -DFORCED_SIMD_INSTRUCTIONS=SSE2" + + # Optionally use static libstdc++/libc++ on Linux, but default to off + # (Issue #5571 enabled it as a fix for 20.04 compatibility, but we've moved to 22.04) + PLATFORM_CMAKE_OPTIONS="$PLATFORM_CMAKE_OPTIONS -DUSE_STATIC_LIBCXX=${USE_STATIC_LIBCXX:-OFF}" fi CMAKE_OPTIONS="$JOB_CMAKE_OPTIONS" if [[ "$COMPILER" =~ ^clang.*$ ]]; then - CMAKE_OPTIONS="$CMAKE_OPTIONS -DCLANG_USE_LIBCXX=ON" - # force clang to silently allow -static-libstdc++ flag + # Default to allowing system standard c++ library be used. On Linux, which + # typically uses libstdc++ by default, using libc++ causes a conflict with + # Qt6 libs. So an error/warning is in place to catch that case when QtFRED + # is enabled. + CMAKE_OPTIONS="$CMAKE_OPTIONS -DCLANG_USE_LIBCXX=${CLANG_USE_LIBCXX:-OFF}" fi if [ ! "$CCACHE_PATH" = "" ]; then diff --git a/cmake/toolchain-clang.cmake b/cmake/toolchain-clang.cmake index a9475be7721..63fe41836ba 100644 --- a/cmake/toolchain-clang.cmake +++ b/cmake/toolchain-clang.cmake @@ -43,7 +43,6 @@ endif() if (USE_STATIC_LIBCXX) set(CXX_BASE_FLAGS "${CXX_BASE_FLAGS} -static-libstdc++ -Qunused-arguments") - set(CLANG_USE_LIBCXX ON) endif() # For C and C++, the values can be overwritten independently diff --git a/qtfred/CMakeLists.txt b/qtfred/CMakeLists.txt index 59ac509adf7..77d8ed5d471 100644 --- a/qtfred/CMakeLists.txt +++ b/qtfred/CMakeLists.txt @@ -42,6 +42,7 @@ elseif(NOT Qt6_FOUND) if(NOT QT_USE_PRECOMPILED) message(STATUS "Qt6 libraries could not be found. Using prebuilt version...") + set(QT_USE_PRECOMPILED ON) get_prebuilt_path(PREBUILT_PATH) list(PREPEND CMAKE_PREFIX_PATH "${PREBUILT_PATH}/Qt6") @@ -51,6 +52,14 @@ elseif(NOT Qt6_FOUND) endif() endif() +if(CLANG_USE_LIBCXX AND NOT APPLE) + if(QT_USE_PRECOMPILED) + message(FATAL_ERROR "Prebuilt Qt6 libraries are not compatible with clang's libc++!") + else() + mesage(WARNING "Clang's libc++ enabled, QtFRED may not link properly!") + endif() +endif() + include(source_groups.cmake) qt_standard_project_setup() add_compile_definitions(QT_DISABLE_DEPRECATED_UP_TO=0x050F00)