-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.zig
27 lines (20 loc) · 917 Bytes
/
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
const std = @import("std");
pub fn build(b: *std.Build) void {
const target = b.standardTargetOptions(.{});
const optimize = b.standardOptimizeOption(.{});
const lib = b.addSharedLibrary(.{
.name = "reaper_zig",
.root_source_file = b.path("src/main.zig"),
.target = target,
.optimize = optimize,
});
const root = b.path("src/lib/csurf/");
lib.addIncludePath(root);
const sourcefileOpts = std.Build.Module.AddCSourceFilesOptions{ .files = &.{ "src/lib/csurf/control_surface.cpp", "src/lib/csurf/control_surface_wrapper.cpp" }, .flags = &.{ "-fPIC", "-O2", "-std=c++14", "-IWDL/WDL" } };
lib.addCSourceFiles(sourcefileOpts);
lib.linkLibC();
lib.linkLibCpp();
const client_install = b.addInstallArtifact(lib, .{ .dest_sub_path = "reaper_zig.so" });
b.getInstallStep().dependOn(&client_install.step);
// b.installArtifact(lib);
}