forked from recastnavigation/recastnavigation
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.zig
73 lines (67 loc) · 2.8 KB
/
build.zig
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
const std = @import("std");
const Build = @import("std").Build;
pub fn build(b: *Build) void {
var target = b.standardTargetOptions(.{});
const optimize = b.standardOptimizeOption(.{});
// For some reason, "#include <new>"" in the binding glue only works with msvc.
target.query.abi = .msvc;
const zignav_c_cpp = b.addStaticLibrary(.{
.name = "zignav_c_cpp",
.target = target,
.optimize = optimize,
});
zignav_c_cpp.linkLibC();
zignav_c_cpp.addIncludePath(b.path("Recast/Include"));
zignav_c_cpp.addIncludePath(b.path("Detour/Include"));
zignav_c_cpp.addIncludePath(b.path("DetourTileCache/Include"));
zignav_c_cpp.addIncludePath(b.path("DetourCrowd/Include"));
zignav_c_cpp.addCSourceFiles(.{
.files = &.{
// Recast
"Recast/Include/Recast_glue.cpp",
"Recast/Source/Recast.cpp",
"Recast/Source/RecastAlloc.cpp",
"Recast/Source/RecastArea.cpp",
"Recast/Source/RecastAssert.cpp",
"Recast/Source/RecastContour.cpp",
"Recast/Source/RecastFilter.cpp",
"Recast/Source/RecastLayers.cpp",
"Recast/Source/RecastMesh.cpp",
"Recast/Source/RecastMeshDetail.cpp",
"Recast/Source/RecastRasterization.cpp",
"Recast/Source/RecastRegion.cpp",
// Detour
"Detour/Include/DetourAlloc_glue.cpp",
"Detour/Include/DetourAssert_glue.cpp",
"Detour/Include/DetourCommon_glue.cpp",
"Detour/Include/DetourNavMesh_glue.cpp",
"Detour/Include/DetourNavMeshBuilder_glue.cpp",
"Detour/Include/DetourNavMeshQuery_glue.cpp",
"Detour/Include/DetourNode_glue.cpp",
"Detour/Include/DetourStatus_glue.cpp",
"Detour/Source/DetourAlloc.cpp",
"Detour/Source/DetourAssert.cpp",
"Detour/Source/DetourCommon.cpp",
"Detour/Source/DetourNavMesh.cpp",
"Detour/Source/DetourNavMeshBuilder.cpp",
"Detour/Source/DetourNavMeshQuery.cpp",
"Detour/Source/DetourNode.cpp",
// Detour Tile Cache
"DetourTileCache/Include/DetourTileCache_glue.cpp",
"DetourTileCache/Include/DetourTileCacheBuilder_glue.cpp",
"DetourTileCache/Source/DetourTileCache.cpp",
"DetourTileCache/Source/DetourTileCacheBuilder.cpp",
// Detour Crowd
"DetourCrowd/Include/DetourPathCorridor_glue.cpp",
"DetourCrowd/Source/DetourPathCorridor.cpp",
},
.flags = &.{},
});
b.installArtifact(zignav_c_cpp);
var zignav = b.addModule("zignav", .{
.root_source_file = b.path("main.zig"),
.target = target,
.optimize = optimize,
});
zignav.linkLibrary(zignav_c_cpp);
}