mirror of
https://github.com/Not-Nik/raylib-zig.git
synced 2025-09-09 12:07:27 +00:00
BREAKING: rename raylib-math module to raymath
This commit is contained in:
parent
6ff9f0a45b
commit
a0126d15be
14
build.zig
14
build.zig
@ -125,7 +125,7 @@ fn getModule(b: *std.Build, target: std.Build.ResolvedTarget, optimize: std.buil
|
|||||||
const math = struct {
|
const math = struct {
|
||||||
fn getModule(b: *std.Build, target: std.Build.ResolvedTarget, optimize: std.builtin.Mode) *std.Build.Module {
|
fn getModule(b: *std.Build, target: std.Build.ResolvedTarget, optimize: std.builtin.Mode) *std.Build.Module {
|
||||||
const raylib = rl.getModule(b, target, optimize);
|
const raylib = rl.getModule(b, target, optimize);
|
||||||
return b.addModule("raylib-math", .{
|
return b.addModule("raymath", .{
|
||||||
.root_source_file = b.path("lib/raymath.zig"),
|
.root_source_file = b.path("lib/raymath.zig"),
|
||||||
.imports = &.{.{ .name = "raylib-zig", .module = raylib }},
|
.imports = &.{.{ .name = "raylib-zig", .module = raylib }},
|
||||||
.target = target,
|
.target = target,
|
||||||
@ -258,7 +258,7 @@ pub fn build(b: *std.Build) !void {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const raylib = rl.getModule(b, target, optimize);
|
const raylib = rl.getModule(b, target, optimize);
|
||||||
const raylib_math = rl.math.getModule(b, target, optimize);
|
const raymath = rl.math.getModule(b, target, optimize);
|
||||||
const rlgl = rl.gl.getModule(b, target, optimize);
|
const rlgl = rl.gl.getModule(b, target, optimize);
|
||||||
const raygui = rl.gui.getModule(b, target, optimize);
|
const raygui = rl.gui.getModule(b, target, optimize);
|
||||||
|
|
||||||
@ -268,12 +268,12 @@ pub fn build(b: *std.Build) !void {
|
|||||||
.optimize = optimize,
|
.optimize = optimize,
|
||||||
});
|
});
|
||||||
|
|
||||||
const raylib_math_test = b.addTest(.{
|
const raymath_test = b.addTest(.{
|
||||||
.root_source_file = b.path("lib/raymath.zig"),
|
.root_source_file = b.path("lib/raymath.zig"),
|
||||||
.target = target,
|
.target = target,
|
||||||
.optimize = optimize,
|
.optimize = optimize,
|
||||||
});
|
});
|
||||||
raylib_math_test.root_module.addImport("raylib-zig", raylib);
|
raymath_test.root_module.addImport("raylib-zig", raylib);
|
||||||
|
|
||||||
const rlgl_test = b.addTest(.{
|
const rlgl_test = b.addTest(.{
|
||||||
.root_source_file = b.path("lib/rlgl.zig"),
|
.root_source_file = b.path("lib/rlgl.zig"),
|
||||||
@ -291,7 +291,7 @@ pub fn build(b: *std.Build) !void {
|
|||||||
|
|
||||||
const test_step = b.step("test", "Check for library compilation errors");
|
const test_step = b.step("test", "Check for library compilation errors");
|
||||||
test_step.dependOn(&raylib_test.step);
|
test_step.dependOn(&raylib_test.step);
|
||||||
test_step.dependOn(&raylib_math_test.step);
|
test_step.dependOn(&raymath_test.step);
|
||||||
test_step.dependOn(&rlgl_test.step);
|
test_step.dependOn(&rlgl_test.step);
|
||||||
test_step.dependOn(&raygui_test.step);
|
test_step.dependOn(&raygui_test.step);
|
||||||
|
|
||||||
@ -301,7 +301,7 @@ pub fn build(b: *std.Build) !void {
|
|||||||
if (target.query.os_tag == .emscripten) {
|
if (target.query.os_tag == .emscripten) {
|
||||||
const exe_lib = emcc.compileForEmscripten(b, ex.name, ex.path, target, optimize);
|
const exe_lib = emcc.compileForEmscripten(b, ex.name, ex.path, target, optimize);
|
||||||
exe_lib.root_module.addImport("raylib", raylib);
|
exe_lib.root_module.addImport("raylib", raylib);
|
||||||
exe_lib.root_module.addImport("raylib-math", raylib_math);
|
exe_lib.root_module.addImport("raymath", raymath);
|
||||||
exe_lib.root_module.addImport("rlgl", rlgl);
|
exe_lib.root_module.addImport("rlgl", rlgl);
|
||||||
exe_lib.root_module.addImport("raygui", raygui);
|
exe_lib.root_module.addImport("raygui", raygui);
|
||||||
const raylib_lib = getRaylib(b, target, optimize, options);
|
const raylib_lib = getRaylib(b, target, optimize, options);
|
||||||
@ -328,7 +328,7 @@ pub fn build(b: *std.Build) !void {
|
|||||||
});
|
});
|
||||||
rl.link(b, exe, target, optimize, options);
|
rl.link(b, exe, target, optimize, options);
|
||||||
exe.root_module.addImport("raylib", raylib);
|
exe.root_module.addImport("raylib", raylib);
|
||||||
exe.root_module.addImport("raylib-math", raylib_math);
|
exe.root_module.addImport("raymath", raymath);
|
||||||
exe.root_module.addImport("rlgl", rlgl);
|
exe.root_module.addImport("rlgl", rlgl);
|
||||||
exe.root_module.addImport("raygui", raygui);
|
exe.root_module.addImport("raygui", raygui);
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
// raylib-zig (c) Nikolas Wipper 2023
|
// raylib-zig (c) Nikolas Wipper 2023
|
||||||
|
|
||||||
const rl = @import("raylib");
|
const rl = @import("raylib");
|
||||||
const rlm = @import("raylib-math");
|
const rlm = @import("raymath");
|
||||||
|
|
||||||
const MAX_BUILDINGS = 100;
|
const MAX_BUILDINGS = 100;
|
||||||
|
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
//! Copyright (c) Nikolas Wipper 2024
|
//! Copyright (c) Nikolas Wipper 2024
|
||||||
|
|
||||||
const rl = @import("raylib");
|
const rl = @import("raylib");
|
||||||
const rlm = @import("raylib-math");
|
const rlm = @import("raymath");
|
||||||
|
|
||||||
const screen_width = 800;
|
const screen_width = 800;
|
||||||
const screen_height = 450;
|
const screen_height = 450;
|
||||||
|
@ -22,7 +22,7 @@ pub fn build(b: *std.Build) !void {
|
|||||||
});
|
});
|
||||||
|
|
||||||
const raylib = raylib_dep.module("raylib");
|
const raylib = raylib_dep.module("raylib");
|
||||||
const raylib_math = raylib_dep.module("raylib-math");
|
const raymath = raylib_dep.module("raymath");
|
||||||
const raylib_artifact = raylib_dep.artifact("raylib");
|
const raylib_artifact = raylib_dep.artifact("raylib");
|
||||||
|
|
||||||
//web exports are completely separate
|
//web exports are completely separate
|
||||||
@ -31,7 +31,7 @@ pub fn build(b: *std.Build) !void {
|
|||||||
|
|
||||||
exe_lib.linkLibrary(raylib_artifact);
|
exe_lib.linkLibrary(raylib_artifact);
|
||||||
exe_lib.root_module.addImport("raylib", raylib);
|
exe_lib.root_module.addImport("raylib", raylib);
|
||||||
exe_lib.root_module.addImport("raylib-math", raylib_math);
|
exe_lib.root_module.addImport("raymath", raymath);
|
||||||
|
|
||||||
// Note that raylib itself is not actually added to the exe_lib output file, so it also needs to be linked with emscripten.
|
// Note that raylib itself is not actually added to the exe_lib output file, so it also needs to be linked with emscripten.
|
||||||
const link_step = try rlz.emcc.linkWithEmscripten(b, &[_]*std.Build.Step.Compile{ exe_lib, raylib_artifact });
|
const link_step = try rlz.emcc.linkWithEmscripten(b, &[_]*std.Build.Step.Compile{ exe_lib, raylib_artifact });
|
||||||
@ -48,7 +48,7 @@ pub fn build(b: *std.Build) !void {
|
|||||||
|
|
||||||
exe.linkLibrary(raylib_artifact);
|
exe.linkLibrary(raylib_artifact);
|
||||||
exe.root_module.addImport("raylib", raylib);
|
exe.root_module.addImport("raylib", raylib);
|
||||||
exe.root_module.addImport("raylib-math", raylib_math);
|
exe.root_module.addImport("raymath", raymath);
|
||||||
|
|
||||||
const run_cmd = b.addRunArtifact(exe);
|
const run_cmd = b.addRunArtifact(exe);
|
||||||
const run_step = b.step("run", "Run '$PROJECT_NAME'");
|
const run_step = b.step("run", "Run '$PROJECT_NAME'");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user