25 lines
1.0 KiB
CMake
25 lines
1.0 KiB
CMake
# Cross-compile host tools (voidlink) for x86_64-windows-gnu using zig cc.
|
|
# Used by the CI release pipeline; NOT for target-blob cross-compilation.
|
|
#
|
|
# Produces a statically linked .exe that has no mingw DLL dependencies.
|
|
# Usage:
|
|
# cmake -B build-win -DCMAKE_TOOLCHAIN_FILE=cmake/toolchains/host-windows.cmake
|
|
|
|
set(CMAKE_SYSTEM_NAME Windows)
|
|
set(CMAKE_SYSTEM_PROCESSOR AMD64)
|
|
|
|
# zig cc/c++ wrappers must be on PATH before invoking cmake.
|
|
# The pipeline creates /usr/local/bin/zig-cc-win and zig-cxx-win.
|
|
set(CMAKE_C_COMPILER zig-cc-win CACHE FILEPATH "")
|
|
set(CMAKE_CXX_COMPILER zig-cxx-win CACHE FILEPATH "")
|
|
|
|
# Static link so the .exe is self-contained (no mingw DLLs needed).
|
|
set(CMAKE_EXE_LINKER_FLAGS_INIT "-static")
|
|
|
|
# Skip try_compile executable run — we can't execute Windows binaries on the Linux runner.
|
|
set(CMAKE_TRY_COMPILE_TARGET_TYPE STATIC_LIBRARY CACHE STRING "")
|
|
|
|
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
|
|
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
|
|
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
|