Skip to content

Commit

Permalink
fix 'name' removal for hancho build
Browse files Browse the repository at this point in the history
  • Loading branch information
aappleby committed Oct 20, 2024
1 parent daaf90b commit 3e5d696
Show file tree
Hide file tree
Showing 8 changed files with 27 additions and 27 deletions.
2 changes: 1 addition & 1 deletion build.hancho
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ tutorial = hancho.load("examples/tutorial/tutorial.hancho", c_lexer = c_lexer, c

ini = hancho(
hancho.rules.cpp_lib,
name = "ini_parser",
in_srcs = "examples/ini/ini_parser.cpp",
out_lib = "ini_parser.a",
)
6 changes: 3 additions & 3 deletions examples/c_lexer/c_lexer.hancho
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,20 @@ rules = hancho.pop('rules')

lib = hancho(
rules.cpp_lib,
name = "c_lexer.a",
in_srcs = ["CLexer.cpp", "CToken.cpp"],
out_lib = "c_lexer.a",
)

hancho(
rules.cpp_test,
name = "c_lexer_test",
in_srcs = "c_lexer_test.cpp",
in_libs = lib,
out_bin = "c_lexer_test",
)

hancho(
rules.cpp_bin,
name = "c_lexer_benchmark",
in_srcs = "c_lexer_benchmark.cpp",
in_libs = lib,
out_bin = "c_lexer_benchmark",
)
4 changes: 2 additions & 2 deletions examples/c_parser/c_parser.hancho
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ c_lexer = hancho.pop('c_lexer')

lib = hancho(
rules.cpp_lib,
name = "c_parser",
in_srcs = ["CContext.cpp", "CNode.cpp", "CScope.cpp"],
out_lib = "c_parser.a",
)

hancho(
rules.cpp_bin,
name = "c_parser_benchmark",
in_srcs = "c_parser_benchmark.cpp",
in_libs = [c_lexer.lib, lib],
out_bin = "c_parser_benchmark",
)

# Broken?
Expand Down
10 changes: 5 additions & 5 deletions examples/json/json.hancho
Original file line number Diff line number Diff line change
Expand Up @@ -5,34 +5,34 @@ rules = hancho.pop('rules')

lib = hancho(
rules.cpp_lib,
name = "json_parser",
in_srcs = ["json_matcher.cpp", "json_parser.cpp"],
out_lib = "json_parser.a",
)

hancho(
rules.cpp_bin,
name = "json_conformance",
in_srcs = "json_conformance.cpp",
in_libs = lib,
out_bin = "json_conformance",
)

hancho(
rules.cpp_bin,
name = "json_benchmark",
in_srcs = "json_benchmark.cpp",
in_libs = lib,
out_bin = "json_benchmark",
)

hancho(
rules.cpp_bin,
name = "json_demo",
in_srcs = "json_demo.cpp",
in_libs = lib,
out_bin = "json_demo",
)

hancho(
rules.cpp_test,
name = "json_test",
in_srcs = "json_test.cpp",
in_libs = lib,
out_bin = "json_test",
)
8 changes: 4 additions & 4 deletions examples/regex/regex.hancho
Original file line number Diff line number Diff line change
Expand Up @@ -15,28 +15,28 @@ rules = hancho.pop('rules')

lib = hancho(
rules.cpp_lib,
name = "regex_parser",
in_srcs = "regex_parser.cpp",
out_lib = "regex_parser.a",
)

hancho(
rules.cpp_bin,
name = "regex_demo",
in_srcs = "regex_demo.cpp",
in_libs = lib,
out_bin = "regex_demo",
)

hancho(
rules.cpp_bin,
name = "regex_benchmark",
in_srcs = "regex_benchmark.cpp",
in_libs = lib,
out_bin = "regex_benchmark",
sys_libs = ["boost_system", "boost_regex"],
)

hancho(
rules.cpp_test,
name = "regex_test",
in_srcs = "regex_test.cpp",
in_libs = lib,
out_bin = "regex_test",
)
4 changes: 2 additions & 2 deletions examples/toml/toml.hancho
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ rules = hancho.pop('rules')

lib = hancho(
rules.cpp_lib,
name = "toml_parser",
in_srcs = "toml_parser.cpp",
out_lib = "toml_parser.a",
)

hancho(
rules.cpp_test,
name = "toml_test",
in_srcs = "toml_test.cpp",
in_libs = lib,
out_bin = "toml_test",
)
14 changes: 7 additions & 7 deletions examples/tutorial/tutorial.hancho
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,16 @@ rules = hancho.pop('rules')

test_config = hancho.Config(task_dir = "{repo_dir}")

hancho(rules.cpp_test, name = "json_tut0a", in_srcs = "json_tut0a.cpp", test_config = test_config)
hancho(rules.cpp_test, name = "json_tut1a", in_srcs = "json_tut1a.cpp", test_config = test_config)
hancho(rules.cpp_test, name = "json_tut1b", in_srcs = "json_tut1b.cpp", test_config = test_config)
hancho(rules.cpp_test, name = "json_tut1c", in_srcs = "json_tut1c.cpp", test_config = test_config)
hancho(rules.cpp_test, name = "json_tut2a", in_srcs = "json_tut2a.cpp", test_config = test_config)
hancho(rules.cpp_test, name = "json_tut2b", in_srcs = "json_tut2b.cpp", test_config = test_config)
hancho(rules.cpp_test, in_srcs = "json_tut0a.cpp", out_bin = "json_tut0a", test_config = test_config)
hancho(rules.cpp_test, in_srcs = "json_tut1a.cpp", out_bin = "json_tut1a", test_config = test_config)
hancho(rules.cpp_test, in_srcs = "json_tut1b.cpp", out_bin = "json_tut1b", test_config = test_config)
hancho(rules.cpp_test, in_srcs = "json_tut1c.cpp", out_bin = "json_tut1c", test_config = test_config)
hancho(rules.cpp_test, in_srcs = "json_tut2a.cpp", out_bin = "json_tut2a", test_config = test_config)
hancho(rules.cpp_test, in_srcs = "json_tut2b.cpp", out_bin = "json_tut2b", test_config = test_config)

hancho(
rules.cpp_bin,
name = "tiny_c_parser",
in_srcs = "tiny_c_parser.cpp",
in_libs = [hancho.c_lexer.lib, hancho.c_parser.lib],
out_bin = "tiny_c_parser",
)
6 changes: 3 additions & 3 deletions tests/tests.hancho
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,17 @@
#build obj/matcheroni/Parseroni.hpp.iwyu : iwyu matcheroni/Parseroni.hpp
#build obj/matcheroni/Utilities.hpp.iwyu : iwyu matcheroni/Utilities.hpp

rules = hancho.pop('rules')
rules = hancho.rules

# Apparently I broke this...
#hancho(
# rules.cpp_test,
# name = "matcheroni_test",
# in_srcs = "matcheroni_test.cpp",
# out_bin = "matcheroni_test",
#)

hancho(
rules.cpp_test,
name = "parseroni_test",
in_srcs = "parseroni_test.cpp",
out_bin = "parseroni_test",
)

0 comments on commit 3e5d696

Please sign in to comment.