This commit is contained in:
Aandreba 2025-02-19 13:47:38 +01:00
parent a8f658b0cf
commit a2b5325676
4 changed files with 15 additions and 3 deletions

View file

@ -37,6 +37,7 @@ pub fn build(b: *std.Build) void {
});
simdjson_lib.addIncludePath(simdjson_dep.path("singleheader"));
b.installArtifact(simdjson_lib);
b.installDirectory(.{ .source_dir = simdjson_dep.path("include"), .install_dir = .{ .custom = "include" }, .install_subdir = "." });
const fastgltf_lib: *std.Build.Step.Compile = switch (preferred_link_mode) {
inline else => |x| switch (x) {
@ -68,12 +69,20 @@ pub fn build(b: *std.Build) void {
fastgltf_lib.root_module.addCMacro("FASTGLTF_DISABLE_CUSTOM_MEMORY_POOL", if (disable_custom_memory_pool) "1" else "0");
fastgltf_lib.root_module.addCMacro("FASTGLTF_USE_64BIT_FLOAT", if (use_64bit_float) "1" else "0");
b.installArtifact(fastgltf_lib);
b.installDirectory(.{ .source_dir = fastgltf_dep.path("include"), .install_dir = .{ .custom = "include" }, .install_subdir = "." });
const example = b.addExecutable(.{
.name = "fastgltf-example",
.target = target,
.optimize = optimize,
});
example.linkLibCpp();
example.addIncludePath(.{ .cwd_relative = b.pathJoin(&.{ b.install_path, "include" }) });
example.linkLibrary(fastgltf_lib);
b.installAr
example.addCSourceFile(.{ .file = b.path("example/main.cpp") });
const run_artifact = b.addRunArtifact(example);
const run = b.step("run", "Run example");
run.dependOn(&run_artifact.step);
// b.installArtifact(example);
}