Skip to content

Commit 0ef8a3b

Browse files
author
Andy C
committed
[build] Add implicity dependency on Souffle
1 parent 397f398 commit 0ef8a3b

File tree

2 files changed

+19
-9
lines changed

2 files changed

+19
-9
lines changed

build/ninja_lib.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,6 @@ def log(msg, *args):
9494
# ysh-static ->
9595
#
9696
# _bin/cxx-opt+norl/bin/oils_for_unix.mycpp
97-
9897
('cxx', 'opt+norl'),
9998

10099
#('clang', 'asan'),
@@ -392,7 +391,11 @@ def asdl_library(self,
392391
generated_headers=[out_header],
393392
)
394393

395-
def py_binary(self, main_py, deps_base_dir='_build/NINJA', template='py'):
394+
def py_binary(self,
395+
main_py,
396+
deps_base_dir='_build/NINJA',
397+
template='py',
398+
implicit=None):
396399
"""Wrapper for Python script with dynamically discovered deps
397400
398401
Args:
@@ -403,6 +406,8 @@ def py_binary(self, main_py, deps_base_dir='_build/NINJA', template='py'):
403406
- using dependencies from prebuilt/ninja/mycpp.mycpp_main/deps.txt
404407
- with the 'shwrap-mycpp' template defined in build/ninja-lib.sh
405408
"""
409+
implicit = implicit or []
410+
406411
rel_path, _ = os.path.splitext(main_py)
407412
# asdl/asdl_main.py -> asdl.asdl_main
408413
py_module = rel_path.replace('/', '.')
@@ -416,6 +421,7 @@ def py_binary(self, main_py, deps_base_dir='_build/NINJA', template='py'):
416421
shwrap_name = os.path.basename(rel_path)
417422
self.n.build('_bin/shwrap/%s' % shwrap_name,
418423
'write-shwrap', [main_py] + deps,
424+
implicit=implicit,
419425
variables=[('template', template)])
420426
self.n.newline()
421427

mycpp/NINJA_subgraph.py

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,12 @@
1515
def DefineTargets(ru):
1616

1717
# Creates _bin/shwrap/mycpp_main
18-
ru.py_binary('mycpp/mycpp_main.py',
19-
deps_base_dir='prebuilt/ninja',
20-
template='mycpp')
18+
ru.py_binary(
19+
'mycpp/mycpp_main.py',
20+
deps_base_dir='prebuilt/ninja',
21+
template='mycpp',
22+
implicit=['_bin/datalog/dataflow'],
23+
)
2124

2225
# mycpp wrapper that depends on _bin/datalog/dataflow, a binary created
2326
# from Souffle datalog!
@@ -218,10 +221,11 @@ def NinjaGraph(ru):
218221
description='mycpp-souffle $mypypath $preamble_path $out $in')
219222
n.newline()
220223

221-
n.rule('translate-mycpp-nosouffle',
222-
command=
223-
'_bin/shwrap/mycpp_main_nosouffle $mypypath $preamble_path $out $in',
224-
description='mycpp-nosouffle $mypypath $preamble_path $out $in')
224+
n.rule(
225+
'translate-mycpp-nosouffle',
226+
command=
227+
'_bin/shwrap/mycpp_main_nosouffle $mypypath $preamble_path $out $in',
228+
description='mycpp-nosouffle $mypypath $preamble_path $out $in')
225229
n.newline()
226230

227231
n.rule('translate-pea',

0 commit comments

Comments
 (0)