Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kevinpruvost/portable-bazel-rules-glfw-glm
Portable Bazel rules for integrating GLFW and GLM in cross-platform C++ projects using Bazel.
https://github.com/kevinpruvost/portable-bazel-rules-glfw-glm
Last synced: 4 days ago
JSON representation
Portable Bazel rules for integrating GLFW and GLM in cross-platform C++ projects using Bazel.
- Host: GitHub
- URL: https://github.com/kevinpruvost/portable-bazel-rules-glfw-glm
- Owner: kevinpruvost
- Created: 2024-08-18T07:38:33.000Z (5 months ago)
- Default Branch: main
- Last Pushed: 2024-08-20T12:53:14.000Z (5 months ago)
- Last Synced: 2024-11-08T00:10:27.326Z (about 2 months ago)
- Language: C
- Size: 1.01 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Portable Bazel Rules for GLFW and GLM
This repository provides portable Bazel rules for integrating **GLFW** and **GLM** into your cross-platform C++ projects. It supports Windows, macOS, and Linux.
## Getting Started
### Integration
Simply include the libraries `glfw`, `glm`, or `glm_header_only` in your Bazel `BUILD` files to integrate them into your binaries.
If you don't need GLFW to be dynamic, DO NOT FORGET to disable the preprocessor macros _GLFW_BUILD_DLL in `GLFW/BUILD`.
```python
cc_binary(
name = "my_app",
srcs = ["main.cpp"],
copts = [
# Disable if you want to use GLFW as a static library
"-DGLFW_DLL",
],
deps = [
"//:glfw_static",
"//:glm",
# or "//:glm_header_only"
],
)# if you need
cc_shared_binary(
name = "my_app_shared",
visibility = ["//visibility:public"],
deps = [
":my_app"
],
dynamic_deps = [
"//:glfw"
]
)
```You can also check my [Computer Graphcis project on Vulkan & Metal using Bazel](https://github.com/kevinpruvost/Bazel_Vulkan_Metal) if you get any problems as I use GLFW and glm.
### Platform Support
- **Windows**: Fully supported.
- **macOS**: Fully supported.
- **Linux**: Built for X11 & Wayland, but X11 by default. You can easily tweak the build for Wayland or other configurations if needed, here is how to:
- `GLFW/BUILD`: comment every instance of `"-D_GLFW_X11"` and uncomment every instance of `"-D_GLFW_WAYLAND"`.## Versions
- **GLFW**: Based on [version 3.4](https://github.com/glfw/glfw/releases/tag/3.4)
- **GLM**: Based on [version 1.0.1](https://github.com/g-truc/glm/releases/tag/1.0.1)## Acknowledgments
Special thanks to the developers of:
- **GLFW**: [https://github.com/glfw/glfw](https://github.com/glfw/glfw)
- **GLM**: [https://github.com/g-truc/glm](https://github.com/g-truc/glm)