Commit 48a8fa37 authored by scoder's avatar scoder

Merge pull request #142 from mongi3/master

Added "--capi-reexport-cincludes" option
parents ab4e40c1 959c98dc
......@@ -36,6 +36,7 @@ Options:
--embed[=<method_name>] Generate a main() function that embeds the Python interpreter.
-2 Compile based on Python-2 syntax and code semantics.
-3 Compile based on Python-3 syntax and code semantics.
--capi-reexport-cincludes Add cincluded headers to any auto-generated header files.
--fast-fail Abort the compilation on the first error
--warning-errors, -Werror Make all warnings into errors
--warning-extra, -Wextra Enable extra warnings
......@@ -128,6 +129,8 @@ def parse_command_line(args):
options.language_level = 2
elif option == '-3':
options.language_level = 3
elif option == "--capi-reexport-cincludes":
options.capi_reexport_cincludes = True
elif option == "--fast-fail":
Options.fast_fail = True
elif option in ('-Werror', '--warning-errors'):
......
......@@ -453,6 +453,9 @@ class CompilationOptions(object):
include_path [string] Directories to search for include files
output_file string Name of generated .c file
generate_pxi boolean Generate .pxi file for public declarations
capi_reexport_cincludes
boolean Add cincluded headers to any auto-generated
header files.
recursive boolean Recursively find and compile dependencies
timestamps boolean Only compile changed source files. If None,
defaults to true when recursive is true.
......@@ -654,6 +657,7 @@ default_options = dict(
output_file = None,
annotate = None,
generate_pxi = 0,
capi_reexport_cincludes = 0,
working_path = "",
recursive = 0,
timestamps = None,
......
......@@ -152,6 +152,8 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
h_code.put_h_guard(h_guard)
h_code.putln("")
self.generate_type_header_code(h_types, h_code)
if options.capi_reexport_cincludes:
self.generate_includes(env, [], h_code)
h_code.putln("")
api_guard = Naming.api_guard_prefix + self.api_name(env)
h_code.putln("#ifndef %s" % api_guard)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment