Skip to content

Commit

Permalink
hancho build works
Browse files Browse the repository at this point in the history
  • Loading branch information
aappleby committed Mar 11, 2024
1 parent ea2d6ee commit 79411ce
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 15 deletions.
3 changes: 2 additions & 1 deletion build.hancho
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ from hancho import *

print("Building Matcheroni with Hancho")

if config.build_type is None: config.build_type = "debug"
#if config.build_type is None: config.build_type = "debug"
config.build_type = "release"

config.build_dir = "build/{build_type}"

Expand Down
2 changes: 1 addition & 1 deletion config/rules.hancho
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ link_c_lib = Rule(

link_c_bin = Rule(
desc = "Linking {files_out}",
command = "g++ {ld_opt} {warnings} {files_in} {deps} {sys_libs} -o {files_out}",
command = "g++ {ld_opt} {warnings} {files_in} {libs} {sys_libs} -o {files_out}",
ld_opt = "{'-O3' if build_type == 'release' else '-g -O0'}",
warnings = "-Wall",
)
Expand Down
4 changes: 2 additions & 2 deletions examples/c_lexer/c_lexer.hancho
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ c_lexer_lib = rules.c_library(
rules.c_test(
"c_lexer_test.cpp",
"c_lexer_test",
deps = c_lexer_lib,
libs = c_lexer_lib,
quiet = True,
)

rules.c_binary(
"c_lexer_benchmark.cpp",
"c_lexer_benchmark",
deps = c_lexer_lib,
libs = c_lexer_lib,
)
4 changes: 2 additions & 2 deletions examples/c_parser/c_parser.hancho
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ c_parser_lib = rules.c_library(
rules.c_binary(
"c_parser_benchmark.cpp",
"c_parser_benchmark",
deps = [c_lexer.c_lexer_lib, c_parser_lib],
libs = [c_lexer.c_lexer_lib, c_parser_lib],
)

# Broken?
#rules.c_test(
# "c_parser_test.cpp",
# "c_parser_test",
# deps = [c_lexer.c_lexer_lib, c_parser_lib],
# libs = [c_lexer.c_lexer_lib, c_parser_lib],
# quiet = True
#)
8 changes: 4 additions & 4 deletions examples/json/json.hancho
Original file line number Diff line number Diff line change
Expand Up @@ -12,24 +12,24 @@ json_parser = rules.c_library(
rules.c_binary(
"json_conformance.cpp",
"json_conformance",
deps = json_parser
libs = json_parser
)

rules.c_binary(
"json_benchmark.cpp",
"json_benchmark",
deps = json_parser,
libs = json_parser,
)

rules.c_binary(
"json_demo.cpp",
"json_demo",
deps = json_parser,
libs = json_parser,
)

rules.c_test(
"json_test.cpp",
"json_test",
deps = json_parser,
libs = json_parser,
quiet = True
)
6 changes: 3 additions & 3 deletions examples/regex/regex.hancho
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,19 @@ regex_parser = rules.c_library(
rules.c_binary(
"regex_demo.cpp",
"regex_demo",
deps = regex_parser,
libs = regex_parser,
)

rules.c_binary(
"regex_benchmark.cpp",
"regex_benchmark",
deps = regex_parser,
libs = regex_parser,
sys_libs = "-lboost_system -lboost_regex",
)

rules.c_test(
"regex_test.cpp",
"regex_test",
deps = regex_parser,
libs = regex_parser,
quiet = True
)
2 changes: 1 addition & 1 deletion examples/toml/toml.hancho
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ toml_lib = rules.c_library(
rules.c_test(
"toml_test.cpp",
"toml_test",
deps = toml_lib,
libs = toml_lib,
quiet = True
)
2 changes: 1 addition & 1 deletion examples/tutorial/tutorial.hancho
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@ rules.c_test("json_tut2b.cpp", "json_tut2b", quiet = True)
rules.c_binary(
"tiny_c_parser.cpp",
"tiny_c_parser",
deps = [c_lexer.c_lexer_lib, c_parser.c_parser_lib],
libs = [c_lexer.c_lexer_lib, c_parser.c_parser_lib],
)

0 comments on commit 79411ce

Please sign in to comment.