Skip to content

Commit

Permalink
update(fildesh): with fildesh_run() macro
Browse files Browse the repository at this point in the history
  • Loading branch information
grencez committed Feb 6, 2024
1 parent e364db2 commit db2ece2
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 18 deletions.
4 changes: 2 additions & 2 deletions MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ module(

bazel_dep(name = "bazel_skylib", version = "1.5.0")
bazel_dep(name = "fildesh", version = "0.1.9")
bazel_dep(name = "rules_license", version = "0.0.7")
bazel_dep(name = "mdd-glu", version = "2.4.0")
bazel_dep(name = "rules_license", version = "0.0.8")
bazel_dep(name = "rules_peg", version = "0.1.18")

git_override(
module_name = "fildesh",
remote = "https://github.com/fildesh/fildesh.git",
commit="497c733c4172f2ec3b6dbf8590cb33331c61ca29",
commit="fc27c09ec95a94f434348ea014bf6ccda92ad01f",
)
git_override(
module_name = "mdd-glu",
Expand Down
2 changes: 1 addition & 1 deletion dep/cmake_fetchcontent/fildesh.cmake
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FetchContent_Declare(
Fildesh
GIT_REPOSITORY "https://github.com/fildesh/fildesh.git"
GIT_TAG "497c733c4172f2ec3b6dbf8590cb33331c61ca29"
GIT_TAG "fc27c09ec95a94f434348ea014bf6ccda92ad01f"
)
FetchContent_MakeAvailable(Fildesh)
16 changes: 9 additions & 7 deletions src/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
load("@fildesh//tool/bazel:fildesh_run.bzl", "fildesh_run")
load("@rules_peg//peg:defs.bzl", "cc_parsing_expression_grammar")

package(
Expand Down Expand Up @@ -176,14 +177,15 @@ cc_binary(
visibility = ["//visibility:public"],
)

genrule(
fildesh_run(
name = "test_embed_h",
srcs = [
"testlist.txt",
],
tools = ["@fildesh//tool:cswitch"],
cmd = "$(location @fildesh//tool:cswitch) testname -case-pfx \"fn = Test\" -array AllTests -x $(location testlist.txt) -o \"$@\"",
outs = ["test.embed.h"],
input_by_xof = {"testlist_file": "testlist.txt"},
output_by_xof = {"out": "test.embed.h"},
src_content = """
cswitch testname -case-pfx \"fn = Test\" -array AllTests -x $(XOF testlist_file) -o $(XOF out)
""",
tool_by_alias = {"cswitch": "@fildesh//tool:cswitch"},
testonly = 1,
)

cc_library(
Expand Down
19 changes: 11 additions & 8 deletions src/udp-impl/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
load("@fildesh//tool/bazel:fildesh_run.bzl", "fildesh_run")

genrule(
fildesh_run(
name = "act_embed_h",
srcs = [
"protocol.c",
"protocol.h",
],
tools = ["@fildesh//tool:cembed"],
cmd = "$(location @fildesh//tool:cembed) -o \"$@\" $(location protocol.h) $(location protocol.c)",
outs = ["act.embed.h"],
input_by_xof = {
"x_c": "protocol.c",
"x_h": "protocol.h",
},
output_by_xof = {"out": "act.embed.h"},
src_content = """
cembed -o $(XOF out) $(XOF x_h) $(XOF x_c)
""",
tool_by_alias = {"cembed": "@fildesh//tool:cembed"},
visibility = [
"//src:__pkg__",
],
Expand Down

0 comments on commit db2ece2

Please sign in to comment.