mirror of
https://github.com/mappu/miqt.git
synced 2025-01-22 22:50:36 +00:00
windows: add extra link libraries for static qwindows plugin
This commit is contained in:
parent
ca2e3c4a19
commit
cef75b87bd
@ -76,6 +76,6 @@ Some C++ idioms that were difficult to project were omitted from the binding. Bu
|
||||
1. Build the necessary docker container for cross-compilation:
|
||||
- `docker build -t miqt/win64-cross:latest -f win64-cross-go1.23-qt5.15-static.Dockerfile .`
|
||||
2. Build your application:
|
||||
- `docker run --rm -v $(pwd):/src -w /src miqt/win64-cross:latest go build -buildvcs=false -ldflags '-s -w -H windowsgui'`
|
||||
- `docker run --rm -v $(pwd):/src -w /src miqt/win64-cross:latest go build -buildvcs=false --tags=windowsqtstatic -ldflags '-s -w -H windowsgui'`
|
||||
|
||||
For repeated builds, the compile speed can be improved if you also bind-mount the Docker container's `GOCACHE` directory: `-v $(pwd)/container-build-cache:/root/.cache/go-build`
|
||||
|
6
qt/cflags_windowsqtstatic.cpp
Normal file
6
qt/cflags_windowsqtstatic.cpp
Normal file
@ -0,0 +1,6 @@
|
||||
#ifdef MIQT_WINDOWSQTSTATIC
|
||||
|
||||
#include <QtPlugin>
|
||||
Q_IMPORT_PLUGIN (QWindowsIntegrationPlugin);
|
||||
|
||||
#endif
|
17
qt/cflags_windowsqtstatic.go
Normal file
17
qt/cflags_windowsqtstatic.go
Normal file
@ -0,0 +1,17 @@
|
||||
//go:build windowsqtstatic
|
||||
// +build windowsqtstatic
|
||||
|
||||
package qt
|
||||
|
||||
// Some extra libraries should be linked to make a proper static build.
|
||||
// Otherwise, it can cause "No Qt platform plugin could be initialized" error.
|
||||
// @ref https://github.com/mappu/miqt/issues/25
|
||||
// @ref https://stackoverflow.com/a/16776116
|
||||
// @ref https://stackoverflow.com/a/58648193
|
||||
// @ref https://stackoverflow.com/a/57374635
|
||||
|
||||
/*
|
||||
#cgo windowsqtstatic CXXFLAGS: -DMIQT_WINDOWSQTSTATIC
|
||||
#cgo LDFLAGS: -L/usr/lib/mxe/usr/x86_64-w64-mingw32.static/qt5/plugins/platforms -lqwindows -lQt5FontDatabaseSupport -lQt5EventDispatcherSupport -lQt5ThemeSupport -lQt5PlatformCompositorSupport -lQt5AccessibilitySupport -lQt5WindowsUIAutomationSupport -lwtsapi32
|
||||
*/
|
||||
import "C"
|
Loading…
x
Reference in New Issue
Block a user