Christoffer Jansson | 4e8a773 | 2022-02-08 09:01:12 +0100 | [diff] [blame^] | 1 | #!/usr/bin/env vpython3 |
| 2 | |
Joel Sutherland | d2fb1bf | 2018-10-02 16:08:25 -0400 | [diff] [blame] | 3 | # Copyright (c) 2018 The WebRTC project authors. All Rights Reserved. |
| 4 | # |
| 5 | # Use of this source code is governed by a BSD-style license |
| 6 | # that can be found in the LICENSE file in the root of the source |
| 7 | # tree. An additional intellectual property rights grant can be found |
| 8 | # in the file PATENTS. All contributing project authors may |
| 9 | # be found in the AUTHORS file in the root of the source tree. |
| 10 | |
| 11 | import argparse |
| 12 | import sys |
| 13 | |
Mirko Bonadei | 8cc6695 | 2020-10-30 10:13:45 +0100 | [diff] [blame] | 14 | |
Joel Sutherland | d2fb1bf | 2018-10-02 16:08:25 -0400 | [diff] [blame] | 15 | def GenerateModulemap(): |
Christoffer Jansson | 4e8a773 | 2022-02-08 09:01:12 +0100 | [diff] [blame^] | 16 | parser = argparse.ArgumentParser(description='Generate modulemap') |
| 17 | parser.add_argument("-o", "--out", type=str, help="Output file.") |
| 18 | parser.add_argument("-n", "--name", type=str, help="Name of binary.") |
Joel Sutherland | d2fb1bf | 2018-10-02 16:08:25 -0400 | [diff] [blame] | 19 | |
Christoffer Jansson | 4e8a773 | 2022-02-08 09:01:12 +0100 | [diff] [blame^] | 20 | args = parser.parse_args() |
Joel Sutherland | d2fb1bf | 2018-10-02 16:08:25 -0400 | [diff] [blame] | 21 | |
Christoffer Jansson | 4e8a773 | 2022-02-08 09:01:12 +0100 | [diff] [blame^] | 22 | with open(args.out, "w") as outfile: |
| 23 | module_template = 'framework module %s {\n' \ |
| 24 | ' umbrella header "%s.h"\n' \ |
| 25 | '\n' \ |
| 26 | ' export *\n' \ |
| 27 | ' module * { export * }\n' \ |
| 28 | '}\n' % (args.name, args.name) |
| 29 | outfile.write(module_template) |
| 30 | return 0 |
Joel Sutherland | d2fb1bf | 2018-10-02 16:08:25 -0400 | [diff] [blame] | 31 | |
| 32 | |
| 33 | if __name__ == '__main__': |
Christoffer Jansson | 4e8a773 | 2022-02-08 09:01:12 +0100 | [diff] [blame^] | 34 | sys.exit(GenerateModulemap()) |