From d2a70db4be03a650eabad3f23e68bed2117f71b4 Mon Sep 17 00:00:00 2001 From: Kamil Kasperczyk Date: Wed, 8 Nov 2023 14:51:56 +0100 Subject: [PATCH] Revert "[nrf noup] Fix ram_report and rom_report" This reverts commit f69982442400b85c388842601d4e9f6f597a043e. --- config/nrfconnect/chip-module/make_gn_args.py | 77 ------------------- 1 file changed, 77 deletions(-) delete mode 100755 config/nrfconnect/chip-module/make_gn_args.py diff --git a/config/nrfconnect/chip-module/make_gn_args.py b/config/nrfconnect/chip-module/make_gn_args.py deleted file mode 100755 index 3c3f611c00..0000000000 --- a/config/nrfconnect/chip-module/make_gn_args.py +++ /dev/null @@ -1,77 +0,0 @@ -#!/usr/bin/env python3 - -# -# Copyright (c) 2021 Project CHIP Authors -# All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -import argparse -import re -import sys - -GN_SPECIAL_CHARACTERS = r'(["$\\])' -GN_CFLAG_EXCLUDES = [ - '-fno-asynchronous-unwind-tables', - '-fno-common', - '-fno-defer-pop', - '-fno-reorder-functions', - '-ffunction-sections', - '-fdata-sections', - '-g', - '-g0', - '-g1', - '-g2', - '-g3', - '-O*', - '-W*', -] - - -def escape_strings(gn_args): - return [[key, re.sub(GN_SPECIAL_CHARACTERS, r'\\\1', value)] for key, value in gn_args] - - -def write_gn_args(args): - if args.module: - sys.stdout.write('import("{}")\n'.format(args.module)) - - for key, value in args.arg: - sys.stdout.write('{} = {}\n'.format(key, value)) - - for key, value in args.arg_string: - sys.stdout.write('{} = "{}"\n'.format(key, value)) - - cflag_excludes = ', '.join(['"{}"'.format(exclude) - for exclude in GN_CFLAG_EXCLUDES]) - - for key, value in args.arg_cflags: - sys.stdout.write('{} = filter_exclude(string_split("{}"), [{}])\n'.format( - key, value, cflag_excludes)) - - -def main(): - parser = argparse.ArgumentParser(fromfile_prefix_chars='@') - parser.add_argument('--module', action='store') - parser.add_argument('--arg', action='append', nargs=2, default=[]) - parser.add_argument('--arg-string', action='append', nargs=2, default=[]) - parser.add_argument('--arg-cflags', action='append', nargs=2, default=[]) - args = parser.parse_args() - args.arg_string = escape_strings(args.arg_string) - args.arg_cflags = escape_strings(args.arg_cflags) - write_gn_args(args) - - -if __name__ == "__main__": - main()