Skip to content

Commit

Permalink
build.zig: use cxxrtl_o_path list.
Browse files Browse the repository at this point in the history
  • Loading branch information
kivikakk committed Jun 16, 2024
1 parent a6901ba commit c1f6f02
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions cxxrtl/build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ const SDL = @import("SDL.zig");

pub fn build(b: *std.Build) void {
const yosys_data_dir = b.option([]const u8, "yosys_data_dir", "yosys data dir (per yosys-config --datdir)") orelse @import("zxxrtl").guessYosysDataDir(b);
const cxxrtl_o_paths = b.option([]const u8, "cxxrtl_o_paths", "comma-separated paths to .o files to link against, including CXXRTL simulation") orelse
"../build/cxxrtl/ili9341spi.o";
const cxxrtl_o_paths = b.option([][]const u8, "cxxrtl_o_path", "path to .o file to link against") orelse
&[_][]const u8{"../build/cxxrtl/ili9341spi.o"};
const clock_hz = b.option(usize, "clock_hz", "clock speed the gateware is elaborated at in Hz") orelse 1_000_000;

const target = b.standardTargetOptions(.{});
Expand All @@ -29,8 +29,7 @@ pub fn build(b: *std.Build) void {
}).module("zxxrtl");
exe.root_module.addImport("zxxrtl", zxxrtl_mod);

var it = std.mem.split(u8, cxxrtl_o_paths, ",");
while (it.next()) |cxxrtl_o_path| {
for (cxxrtl_o_paths) |cxxrtl_o_path| {
exe.addObjectFile(b.path(cxxrtl_o_path));
}

Expand Down

0 comments on commit c1f6f02

Please sign in to comment.