compat.glm
#includeOpenGL Mathematics — header-only vector and matrix library for graphics
#include <glm/glm.hpp>
mcpp add compat.glm@1.0.2
Usage
From this repository's own test project — built and run by CI, not written for the website.
// Behavioral test — compat.glm delivers a real glm, not an empty include root.
//
// The criterion is arithmetic, not compilation: a wrong include root fails to
// compile, but a header set that resolved to the wrong thing would still need
// to produce these numbers. Every value below is fixed by linear algebra or by
// glm's documented conventions.
#include <glm/glm.hpp>
#include <glm/gtc/matrix_transform.hpp>
#include <glm/gtx/norm.hpp>
import std;
int main() {
// Cross product, right-handed: x cross y is z.
const glm::vec3 x{1.0f, 0.0f, 0.0f};
const glm::vec3 y{0.0f, 1.0f, 0.0f};
if (glm::cross(x, y) != glm::vec3(0.0f, 0.0f, 1.0f)) {
std::println("cross(x, y) is not z");
return 1;
}
// Column-major storage is part of glm's ABI, and it is what a consumer
// …
tests/examples/glm/tests/math.cpp · project tests/examples/glm
openkal
| target | result | environment | test project | first diagnostic |
|---|---|---|---|---|
| x86_64-linux-gnu | runs | posix | glm | |
| x86_64-windows-musl | runs | posix | glm |
How this was measured
Measured 2026-09-23 by tests/openkal/compat.py with openkal-llvm-runtime 0.15.1, llvm@22.1.8, mcpp 2026.9.21.3. The test project selects no platform dependency of its own. The badge above is a summary of the strictest measured target -- the table above states each target's own environment.
Build
- targets
glm (lib)- language
c++23- C standard
c11- import std
- no
- include dirs
*
Sources (1)
mcpp_generated/glm_anchor.c
Generated files
mcpp_generated/glm_anchor.c