Skip to content

Commit

Permalink
modules path fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
kassane committed Mar 27, 2024
1 parent bb6181b commit 71c342b
Showing 1 changed file with 23 additions and 22 deletions.
45 changes: 23 additions & 22 deletions build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -174,14 +174,15 @@ pub fn searched_idf_include(b: *std.Build, lib: *std.Build.Step.Compile, idf_pat
}

pub fn idf_wrapped_modules(b: *std.Build) *std.Build.Module {
const src_path = std.fs.path.dirname(@src().file).?;
const sys = b.addModule("sys", .{
.root_source_file = .{
.path = "imports/idf-sys.zig",
.path = b.pathJoin(&.{ src_path, "imports", "idf-sys.zig" }),
},
});
const rtos = b.addModule("rtos", .{
.root_source_file = .{
.path = "imports/rtos.zig",
.path = b.pathJoin(&.{ src_path, "imports", "rtos.zig" }),
},
.imports = &.{
.{
Expand All @@ -192,7 +193,7 @@ pub fn idf_wrapped_modules(b: *std.Build) *std.Build.Module {
});
const version = b.addModule("ver", .{
.root_source_file = .{
.path = "imports/version.zig",
.path = b.pathJoin(&.{ src_path, "imports", "version.zig" }),
},
.imports = &.{
.{
Expand All @@ -203,7 +204,7 @@ pub fn idf_wrapped_modules(b: *std.Build) *std.Build.Module {
});
const log = b.addModule("log", .{
.root_source_file = .{
.path = "imports/logger.zig",
.path = b.pathJoin(&.{ src_path, "imports", "logger.zig" }),
},
.imports = &.{
.{
Expand All @@ -214,7 +215,7 @@ pub fn idf_wrapped_modules(b: *std.Build) *std.Build.Module {
});
const panic = b.addModule("panic", .{
.root_source_file = .{
.path = "imports/panic.zig",
.path = b.pathJoin(&.{ src_path, "imports", "panic.zig" }),
},
.imports = &.{
.{
Expand All @@ -229,7 +230,7 @@ pub fn idf_wrapped_modules(b: *std.Build) *std.Build.Module {
});
const led = b.addModule("led", .{
.root_source_file = .{
.path = "imports/led-strip.zig",
.path = b.pathJoin(&.{ src_path, "imports", "led-strip.zig" }),
},
.imports = &.{
.{
Expand All @@ -240,7 +241,7 @@ pub fn idf_wrapped_modules(b: *std.Build) *std.Build.Module {
});
const bootloader = b.addModule("bootloader", .{
.root_source_file = .{
.path = "imports/bootloader.zig",
.path = b.pathJoin(&.{ src_path, "imports", "bootloader.zig" }),
},
.imports = &.{
.{
Expand All @@ -251,7 +252,7 @@ pub fn idf_wrapped_modules(b: *std.Build) *std.Build.Module {
});
const lwip = b.addModule("lwip", .{
.root_source_file = .{
.path = "imports/lwip.zig",
.path = b.pathJoin(&.{ src_path, "imports", "lwip.zig" }),
},
.imports = &.{
.{
Expand All @@ -262,7 +263,7 @@ pub fn idf_wrapped_modules(b: *std.Build) *std.Build.Module {
});
const mqtt = b.addModule("mqtt", .{
.root_source_file = .{
.path = "imports/mqtt.zig",
.path = b.pathJoin(&.{ src_path, "imports", "mqtt.zig" }),
},
.imports = &.{
.{
Expand All @@ -273,7 +274,7 @@ pub fn idf_wrapped_modules(b: *std.Build) *std.Build.Module {
});
const heap = b.addModule("heap", .{
.root_source_file = .{
.path = "imports/heap.zig",
.path = b.pathJoin(&.{ src_path, "imports", "heap.zig" }),
},
.imports = &.{
.{
Expand All @@ -284,7 +285,7 @@ pub fn idf_wrapped_modules(b: *std.Build) *std.Build.Module {
});
const bt = b.addModule("bluetooth", .{
.root_source_file = .{
.path = "imports/bluetooth.zig",
.path = b.pathJoin(&.{ src_path, "imports", "bluetooth.zig" }),
},
.imports = &.{
.{
Expand All @@ -295,7 +296,7 @@ pub fn idf_wrapped_modules(b: *std.Build) *std.Build.Module {
});
const wifi = b.addModule("wifi", .{
.root_source_file = .{
.path = "imports/wifi.zig",
.path = b.pathJoin(&.{ src_path, "imports", "wifi.zig" }),
},
.imports = &.{
.{
Expand All @@ -306,7 +307,7 @@ pub fn idf_wrapped_modules(b: *std.Build) *std.Build.Module {
});
const errors = b.addModule("error", .{
.root_source_file = .{
.path = "imports/error.zig",
.path = b.pathJoin(&.{ src_path, "imports", "error.zig" }),
},
.imports = &.{
.{
Expand All @@ -317,7 +318,7 @@ pub fn idf_wrapped_modules(b: *std.Build) *std.Build.Module {
});
const gpio = b.addModule("gpio", .{
.root_source_file = .{
.path = "imports/gpio.zig",
.path = b.pathJoin(&.{ src_path, "imports", "gpio.zig" }),
},
.imports = &.{
.{
Expand All @@ -332,7 +333,7 @@ pub fn idf_wrapped_modules(b: *std.Build) *std.Build.Module {
});
const uart = b.addModule("uart", .{
.root_source_file = .{
.path = "imports/uart.zig",
.path = b.pathJoin(&.{ src_path, "imports", "uart.zig" }),
},
.imports = &.{
.{
Expand All @@ -347,7 +348,7 @@ pub fn idf_wrapped_modules(b: *std.Build) *std.Build.Module {
});
const i2c = b.addModule("i2c", .{
.root_source_file = .{
.path = "imports/i2c.zig",
.path = b.pathJoin(&.{ src_path, "imports", "i2c.zig" }),
},
.imports = &.{
.{
Expand All @@ -362,7 +363,7 @@ pub fn idf_wrapped_modules(b: *std.Build) *std.Build.Module {
});
const i2s = b.addModule("i2s", .{
.root_source_file = .{
.path = "imports/i2s.zig",
.path = b.pathJoin(&.{ src_path, "imports", "i2s.zig" }),
},
.imports = &.{
.{
Expand All @@ -377,7 +378,7 @@ pub fn idf_wrapped_modules(b: *std.Build) *std.Build.Module {
});
const spi = b.addModule("spi", .{
.root_source_file = .{
.path = "imports/spi.zig",
.path = b.pathJoin(&.{ src_path, "imports", "spi.zig" }),
},
.imports = &.{
.{
Expand All @@ -392,7 +393,7 @@ pub fn idf_wrapped_modules(b: *std.Build) *std.Build.Module {
});
const phy = b.addModule("phy", .{
.root_source_file = .{
.path = "imports/phy.zig",
.path = b.pathJoin(&.{ src_path, "imports", "phy.zig" }),
},
.imports = &.{
.{
Expand All @@ -403,7 +404,7 @@ pub fn idf_wrapped_modules(b: *std.Build) *std.Build.Module {
});
const segger = b.addModule("segger", .{
.root_source_file = .{
.path = "imports/segger.zig",
.path = b.pathJoin(&.{ src_path, "imports", "segger.zig" }),
},
.imports = &.{
.{
Expand All @@ -414,7 +415,7 @@ pub fn idf_wrapped_modules(b: *std.Build) *std.Build.Module {
});
const dsp = b.addModule("dsp", .{
.root_source_file = .{
.path = "imports/dsp.zig",
.path = b.pathJoin(&.{ src_path, "imports", "dsp.zig" }),
},
.imports = &.{
.{
Expand All @@ -425,7 +426,7 @@ pub fn idf_wrapped_modules(b: *std.Build) *std.Build.Module {
});
return b.addModule("esp_idf", .{
.root_source_file = .{
.path = "imports/idf.zig",
.path = b.pathJoin(&.{ src_path, "imports", "idf.zig" }),
},
.imports = &.{
.{
Expand Down

0 comments on commit 71c342b

Please sign in to comment.