glfw: make platform-specific e.g. vulkan-headers dependencies optional #863

Closed
opened 2023-07-18 15:03:20 +00:00 by Pyrdacor · 4 comments
Pyrdacor commented 2023-07-18 15:03:20 +00:00 (Migrated from github.com)

Is it possible to remove the @cDefine("GLFW_INCLUDE_VULKAN", "1"); from the glfw implementation or add an option to include it? I don't want to use Vulkan and when compiling it complains about:

include/GLFW/glfw3.h:111:12: error: 'vulkan/vulkan.h' file not found

Is it possible to remove the `@cDefine("GLFW_INCLUDE_VULKAN", "1");` from the glfw implementation or add an option to include it? I don't want to use Vulkan and when compiling it complains about: `include/GLFW/glfw3.h:111:12: error: 'vulkan/vulkan.h' file not found`
alichraghi commented 2023-07-18 16:27:19 +00:00 (Migrated from github.com)

vulkan is dynamically linked so you are not compiling it. but i agree that must be a build option

vulkan is dynamically linked so you are not compiling it. but i agree that must be a build option
emidoots commented 2023-07-18 16:33:42 +00:00 (Migrated from github.com)

All you need is the headers, which we include as a dependency so you don't need to install them on your system or anything. Right now we've switched to the Zig package manager and things are a bit rough, see https://github.com/hexops/mach/issues/861#issuecomment-1638185447 for how to set up mach-glfw for use today.

Once you do that, the package manager will download/build Vulkan headers for you - but otherwise they won't be used and your program doesn't need to actually use Vulkan at all (you can just use OpenGL or whatever.)

All you need is the headers, which we include as a dependency so you don't need to install them on your system or anything. Right now we've switched to the Zig package manager and things are a bit rough, see https://github.com/hexops/mach/issues/861#issuecomment-1638185447 for how to set up mach-glfw for use today. Once you do that, the package manager will download/build Vulkan headers for you - but otherwise they won't be used and your program doesn't need to actually use Vulkan at all (you can just use OpenGL or whatever.)
Pyrdacor commented 2023-07-18 19:44:47 +00:00 (Migrated from github.com)

Thanks for the info. I already use the zon file. I used some code from the Vulkan mach glfw example repo.

For me it is also a bit more complex as I have a lib which uses mach-glfw and my main exe uses that lib. I almost managed to setup all the build stuff but it wasn't very intuitive. But this is more about zig and not your project.

I will have a closer look at your links and try to make it work.

Thanks for the info. I already use the zon file. I used some code from the Vulkan mach glfw example repo. For me it is also a bit more complex as I have a lib which uses mach-glfw and my main exe uses that lib. I almost managed to setup all the build stuff but it wasn't very intuitive. But this is more about zig and not your project. I will have a closer look at your links and try to make it work.
emidoots commented 2024-07-08 13:04:19 +00:00 (Migrated from github.com)
https://github.com/hexops/mach/issues/1166#issuecomment-2212962722
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
hexops/mach#863
No description provided.