Skip to content

Commit

Permalink
Pre-generate gen_table.c
Browse files Browse the repository at this point in the history
This removes a build-time dependency on the py34-enum PyPI package. It
shouldn’t be necessary to install that package just to build the C/C++
libraries.
  • Loading branch information
sfiera committed Jan 30, 2018
1 parent 24a08d1 commit d800855
Show file tree
Hide file tree
Showing 3 changed files with 5,271 additions and 19 deletions.
4 changes: 3 additions & 1 deletion Makefile
Expand Up @@ -38,7 +38,9 @@ test-vim:

.PHONY: regen
regen:
src/c/scripts/gen.py --python=src/python/procyon/spec.py
src/c/scripts/gen.py \
--c=src/c/src/gen_table.c \
--python=src/python/procyon/spec.py

.PHONY: clean
clean:
Expand Down
19 changes: 1 addition & 18 deletions src/c/BUILD.gn
Expand Up @@ -14,7 +14,6 @@

static_library("procyon") {
sources = [
"$target_gen_dir/gen_table.c",
"include/procyon.h",
"src/common.c",
"src/common.h",
Expand All @@ -23,6 +22,7 @@ static_library("procyon") {
"src/error.c",
"src/file.c",
"src/format.c",
"src/gen_table.c",
"src/gen_table.h",
"src/io.c",
"src/lex.c",
Expand All @@ -43,27 +43,10 @@ static_library("procyon") {
sources += [ "src/file_linux.c" ]
}

deps = [
":gen_from_spec",
]

public_configs = [ ":procyon_public" ]
configs += [ ":procyon_private" ]
}

action("gen_from_spec") {
script = "scripts/gen.py"
gen_table = "$target_gen_dir/gen_table.c"

args = [ "--c=" + rebase_path(gen_table, root_build_dir) ]
inputs = [
"src/spec.pn",
]
outputs = [
gen_table,
]
}

config("procyon_public") {
include_dirs = [ "include" ]
libs = [ "-lm" ]
Expand Down

0 comments on commit d800855

Please sign in to comment.