Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
nexedi
cython
Commits
083cceb6
Commit
083cceb6
authored
Jul 22, 2010
by
Chuck Blake
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add pyrex_directives dictionary optional attribute of Extension objects to
support distutils/setup.py-based directives setting.
parent
482734b7
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
0 deletions
+17
-0
Cython/Distutils/build_ext.py
Cython/Distutils/build_ext.py
+13
-0
Cython/Distutils/extension.py
Cython/Distutils/extension.py
+4
-0
No files found.
Cython/Distutils/build_ext.py
View file @
083cceb6
...
...
@@ -44,6 +44,8 @@ class build_ext(_build_ext.build_ext):
"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
([
...
...
@@ -56,6 +58,7 @@ class build_ext(_build_ext.build_ext):
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
...
...
@@ -66,6 +69,8 @@ class build_ext(_build_ext.build_ext):
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
):
...
...
@@ -139,6 +144,13 @@ class build_ext(_build_ext.build_ext):
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
:
...
...
@@ -189,6 +201,7 @@ class build_ext(_build_ext.build_ext):
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
,
...
...
Cython/Distutils/extension.py
View file @
083cceb6
...
...
@@ -19,6 +19,8 @@ class Extension(_Extension.Extension):
"""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
...
...
@@ -48,6 +50,7 @@ class Extension(_Extension.Extension):
depends
=
None
,
language
=
None
,
pyrex_include_dirs
=
None
,
pyrex_directives
=
None
,
pyrex_create_listing
=
0
,
pyrex_line_directives
=
0
,
pyrex_cplus
=
0
,
...
...
@@ -72,6 +75,7 @@ class Extension(_Extension.Extension):
**
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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment