diff options
author | thegeorg <thegeorg@yandex-team.com> | 2022-08-19 15:00:44 +0300 |
---|---|---|
committer | thegeorg <thegeorg@yandex-team.com> | 2022-08-19 15:00:44 +0300 |
commit | ad2a1b622d2bf6cf025982846153d9c4c791af2c (patch) | |
tree | 8906addc18a494ece9dff28b2701a37ef4b52bf8 /build/scripts/preprocess.py | |
parent | 7b61b052f3baa7e43edca48c373f95b5e5f1c845 (diff) | |
download | ydb-ad2a1b622d2bf6cf025982846153d9c4c791af2c.tar.gz |
Let cmake export determine which build/scripts are mandatory
Diffstat (limited to 'build/scripts/preprocess.py')
-rw-r--r-- | build/scripts/preprocess.py | 48 |
1 files changed, 0 insertions, 48 deletions
diff --git a/build/scripts/preprocess.py b/build/scripts/preprocess.py deleted file mode 100644 index 4657bef732e..00000000000 --- a/build/scripts/preprocess.py +++ /dev/null @@ -1,48 +0,0 @@ -import sys -import os - - -def load_file(p): - with open(p, 'r') as f: - return f.read() - - -def step(base, data, hh): - def flt(): - for l in data.split('\n'): - if l in hh: - pp = os.path.join(base, hh[l]) - - yield '\n\n' + load_file(pp) + '\n\n' - - os.unlink(pp) - else: - yield l - - return '\n'.join(flt()) - - -def subst_headers(path, headers): - hh = dict() - - for h in headers: - hh['# include "' + h + '"'] = h - - data = load_file(path) - prev = data - - while True: - ret = step(os.path.dirname(path), prev, hh) - - if ret == prev: - break - - prev = ret - - if data != prev: - with open(path, 'w') as f: - f.write(prev) - - -if __name__ == '__main__': - subst_headers(sys.argv[1], ['stack.hh', 'position.hh', 'location.hh']) |