#130·orca

Build: delayload graphics DLLs

Author: rdunningtonCreated Jul 9, 2025Updated Jul 9, 2025
Labelswindows

One consequence of moving to the zig build system is that it doesn't support to mark DLLs as delay-loaded on Windows, so this feature has regressed. It's nice to not require all the graphics DLLs to be loaded since some apps won't use some of the APIs, and it will make startup time faster.

Clang doesn't seem to offer native support for feature. There's no combination of linker flags (that I can find) that will magically make this work. However, there does seem to a way to use dlltool to manually create a delayload static library from an existing DLL: https://stackoverflow.com/a/70416894/89306. We could either implement that as part of our build.zig or do the work to make it a seamless switch as part of the upstream zig toolchain.

Relevant code bits: https://github.com/orca-app/orca/blob/main/build.zig#L656-L660 https://github.com/orca-app/orca/blob/main/build.zig#L702