SDL.zig icon indicating copy to clipboard operation
SDL.zig copied to clipboard

Allow build on Windows when Vcpkg exists but SDL is installed manually

Open wilt00 opened this issue 2 years ago • 0 comments

When building on Windows, I get this error:

$ zig build --verbose
cp C:\dev\vcpkg\installed\x64-windows-static\bin\SDL2.dll C:\Users\WT\code\ziggame\zig-out\bin\SDL2.dll error: FileNotFound
C:\Users\WT\scoop\apps\zig\current\lib\std\os\windows.zig:123:35: 0x7ff7e960c8e1 in std.os.windows.OpenFile (build.obj)
        .OBJECT_NAME_COLLISION => return error.PathAlreadyExists,
                                  ^
...

error: the following build command failed with exit code 1:
C:\Users\WT\code\ziggame\zig-cache\o\170af392d93d348114ce947d1eeae7d0\build.exe C:\Users\WT\scoop\apps\zig\current\zig.exe C:\Users\WT\code\ziggame C:\Users\WT\code\ziggame\zig-cache C:\Users\WT\AppData\Local\zig --verbose

I have Vcpkg installed, but I don't want to use it for this project. Here, SDK.zig sees that I have a Vcpkg directory configured, and then tries to copy a nonexistent SDL2.dll from that directory, which crashes the build. If I comment that block out, everything works great.

Would it make sense to add a key to .build_config/sdl.json disabling vcpkg?

wilt00 avatar May 05 '22 02:05 wilt00