File tree Expand file tree Collapse file tree 2 files changed +9
-7
lines changed
Expand file tree Collapse file tree 2 files changed +9
-7
lines changed Original file line number Diff line number Diff line change @@ -48,12 +48,14 @@ pub fn build(b: *std.Build) void {
4848 }
4949
5050 // the native cpu_arch is null, so we should detect current cpu_arch
51- // if (target.cpu_arch == .x86_64) {
52- // exe.addIncludePath(.{ .path = "./inc" });
53- // const cfiles = [_][]const u8{"src/x86_64_intrins.c"};
54- // const cflags = [_][]const u8{"-O2"};
55- // exe.addCSourceFiles(&cfiles, &cflags);
56- // }
51+ const target_info = std .zig .system .NativeTargetInfo .detect (target ) catch
52+ @panic ("Couldn't detect native target info" );
53+ if (target_info .target .cpu .arch == .x86_64 ) {
54+ exe .addIncludePath (.{ .path = "./inc" });
55+ const cfiles = [_ ][]const u8 {"src/x86_64_intrins.c" };
56+ const cflags = [_ ][]const u8 {"-O2" };
57+ exe .addCSourceFiles (& cfiles , & cflags );
58+ }
5759
5860 // This declares intent for the executable to be installed into the
5961 // standard location when the user invokes the "install" step (the default
Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ const VecU8Index = VectorIndex(@Vector(VecLen(u8), u8));
1414
1515const c = @cImport ({
1616 @cInclude ("immintrin.h" );
17- // @cInclude("x86_64_intrins.h");
17+ @cInclude ("x86_64_intrins.h" );
1818});
1919
2020pub const SimdSamples = struct {
You can’t perform that action at this time.
0 commit comments