From a30a9878fe083240dbd98ae4ca93339cd8a8d667 Mon Sep 17 00:00:00 2001 From: skal Date: Tue, 17 Feb 2026 11:00:51 +0100 Subject: fix(build): Resolve Windows cross-compilation failures This commit fixes several issues that caused the Windows cross-compilation build (`scripts/build_win.sh`) to fail. The root causes were platform-specific API differences in the wgpu-native library and incorrect dependency tracking in the CMake build system for generated code. Changes: - **`tools/seq_compiler.py`**: The timeline generator now wraps `depthSlice` assignments in `#if !defined(DEMO_CROSS_COMPILE_WIN32)` directives to handle API differences in `WGPURenderPassColorAttachment`. - **`src/gpu/gpu.h`**: The `gpu_init_color_attachment` helper is now platform-aware, using a preprocessor guard for the `depthSlice` member. - **`src/effects/*.cc`**: All effects are updated to use the new platform-aware helper or have explicit guards for `depthSlice`. Also, replaced `WGPUTexelCopyTextureInfo` with the cross-platform alias `GpuTextureCopyInfo` in `rotating_cube_effect.cc`. - **`cmake`**: Added `tools/seq_compiler.py` as an explicit dependency to the `generate_timeline` and `generate_test_demo_timeline` custom commands. This ensures that changes to the generator script correctly trigger a rebuild of the generated C++ files. - **`scripts/build_win.sh`**: Removed the erroneous attempt to build the `seq_compiler.py` script as a native executable. With these changes, the Windows cross-compilation build now completes successfully. --- scripts/build_win.sh | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'scripts') diff --git a/scripts/build_win.sh b/scripts/build_win.sh index 915d1e5..c1732f0 100755 --- a/scripts/build_win.sh +++ b/scripts/build_win.sh @@ -4,10 +4,9 @@ set -e # 1. Build native tools echo "Building native tools..." cmake -S . -B build_native -DDEMO_BUILD_TOOLS=OFF -DDEMO_BUILD_TESTS=OFF -cmake --build build_native --target asset_packer seq_compiler tracker_compiler_host -j8 +cmake --build build_native --target asset_packer tracker_compiler_host -j8 ASSET_PACKER_PATH=$(pwd)/build_native/asset_packer -SEQ_COMPILER_PATH=$(pwd)/build_native/seq_compiler TRACKER_COMPILER_PATH=$(pwd)/build_native/tools_host/tracker_compiler_host echo "Cross-compiling for Windows..." @@ -16,7 +15,6 @@ cmake -S . -B build_win \ -DDEMO_CROSS_COMPILE_WIN32=ON \ -DDEMO_STRIP_ALL=ON \ -DASSET_PACKER_PATH=$ASSET_PACKER_PATH \ - -DSEQ_COMPILER_PATH=$SEQ_COMPILER_PATH \ -DTRACKER_COMPILER_PATH=$TRACKER_COMPILER_PATH cmake --build build_win -j8 -- cgit v1.2.3