-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor
mk_def_file()
so that it is usable externally via a new
function ``mk_def_file_internal()`` which is called by a new ``mk_def_file.py`` script. This will allow other build systems to generate the ``api_dll.def`` file.
- Loading branch information
Dan Liew
committed
Mar 4, 2016
1 parent
ce54f6d
commit 46ac368
Showing
2 changed files
with
49 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,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_util | ||
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) | ||
|
||
for api_file in pargs.api_files: | ||
if not os.path.exists(api_file): | ||
logging.error('"{}" does not exist'.format(api_file)) | ||
return 1 | ||
|
||
mk_util.mk_def_file_internal( | ||
pargs.output_file, | ||
pargs.dllname, | ||
pargs.api_files) | ||
return 0 | ||
|
||
if __name__ == '__main__': | ||
sys.exit(main(sys.argv[1:])) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters