blob: 4609385c3861e6fd6fc07368db3d306cf7a4648e [file] [log] [blame]
Joel Sutherlandd2fb1bf2018-10-02 16:08:25 -04001# Copyright (c) 2018 The WebRTC project authors. All Rights Reserved.
2#
3# Use of this source code is governed by a BSD-style license
4# that can be found in the LICENSE file in the root of the source
5# tree. An additional intellectual property rights grant can be found
6# in the file PATENTS. All contributing project authors may
7# be found in the AUTHORS file in the root of the source tree.
8
9import argparse
10import sys
11
Mirko Bonadei8cc66952020-10-30 10:13:45 +010012
Joel Sutherlandd2fb1bf2018-10-02 16:08:25 -040013def GenerateModulemap():
Mirko Bonadei8cc66952020-10-30 10:13:45 +010014 parser = argparse.ArgumentParser(description='Generate modulemap')
15 parser.add_argument("-o", "--out", type=str, help="Output file.")
16 parser.add_argument("-n", "--name", type=str, help="Name of binary.")
Joel Sutherlandd2fb1bf2018-10-02 16:08:25 -040017
Mirko Bonadei8cc66952020-10-30 10:13:45 +010018 args = parser.parse_args()
Joel Sutherlandd2fb1bf2018-10-02 16:08:25 -040019
Mirko Bonadei8cc66952020-10-30 10:13:45 +010020 with open(args.out, "w") as outfile:
21 module_template = 'framework module %s {\n' \
22 ' umbrella header "%s.h"\n' \
23 '\n' \
24 ' export *\n' \
25 ' module * { export * }\n' \
26 '}\n' % (args.name, args.name)
27 outfile.write(module_template)
28 return 0
Joel Sutherlandd2fb1bf2018-10-02 16:08:25 -040029
30
31if __name__ == '__main__':
Mirko Bonadei8cc66952020-10-30 10:13:45 +010032 sys.exit(GenerateModulemap())