Skip to content

Commit

Permalink
[build] Add implicit dep on shell code generator
Browse files Browse the repository at this point in the history
This is an one-off fix for #1313.  We could do something more principled
like _bin/shwrap, and a n.build() wrapper.
  • Loading branch information
Andy C committed Sep 16, 2022
1 parent 6ae7836 commit d378027
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
1 change: 0 additions & 1 deletion build/ninja-rules-py.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ example-main() {

cat <<EOF
int main(int argc, char **argv) {
// gHeap.Init(512);
gHeap.Init(128 << 10); // 128 KiB; doubling in size
// gHeap.Init(400 << 20); // 400 MiB to avoid garbage collection
Expand Down
13 changes: 8 additions & 5 deletions mycpp/NINJA_subgraph.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@
mycpp/
NINJA_subgraph.py # This file describes dependencies programmatically
build.sh # wrappers invoked by the Toil and devtools/release.sh
test.sh # test driver for unit tests and examples
TEST.sh # test driver for unit tests and examples
examples/
cgi.py
Expand Down Expand Up @@ -79,7 +77,7 @@
Also:
- .wwz archive of all the logs.
- Turn it into HTML and link to logs. Basically just like Toil does.
- Turn it into HTML and link to logs. Basically just like Soil does.
Notes for Oil:
Expand All @@ -106,6 +104,10 @@

from build.ninja_lib import asdl_cpp, log, ObjPath

# TODO:
# - Fold this dependency into a proper shwrap wrapper
# - Make a n.build() wrapper that takes it into account automatically
RULES_PY = 'build/ninja-rules-py.sh'

# special ones in examples.sh:
# - parse
Expand Down Expand Up @@ -283,6 +285,7 @@ def TranslatorSubgraph(n, translator, ex, phony):

# Make a translation unit
n.build(main_cc_src, 'wrap-cc', raw,
implicit=[RULES_PY],
variables=[
('name', ex),
('preamble_path', preamble_path),
Expand Down Expand Up @@ -433,7 +436,7 @@ def NinjaGraph(n):

prefix = '_gen/bin/osh_eval.mycpp'
n.build([prefix + '.cc'], 'gen-osh-eval', deps,
implicit=['_bin/shwrap/mycpp_main'],
implicit=['_bin/shwrap/mycpp_main', RULES_PY],
variables=[('out_prefix', prefix)])

#
Expand Down

0 comments on commit d378027

Please sign in to comment.