Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Andy C committed Dec 6, 2024
1 parent 2880faf commit 2b864f6
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 25 deletions.
4 changes: 2 additions & 2 deletions bin/NINJA_subgraph.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,9 @@ def NinjaGraph(ru):
('preamble', 'cpp/preamble.h'),
]
if translator == 'mycpp':
shwrap_path = '_bin/shwrap/mycpp_main'
shwrap_path = '_bin/shwrap/mycpp_main'
else:
shwrap_path = '_bin/shwrap/mycpp_main_souffle'
shwrap_path = '_bin/shwrap/mycpp_main_souffle'

n.build(outputs,
'gen-oils-for-unix',
Expand Down
7 changes: 6 additions & 1 deletion build/ninja_lib.py
Original file line number Diff line number Diff line change
Expand Up @@ -517,7 +517,12 @@ def asdl_library(self,
generated_headers=[out_header],
)

def py_binary(self, main_py, deps_base_dir='_build/NINJA', deps_path=None, shwrap_name=None, template='py'):
def py_binary(self,
main_py,
deps_base_dir='_build/NINJA',
deps_path=None,
shwrap_name=None,
template='py'):
"""
Wrapper for Python script with dynamically discovered deps
Expand Down
47 changes: 25 additions & 22 deletions mycpp/NINJA_subgraph.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,14 @@ def DefineTargets(ru):
deps_path='prebuilt/ninja/mycpp_main_souffle/deps.txt',
shwrap_name='mycpp_main_souffle',
template='mycpp')
ru.n.build('_bin/shwrap/mycpp_main_souffle',
'write-shwrap',
# data log must be built first!
#implicit=['_bin/shwrap/mycpp_main','_bin/datalog/dataflow'],
implicit=['_bin/shwrap/mycpp_main'],
variables=[('template', 'mycpp-souffle')],
)
ru.n.build(
'_bin/shwrap/mycpp_main_souffle',
'write-shwrap',
# data log must be built first!
#implicit=['_bin/shwrap/mycpp_main','_bin/datalog/dataflow'],
implicit=['_bin/shwrap/mycpp_main'],
variables=[('template', 'mycpp-souffle')],
)

ru.cc_library(
'//mycpp/runtime',
Expand Down Expand Up @@ -225,13 +226,17 @@ def TranslatorSubgraph(ru, translator, ex):
main_cc_src = '_gen/mycpp/examples/%s.%s.cc' % (ex, translator)

# Make a translation unit
n.build(main_cc_src,
'wrap-cc',
raw,
implicit=[RULES_PY],
variables=[('name', ex), ('preamble_path', preamble_path),
# translator is used to determine wrap-cc
('translator', os.path.basename(translator_wrapper))])
n.build(
main_cc_src,
'wrap-cc',
raw,
implicit=[RULES_PY],
variables=[
('name', ex),
('preamble_path', preamble_path),
# translator is used to determine wrap-cc
('translator', os.path.basename(translator_wrapper))
])

n.newline()

Expand Down Expand Up @@ -288,16 +293,14 @@ def NinjaGraph(ru):
n.newline()

# mycpp and pea have the same interface
n.rule(
'translate-mycpp',
command='_bin/shwrap/mycpp_main $mypypath $out $in',
description='mycpp $mypypath $out $in')
n.rule('translate-mycpp',
command='_bin/shwrap/mycpp_main $mypypath $out $in',
description='mycpp $mypypath $out $in')
n.newline()

n.rule(
'translate-mycpp-souffle',
command='_bin/shwrap/mycpp_main_souffle $mypypath $out $in',
description='mycpp-souffle $mypypath $out $in')
n.rule('translate-mycpp-souffle',
command='_bin/shwrap/mycpp_main_souffle $mypypath $out $in',
description='mycpp-souffle $mypypath $out $in')
n.newline()

n.rule('translate-pea',
Expand Down

0 comments on commit 2b864f6

Please sign in to comment.