blob: 1b61b8e3d120dd56031d2c92098b491b09983283 [file] [log] [blame]
Christoffer Jansson4e8a7732022-02-08 09:01:12 +01001#!/usr/bin/env vpython3
2
Joel Sutherlandd2fb1bf2018-10-02 16:08:25 -04003# 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
11import argparse
12import sys
13
Mirko Bonadei8cc66952020-10-30 10:13:45 +010014
Joel Sutherlandd2fb1bf2018-10-02 16:08:25 -040015def GenerateModulemap():
Christoffer Jansson4e8a7732022-02-08 09:01:12 +010016 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 Sutherlandd2fb1bf2018-10-02 16:08:25 -040019
Christoffer Jansson4e8a7732022-02-08 09:01:12 +010020 args = parser.parse_args()
Joel Sutherlandd2fb1bf2018-10-02 16:08:25 -040021
Christoffer Jansson4e8a7732022-02-08 09:01:12 +010022 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 Sutherlandd2fb1bf2018-10-02 16:08:25 -040031
32
33if __name__ == '__main__':
Christoffer Jansson4e8a7732022-02-08 09:01:12 +010034 sys.exit(GenerateModulemap())