build: workaround lack of -n on gnu xxd
This commit is contained in:
parent
b5f9c7021e
commit
13a36efbef
3 changed files with 3 additions and 6 deletions
2
Makefile
2
Makefile
|
@ -794,7 +794,7 @@ server: examples/server/server.cpp examples/server/utils.hpp examples/server/htt
|
||||||
$(CXX) $(CXXFLAGS) $(filter-out %.h %.hpp $<,$^) -Iexamples/server $(call GET_OBJ_FILE, $<) -o $@ $(LDFLAGS) $(LWINSOCK2)
|
$(CXX) $(CXXFLAGS) $(filter-out %.h %.hpp $<,$^) -Iexamples/server $(call GET_OBJ_FILE, $<) -o $@ $(LDFLAGS) $(LWINSOCK2)
|
||||||
|
|
||||||
examples/server/%.hpp: examples/server/public/%
|
examples/server/%.hpp: examples/server/public/%
|
||||||
xxd -n $(notdir $<) -i $< $@
|
( cd examples/server/public && xxd -i $(notdir $<) ../$(notdir $<).hpp )
|
||||||
|
|
||||||
gguf: examples/gguf/gguf.cpp ggml.o $(OBJS)
|
gguf: examples/gguf/gguf.cpp ggml.o $(OBJS)
|
||||||
$(CXX) $(CXXFLAGS) -c $< -o $(call GET_OBJ_FILE, $<)
|
$(CXX) $(CXXFLAGS) -c $< -o $(call GET_OBJ_FILE, $<)
|
||||||
|
|
|
@ -142,10 +142,7 @@ pub fn build(b: *std.build.Builder) !void {
|
||||||
|
|
||||||
const server_assets = [_][]const u8{ "index.html", "index.js", "completion.js", "json-schema-to-grammar.mjs" };
|
const server_assets = [_][]const u8{ "index.html", "index.js", "completion.js", "json-schema-to-grammar.mjs" };
|
||||||
for (server_assets) |asset| {
|
for (server_assets) |asset| {
|
||||||
// Note: code can be simplified once setCwd is standard.
|
const gen_hpp = b.addSystemCommand(&.{ "bash", "-c", b.fmt("cd examples/server/public && xxd -i {s} ../{s}.hpp", .{ asset, asset }) });
|
||||||
const gen_hpp = b.addSystemCommand(
|
|
||||||
&.{ "xxd", "-n", asset, "-i", b.fmt("examples/server/public/{s}", .{asset}), b.fmt("examples/server/{s}.hpp", .{asset}) },
|
|
||||||
);
|
|
||||||
server.step.dependOn(&gen_hpp.step);
|
server.step.dependOn(&gen_hpp.step);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue