diff options
author | Vitaly Stoyan <vitstn@gmail.com> | 2023-12-21 12:53:31 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-12-21 12:53:31 +0300 |
commit | 037dc17c006d158a227672e21578612a85178728 (patch) | |
tree | cc864bbddba0b2c06cbcaade4c202cd91458a4db /build | |
parent | 35f1f39580e30e0736ffd75eaa3a815aa8f21860 (diff) | |
download | ydb-037dc17c006d158a227672e21578612a85178728.tar.gz |
init (#610)
Diffstat (limited to 'build')
-rw-r--r-- | build/plugins/cp.py | 21 | ||||
-rw-r--r-- | build/plugins/llvm_bc.py | 6 |
2 files changed, 23 insertions, 4 deletions
diff --git a/build/plugins/cp.py b/build/plugins/cp.py index 5c663a3bdd..ca41fd3b7e 100644 --- a/build/plugins/cp.py +++ b/build/plugins/cp.py @@ -4,14 +4,25 @@ from _common import sort_by_keywords def oncopy(unit, *args): - keywords = {'RESULT': 1, 'KEEP_DIR_STRUCT': 0, 'DESTINATION': 1, 'FROM': 1} + keywords = { + 'RESULT': 1, + 'KEEP_DIR_STRUCT': 0, + 'DESTINATION': 1, + 'FROM': 1, + 'OUTPUT_INCLUDES': -1, + 'AUTO': 0, + 'WITH_CONTEXT': 0, + } flat_args, spec_args = sort_by_keywords(keywords, args) dest_dir = spec_args['DESTINATION'][0] if 'DESTINATION' in spec_args else '' from_dir = spec_args['FROM'][0] if 'FROM' in spec_args else '' + output_includes = spec_args['OUTPUT_INCLUDES'] if 'OUTPUT_INCLUDES' in spec_args else None keep_struct = 'KEEP_DIR_STRUCT' in spec_args save_in_var = 'RESULT' in spec_args + auto = 'AUTO' in spec_args + with_context = 'WITH_CONTEXT' in spec_args targets = [] for source in flat_args: @@ -25,6 +36,12 @@ def oncopy(unit, *args): target_path = os.path.join(dest_dir, rel_path, filename) if save_in_var: targets.append(target_path) - unit.oncopy_file([source_path, target_path]) + unit.oncopy_file( + [source_path, target_path] + + (['OUTPUT_INCLUDES'] + output_includes if output_includes else []) + + (['OUTPUT_INCLUDES', source_path] if with_context else []) + + (['AUTO'] if auto else []) + ) + if save_in_var: unit.set([spec_args["RESULT"][0], " ".join(targets)]) diff --git a/build/plugins/llvm_bc.py b/build/plugins/llvm_bc.py index b41c106fe2..bd1e4099f2 100644 --- a/build/plugins/llvm_bc.py +++ b/build/plugins/llvm_bc.py @@ -2,10 +2,12 @@ from _common import rootrel_arc_src, sort_by_keywords, skip_build_root def onllvm_bc(unit, *args): - free_args, kwds = sort_by_keywords({'SYMBOLS': -1, 'NAME': 1, 'GENERATE_MACHINE_CODE': 0, 'NO_COMPILE': 0}, args) + free_args, kwds = sort_by_keywords( + {'SYMBOLS': -1, 'NAME': 1, 'GENERATE_MACHINE_CODE': 0, 'NO_COMPILE': 0, 'SUFFIX': 1}, args + ) name = kwds['NAME'][0] symbols = kwds.get('SYMBOLS') - obj_suf = unit.get('OBJ_SUF') + obj_suf = kwds['SUFFIX'][0] if 'SUFFIX' in kwds else '' + unit.get('OBJ_SUF') skip_compile_step = 'NO_COMPILE' in kwds merged_bc = name + '_merged' + obj_suf + '.bc' out_bc = name + '_optimized' + obj_suf + '.bc' |