Skip to content

Run Windows Qt 5 and Qt 6 separately and build a static library in CI - #546

Merged
paceholder merged 2 commits into
masterfrom
ci/windows-static-build
Nov 22, 2026
Merged

paceholder merged 2 commits into
masterfrom
ci/windows-static-build

Conversation

@paceholder

Copy link
Copy Markdown
Owner

Type of change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation/refactoring (CI only)

Description

Two changes to .github/workflows/cmake_build.yml, one commit each.

  1. Run the Windows Qt 5 and Qt 6 jobs separately. Both entries used the toolchain name windows-msvc. GitHub merges include entries with the same name, and the later one overwrites the earlier one. The last run on master has only three jobs (windows-msvc, macos-clang, linux-gcc), so Windows with Qt 5.15.2 was never built. The jobs are now windows-msvc-qt5 and windows-msvc-qt6.
  2. Build the static library on Windows. A new job windows-msvc-static uses Qt 6.9.2 and -DBUILD_SHARED_LIBS=OFF. No job built a static library before, and the Windows linker error in MSVC linker issue when using static version of a library #256 only showed up with it. The job builds and runs the tests. The examples are off, because the tests already link the library with NODE_EDITOR_STATIC. This saves build time. There is no Qt 5 static job for the same reason.

Other jobs get the same flags as before (BUILD_SHARED_LIBS=ON, BUILD_EXAMPLES=ON by default).

Testing

  • Not run on Windows. The first CI run of this PR is the test. The YAML parses and the matrix lists five jobs.
  • Qt version tested: none locally. I built the static library and the tests on macOS (Qt 6.12) with BUILD_SHARED_LIBS=OFF: 716 assertions pass.
  • Existing tests still pass (CI)
  • Added tests for new functionality (not applicable)

What could fail on the first run: the Windows Qt 5 job has not run for a long time, so it may show an old problem. The static job may show a multiple-definition error, or lose Qt resources (icons, default style) in the static library. If a failure needs a CMake change, that is a separate decision.

Breaking changes?

No library change. The job names change: windows-msvc becomes windows-msvc-qt5 and windows-msvc-qt6. master has no required status checks, so no check names break.

Related issue

Related to #256 (closed).

The calculator example failed with C3493: 'outPortIndex' was not captured
by a lambda. The custom painter example failed with C2065: 'M_PI' is
undeclared. Capture the variable and use a local pi constant.
Both Windows matrix entries had the same name, so the Qt 5 job never ran.
Give each entry its own name.

Add a job that builds the static library on Windows. It builds the tests
only, with examples off, and uses Qt 6.9.2.
@paceholder
paceholder force-pushed the ci/windows-static-build branch from 6823e08 to 8d93fff Compare November 22, 2026 21:01
@paceholder
paceholder merged commit 0eebcf3 into master Nov 22, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant