"put generated C files in temp directory"),
('pyrex-gen-pxi', None,
"generate .pxi file for public declarations"),
+ ('pyrex-directives=', None,
+ "compiler directive overrides"),
])
boolean_options.extend([
self.pyrex_create_listing = 0
self.pyrex_line_directives = 0
self.pyrex_include_dirs = None
+ self.pyrex_directives = None
self.pyrex_c_in_temp = 0
self.pyrex_gen_pxi = 0
elif type(self.pyrex_include_dirs) is StringType:
self.pyrex_include_dirs = \
self.pyrex_include_dirs.split(os.pathsep)
+ if self.pyrex_directives is None:
+ self.pyrex_directives = {}
# finalize_options ()
def build_extensions(self):
if not i in includes:
includes.append(i)
+ # Set up Cython compiler directives:
+ # 1. Start with the command line option.
+ # 2. Add in any (unique) entries from the extension
+ # pyrex_directives (if Cython.Distutils.extension is used).
+ directives = self.pyrex_directives
+ directives.update(extension.pyrex_directives)
+
# Set the target_ext to '.c'. Cython will change this to '.cpp' if
# needed.
if cplus:
options = CompilationOptions(pyrex_default_options,
use_listing_file = create_listing,
include_path = includes,
+ compiler_directives = directives,
output_file = target,
cplus = cplus,
emit_linenums = line_directives,
"""pyrex_include_dirs : [string]
list of directories to search for Pyrex header files (.pxd) (in
Unix form for portability)
+ pyrex_directives : {string:value}
+ dict of compiler directives
pyrex_create_listing_file : boolean
write pyrex error messages to a listing (.lis) file.
pyrex_line_directivess : boolean
depends = None,
language = None,
pyrex_include_dirs = None,
+ pyrex_directives = None,
pyrex_create_listing = 0,
pyrex_line_directives = 0,
pyrex_cplus = 0,
**kw)
self.pyrex_include_dirs = pyrex_include_dirs or []
+ self.pyrex_directives = pyrex_directives or {}
self.pyrex_create_listing = pyrex_create_listing
self.pyrex_line_directives = pyrex_line_directives
self.pyrex_cplus = pyrex_cplus