compat.glm
#includeOpenGL Mathematics — header-only vector and matrix library for graphics
#include <glm/glm.hpp>
mcpp add compat.glm@1.0.2
用法
来自本仓库自己的测试项目 —— CI 真的编译并运行过,不是为了网站写的。
// 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 · 项目 tests/examples/glm
openkal
| 目标 | 结果 | 环境 | 测试项目 | 首条诊断 |
|---|---|---|---|---|
| x86_64-linux-gnu | runs | posix | glm | |
| x86_64-windows-musl | runs | posix | glm |
测量方式
2026-09-23 由 tests/openkal/compat.py 测得,使用 openkal-llvm-runtime 0.15.1、llvm@22.1.8、mcpp 2026.9.21.3。测试项目没有自行选择平台依赖。 上方徽章是所有已测目标里最严格那个的结果 —— 上表列出每个目标各自的环境。
构建
- targets
glm (lib)- language
c++23- C standard
c11- import std
- no
- include dirs
*
源文件 (1)
mcpp_generated/glm_anchor.c
生成的文件
mcpp_generated/glm_anchor.c