-
Notifications
You must be signed in to change notification settings - Fork 65
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a simple MSVC cross-compile script for testing
This is not generally useful, but with a suitable setup allows for smoke testing of an MSVC build without needing Windows.
- Loading branch information
Showing
2 changed files
with
57 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
set(CMAKE_SYSTEM_NAME Windows) | ||
set(CMAKE_SYSTEM_PROCESSOR X86_64) | ||
|
||
set(CMAKE_BUILD_TYPE "Release") | ||
set(CMAKE_C_COMPILER "x86_64-pc-windows-msvc-gcc") | ||
set(CMAKE_CXX_COMPILER "x86_64-pc-windows-msvc-g++") | ||
set(CMAKE_EXE_LINKER_FLAGS "/winsdkdir:/usr/x86_64-pc-windows-msvc/winsdk/sdk /vctoolsdir:/usr/x86_64-pc-windows-msvc/winsdk/crt /libpath:/usr/x86_64-pc-windows-msvc/winsdk/sdk/lib/um/x64") | ||
set(CMAKE_SHARED_LINKER_FLAGS ${CMAKE_EXE_LINKER_FLAGS}) | ||
set(CMAKE_MT "llvm-mt") | ||
|
||
set(CMAKE_FIND_ROOT_PATH /usr/x86_64-pc-windows-msvc) | ||
|
||
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) | ||
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) | ||
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) | ||
|
||
set(ENV{PKG_CONFIG_DIR} "") | ||
set(ENV{PKG_CONFIG_LIBDIR} "/usr/x86_64-pc-windows-msvc/lib/pkgconfig") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
#!/bin/bash | ||
|
||
set -ex | ||
|
||
qt="$HOME/Qt/6.6.0/msvc2019_64" | ||
|
||
nproc=$(getconf _NPROCESSORS_ONLN) | ||
|
||
[[ -e build/dist ]] && exit 1 | ||
|
||
( | ||
mkdir build-msvc | ||
cd build-msvc | ||
cmake .. -DWITH_QT6=ON -DCMAKE_PREFIX_PATH="${qt}" -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=Toolchain-msvc.cmake -DSOUND=QT -DWITH_BUNDLED_FMT=ON -DDIST_INSTALL=ON | ||
make -j${nproc} | ||
make install | ||
) | ||
|
||
for dll in libpng16.dll sndfile.dll turbojpeg.dll zlib1.dll | ||
do | ||
cp "/usr/x86_64-pc-windows-msvc/bin/${dll}" build/dist | ||
done | ||
|
||
for dll in Qt6Core.dll Qt6Gui.dll Qt6Multimedia.dll Qt6Network.dll Qt6Widgets.dll | ||
do | ||
cp "${qt}/bin/${dll}" build/dist | ||
done | ||
|
||
mkdir -p "build/dist/plugins/platforms" | ||
cp "${qt}/plugins/platforms/qwindows.dll" "build/dist/plugins/platforms" | ||
mkdir -p "build/dist/plugins/multimedia" | ||
cp "${qt}/plugins/multimedia/windowsmediaplugin.dll" "build/dist/plugins/multimedia" | ||
|
||
cp licenses/*.txt build/dist | ||
cp fonts/Gargoyle*.ttf build/dist | ||
cp fonts/unifont*.otf build/dist | ||
mkdir build/dist/themes | ||
cp themes/*.json build/dist/themes | ||
unix2dos -n garglk/garglk.ini build/dist/garglk.ini |