build: nits
This commit is contained in:
parent
5ab711e7e9
commit
b9286a4d7b
3 changed files with 7 additions and 5 deletions
|
@ -145,6 +145,8 @@ pub fn build(b: *std.build.Builder) !void {
|
|||
const input_path = b.fmt("examples/server/public/{s}", .{asset});
|
||||
const output_path = b.fmt("examples/server/{s}.hpp", .{asset});
|
||||
|
||||
// Portable equivalent of `b.addSystemCommand(&.{ "xxd", "-n", asset, "-i", input_path, output_path }) })`:
|
||||
|
||||
const input = try std.fs.cwd().readFileAlloc(b.allocator, input_path, std.math.maxInt(usize));
|
||||
defer b.allocator.free(input);
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@ foreach(asset ${SERVER_ASSETS})
|
|||
set(input "${CMAKE_CURRENT_SOURCE_DIR}/public/${asset}")
|
||||
set(output "${CMAKE_CURRENT_BINARY_DIR}/${asset}.hpp")
|
||||
|
||||
string(REGEX REPLACE "\\.| |-" "_" name "${asset}")
|
||||
string(REGEX REPLACE "\\.|-" "_" name "${asset}")
|
||||
file(READ "${input}" data HEX)
|
||||
string(LENGTH ${data} hex_len)
|
||||
math(EXPR len "${hex_len} / 2")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue