mirror of
https://github.com/loot/libloot.git
synced 2026-07-27 14:16:01 -07:00
Add bits for cross-compiling to Windows using MinGW
Some tests have been updated because UTF-8 is used as the native path encoding with MinGW/Wine, unlike MSVC/Windows. Some of the tests fail: - 4 Rust tests fail because long paths are not enabled and so the paths used when creating symlinks and junction paths are too long. I've tested them with x86_64-pc-windows-gnu and x86_64-pc-windows-gnullvm, and both see the same behaviour. The tests pass when the MinGW-built executable is run on Windows, so this is a Wine limitation. - 12 C++ tests fail because directory symlink creation is not implemented. They fail whether the MinGW-built executable is run in Wine or on Windows, so this is a MinGW limitation. - 1 C++ filesystem test fails because long paths are not enabled. The failing tests are skipped at runtime when built with MinGW, aside from the one test for long paths being enabled, which expects them to be disabled when built with MinGW. If long paths are enabled, e.g. by running wine reg add HKLM\\System\\CurrentControlSet\\Control\\Filesystem /v LongPathsEnabled /t REG_DWORD /d 1 /f then many more tests fail because the C++ tests create long paths when that Registry value is set, but it doesn't seem to actually enable long path support in Wine, so various filesystem operations fail.
This commit is contained in:
@@ -25,6 +25,13 @@ cmake -B build . -DCMAKE_BUILD_TYPE=RelWithDebInfo
|
||||
cmake --build build --parallel
|
||||
```
|
||||
|
||||
To cross-compile on Linux for Windows:
|
||||
|
||||
```
|
||||
cmake -B build . -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_TOOLCHAIN_FILE=cmake/toolchain-mingw64.cmake
|
||||
cmake --build build --parallel
|
||||
```
|
||||
|
||||
To build a debug build, pass `Debug` instead of `RelWithDebInfo`.
|
||||
|
||||
The following CMake variables can be used to configure the build:
|
||||
|
||||
Reference in New Issue
Block a user