Skip to content

Commit 6035a19

Browse files
authored
Merge pull request #3 from allyourcodebase/techatrix/fix-install-headers
don't install header files into subdirectory to match upstream
2 parents 7995ce6 + 884f471 commit 6035a19

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

.github/workflows/ci.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,3 +36,6 @@ jobs:
3636

3737
- name: Build
3838
run: zig build --summary all
39+
40+
- name: Test
41+
run: zig build run-all-tests --summary all

build.zig

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,9 @@ pub fn build(b: *std.Build) void {
4848
});
4949
b.installArtifact(capstone);
5050
capstone.addIncludePath(upstream.path("include"));
51-
capstone.installHeadersDirectory(upstream.path("include/capstone"), "capstone", .{});
52-
capstone.installHeader(upstream.path("include/platform.h"), "capstone/platform.h");
51+
// The header files should be installed in a 'capstone' subdirectory in capstone v6.
52+
capstone.installHeadersDirectory(upstream.path("include/capstone"), "", .{});
53+
capstone.installHeader(upstream.path("include/platform.h"), "platform.h");
5354
capstone.addCSourceFiles(.{ .root = upstream.path(""), .files = common_sources });
5455

5556
if (build_diet) capstone.root_module.addCMacro("CAPSTONE_DIET", "");
@@ -81,6 +82,7 @@ pub fn build(b: *std.Build) void {
8182
.strip = strip,
8283
.link_libc = true,
8384
});
85+
cstool.addIncludePath(upstream.path("include")); // remove this in capstone v6
8486
cstool.linkLibrary(capstone);
8587
cstool.addCSourceFiles(.{ .root = upstream.path("cstool"), .files = cstool_sources });
8688
cstool.addCSourceFile(.{ .file = upstream.path("cstool/getopt.c") });
@@ -116,6 +118,7 @@ pub fn build(b: *std.Build) void {
116118
.strip = strip,
117119
.link_libc = true,
118120
});
121+
exe.addIncludePath(upstream.path("include")); // remove this in capstone v6
119122
exe.linkLibrary(capstone);
120123
exe.addCSourceFile(.{ .file = upstream.path("tests").path(b, file) });
121124

0 commit comments

Comments
 (0)