mcpp index

compat.glm

#include

OpenGL 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-gnurunsposixglm
x86_64-windows-muslrunsposixglm

測量方式

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

版本

版本平台 鏡像sha256
1.0.2 最新 LinuxWindowsmacOS CN GLOBAL 19edf2e86029…