File: mk_def_file.py

package info (click to toggle)
z3 4.13.3-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 33,364 kB
  • sloc: cpp: 501,803; python: 16,788; cs: 10,567; java: 9,687; ml: 3,282; ansic: 2,531; sh: 162; javascript: 37; makefile: 32
file content (36 lines) | stat: -rwxr-xr-x 1,024 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#  - /usr/bin/env python
"""
Reads a list of Z3 API header files and
generate a ``.def`` file to define the
exported symbols of a dll. This file
can be passed to the ``/DEF`` to the
linker used by MSVC.
"""
import mk_genfile_common
import argparse
import logging
import os
import sys

def main(args):
    logging.basicConfig(level=logging.INFO)
    parser = argparse.ArgumentParser(description=__doc__)
    parser.add_argument("output_file", help="output def file path")
    parser.add_argument("dllname", help="dllname to use in def file")
    parser.add_argument("api_files", nargs="+")
    pargs = parser.parse_args(args)

    if not mk_genfile_common.check_files_exist(pargs.api_files):
        logging.error('One or more api files do not exist')
        return 1

    mk_genfile_common.mk_def_file_internal(
        pargs.output_file,
        pargs.dllname,
        pargs.api_files)
    logging.info('Generated "{}"'.format(pargs.output_file))
    return 0

if __name__ == '__main__':
    sys.exit(main(sys.argv[1:]))