aboutsummaryrefslogtreecommitdiffstats
path: root/build/scripts/rodata2cpp.py
diff options
context:
space:
mode:
authormonster <monster@ydb.tech>2022-07-07 14:41:37 +0300
committermonster <monster@ydb.tech>2022-07-07 14:41:37 +0300
commit06e5c21a835c0e923506c4ff27929f34e00761c2 (patch)
tree75efcbc6854ef9bd476eb8bf00cc5c900da436a2 /build/scripts/rodata2cpp.py
parent03f024c4412e3aa613bb543cf1660176320ba8f4 (diff)
downloadydb-06e5c21a835c0e923506c4ff27929f34e00761c2.tar.gz
fix ya.make
Diffstat (limited to 'build/scripts/rodata2cpp.py')
-rw-r--r--build/scripts/rodata2cpp.py34
1 files changed, 0 insertions, 34 deletions
diff --git a/build/scripts/rodata2cpp.py b/build/scripts/rodata2cpp.py
deleted file mode 100644
index be67d3af53a..00000000000
--- a/build/scripts/rodata2cpp.py
+++ /dev/null
@@ -1,34 +0,0 @@
-import argparse
-
-
-def main():
- parser = argparse.ArgumentParser(description='Convert rodata into C++ source with embedded file content')
- parser.add_argument('symbol', help='symbol name exported from generated file')
- parser.add_argument('rodata', type=argparse.FileType('rb'), help='input .rodata file path')
- parser.add_argument('cpp', type=argparse.FileType('w', encoding='UTF-8'), help='destination .cpp file path')
-
- args = parser.parse_args()
- args.cpp.write('static_assert(sizeof(unsigned int) == 4, "ups, something gone wrong");\n\n')
- args.cpp.write('extern "C" {\n')
- args.cpp.write(' extern const unsigned char ' + args.symbol + '[] = {\n')
-
- cnt = 0
-
- for ch in args.rodata.read():
- args.cpp.write('0x%02x, ' % ch)
-
- cnt += 1
-
- if cnt % 50 == 1:
- args.cpp.write('\n')
-
- args.cpp.write(' };\n')
- args.cpp.write(' extern const unsigned int ' + args.symbol + 'Size = sizeof(' + args.symbol + ');\n')
- args.cpp.write('}\n')
-
- args.rodata.close()
- args.cpp.close()
-
-
-if __name__ == '__main__':
- main()