Skip to content

Commit 3d41378

Browse files
committed
Improve build commands for Windows
* Remove surplus backtick * Add `-DWINDOWS_RESOURCES_ENABLED=OFF` * Add commands to invoke actual build * Enable Qt Quick GUI as these commands are mainly meant for development where testing the build of the Qt Quick GUI is generally a good idea as well
1 parent c70b5a5 commit 3d41378

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

README.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -465,16 +465,21 @@ various additional environment variables to be set and you need to install depen
465465
vcpkg install boost-system:x64-windows-static boost-iostreams:x64-windows-static boost-filesystem:x64-windows-static boost-hana:x64-windows-static boost-process:x64-windows-static boost-asio:x64-windows-static libiconv:x64-windows-static zlib:x64-windows-static openssl:x64-windows-static cppunit:x64-windows-static libarchive'[bzip2,crypto,zstd]':x64-windows-static
466466
```
467467

468+
If the compilation of the resource file doesn't work you can use `-DWINDOWS_RESOURCES_ENABLED=OFF` to
469+
continue the build regardless like in the examples below.
470+
468471
When building with MSVC, do *not* use any of the MSYS2 shells. The environment of those shells leads to
469472
build problems. You can however use CMake and Ninja from MSYS2's mingw-w64 packaging (instead of the CMake
470473
version from Qt's installer). Then you need to specify the Ninja executable manually so the CMake invocation
471474
would become something like this for UCRT64:
472475
```
473-
`& "$Env:MSYS2_ROOT\ucrt64\bin\cmake.exe" --preset win-x64-msvc-static -DCMAKE_MAKE_PROGRAM="$Env:MSYS2_ROOT\ucrt64\bin\ninja.exe" .
476+
& "$Env:MSYS2_ROOT\ucrt64\bin\cmake.exe" --preset win-x64-msvc-static -DCMAKE_MAKE_PROGRAM="$Env:MSYS2_ROOT\ucrt64\bin\ninja.exe" -DWINDOWS_RESOURCES_ENABLED=OFF -DQUICK_GUI=ON .
477+
& "$Env:MSYS2_ROOT\ucrt64\bin\cmake.exe" --build --preset win-x64-msvc-static
474478
```
475479
or for MINGW64:
476480
```
477-
`& "$Env:MSYS2_ROOT\mingw64\bin\cmake.exe" --preset win-x64-msvc-static -DCMAKE_MAKE_PROGRAM="$Env:MSYS2_ROOT\mingw64\bin\ninja.exe" .
481+
& "$Env:MSYS2_ROOT\mingw64\bin\cmake.exe" --preset win-x64-msvc-static -DCMAKE_MAKE_PROGRAM="$Env:MSYS2_ROOT\mingw64\bin\ninja.exe" -DWINDOWS_RESOURCES_ENABLED=OFF -DQUICK_GUI=ON .
482+
& "$Env:MSYS2_ROOT\mingw64\bin\cmake.exe" --build --preset win-x64-msvc-static
478483
```
479484

480485
To run the resulting binaries, you'll need to make sure the Qt libraries are in the search path, e.g. using
@@ -484,9 +489,6 @@ Note that you don't need to install all Visual Studio has to offer. A customized
484489
C++ core features, MSVC x86/x64 build tools, Windows SDK and vcpkg should be enough. In Qt's online installer
485490
you can also uncheck everything except the MSVC build of Qt.
486491

487-
If the compilation of the resource file doesn't work you can use `-DWINDOWS_RESOURCES_ENABLED=OFF` to continue
488-
the build regardless.
489-
490492
###### Building under Windows for Android
491493
Building for Android under Windows is still experimental and not regularly tested. It is generally supported
492494
by CMake, Android tooling and Qt, though. So as long as all dependencies are installed correctly by *some*

0 commit comments

Comments
 (0)