From 2b864f6bf094492de78c3934c4b6f4e41c45fdc8 Mon Sep 17 00:00:00 2001 From: Andy C Date: Fri, 6 Dec 2024 14:47:19 -0500 Subject: [PATCH] fix --- bin/NINJA_subgraph.py | 4 ++-- build/ninja_lib.py | 7 +++++- mycpp/NINJA_subgraph.py | 47 ++++++++++++++++++++++------------------- 3 files changed, 33 insertions(+), 25 deletions(-) diff --git a/bin/NINJA_subgraph.py b/bin/NINJA_subgraph.py index 9f6f02a54..ea0a9e806 100644 --- a/bin/NINJA_subgraph.py +++ b/bin/NINJA_subgraph.py @@ -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', diff --git a/build/ninja_lib.py b/build/ninja_lib.py index f3b7d4ba0..2ef17cc4e 100644 --- a/build/ninja_lib.py +++ b/build/ninja_lib.py @@ -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 diff --git a/mycpp/NINJA_subgraph.py b/mycpp/NINJA_subgraph.py index 0d43a4a5c..7705b8c68 100644 --- a/mycpp/NINJA_subgraph.py +++ b/mycpp/NINJA_subgraph.py @@ -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', @@ -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() @@ -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',