Skip to content

Commit

Permalink
remove most of the ninja build
Browse files Browse the repository at this point in the history
  • Loading branch information
aappleby committed Jun 4, 2024
1 parent 86df5ac commit 42e33e2
Show file tree
Hide file tree
Showing 8 changed files with 25 additions and 87 deletions.
33 changes: 15 additions & 18 deletions build.hancho
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,18 @@

import hancho

imports.config = hancho.Config(build_tag = "debug")
imports.rules = hancho.load("config/rules.hancho", imports)
imports.c_lexer = hancho.load("examples/c_lexer/c_lexer.hancho", imports)
imports.c_parser = hancho.load("examples/c_parser/c_parser.hancho", imports)

exports.c_lexer = imports.c_lexer
exports.c_parser = imports.c_parser
exports.json = hancho.load("examples/json/json.hancho", imports)
exports.regex = hancho.load("examples/regex/regex.hancho", imports)
exports.toml = hancho.load("examples/toml/toml.hancho", imports)
exports.tests = hancho.load("tests/tests.hancho", imports)
exports.tutorial = hancho.load("examples/tutorial/tutorial.hancho", imports)

exports.ini = imports.rules.c_library(
imports.config,
in_srcs = "examples/ini/ini_parser.cpp",
out_lib = "examples/ini/ini_parser.a",
)
exports.config = hancho.Config(build_tag = "debug")
exports.rules = hancho.load("symlinks/hancho/rules.hancho", exports)
exports.c_lexer = hancho.load("examples/c_lexer/c_lexer.hancho", exports)
#exports.c_parser = hancho.load("examples/c_parser/c_parser.hancho", exports)
#exports.json = hancho.load("examples/json/json.hancho", exports)
#exports.regex = hancho.load("examples/regex/regex.hancho", exports)
#exports.toml = hancho.load("examples/toml/toml.hancho", exports)
#exports.tests = hancho.load("tests/tests.hancho", exports)
#exports.tutorial = hancho.load("examples/tutorial/tutorial.hancho", exports)
#
#exports.ini = exports.rules.c_library(
# exports.config,
# in_srcs = "examples/ini/ini_parser.cpp",
# out_lib = "examples/ini/ini_parser.a",
#)
File renamed without changes.
File renamed without changes.
9 changes: 0 additions & 9 deletions config/config_DEBUG.ninja

This file was deleted.

7 changes: 0 additions & 7 deletions config/config_RELEASE.ninja

This file was deleted.

5 changes: 0 additions & 5 deletions config/config_SIZE.ninja

This file was deleted.

44 changes: 0 additions & 44 deletions config/rules.ninja

This file was deleted.

14 changes: 10 additions & 4 deletions examples/c_lexer/c_lexer.hancho
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,31 @@
rules = imports.rules
config = imports.config

c_lexer_lib = rules.c_library(
config = config.extend(
includes = [".", "{repo_path}"],
)

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

rules.c_test(
config,
in_srcs = "c_lexer_test.cpp",
in_libs = c_lexer_lib,
out_bin = "c_lexer_test",
libs = c_lexer_lib,
quiet = True,
)

rules.c_binary(
rules.cpp_bin(
config,
name = "c_lexer_benchmark",
in_srcs = "c_lexer_benchmark.cpp",
in_libs = c_lexer_lib,
out_bin = "c_lexer_benchmark",
libs = c_lexer_lib,
)

exports.lib = c_lexer_lib

0 comments on commit 42e33e2

Please sign in to comment.