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
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cython
Commits
57cc7cd2
Commit
57cc7cd2
authored
Jan 13, 2017
by
Karl Kempe
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add --src flag to add c/c++ src files (cythonmagic)
parent
3d4f7a19
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
1 deletion
+7
-1
Cython/Build/IpythonMagic.py
Cython/Build/IpythonMagic.py
+7
-1
No files found.
Cython/Build/IpythonMagic.py
View file @
57cc7cd2
...
@@ -188,6 +188,11 @@ class CythonMagics(Magics):
...
@@ -188,6 +188,11 @@ class CythonMagics(Magics):
help
=
"Add a path to the list of include directories (can be specified "
help
=
"Add a path to the list of include directories (can be specified "
"multiple times)."
"multiple times)."
)
)
@
magic_arguments
.
argument
(
'-S'
,
'--src'
,
action
=
'append'
,
default
=
[],
help
=
"Add a path to the list of src files (can be specified "
"multiple times)."
)
@
magic_arguments
.
argument
(
@
magic_arguments
.
argument
(
'-+'
,
'--cplus'
,
action
=
'store_true'
,
default
=
False
,
'-+'
,
'--cplus'
,
action
=
'store_true'
,
default
=
False
,
help
=
"Output a C++ rather than C file."
help
=
"Output a C++ rather than C file."
...
@@ -252,6 +257,7 @@ class CythonMagics(Magics):
...
@@ -252,6 +257,7 @@ class CythonMagics(Magics):
if
need_cythonize
:
if
need_cythonize
:
c_include_dirs
=
args
.
include
c_include_dirs
=
args
.
include
c_src_files
=
map
(
str
,
args
.
src
)
if
'numpy'
in
code
:
if
'numpy'
in
code
:
import
numpy
import
numpy
c_include_dirs
.
append
(
numpy
.
get_include
())
c_include_dirs
.
append
(
numpy
.
get_include
())
...
@@ -261,7 +267,7 @@ class CythonMagics(Magics):
...
@@ -261,7 +267,7 @@ class CythonMagics(Magics):
f
.
write
(
code
)
f
.
write
(
code
)
extension
=
Extension
(
extension
=
Extension
(
name
=
module_name
,
name
=
module_name
,
sources
=
[
pyx_file
],
sources
=
[
pyx_file
]
+
c_src_files
,
include_dirs
=
c_include_dirs
,
include_dirs
=
c_include_dirs
,
library_dirs
=
args
.
library_dirs
,
library_dirs
=
args
.
library_dirs
,
extra_compile_args
=
args
.
compile_args
,
extra_compile_args
=
args
.
compile_args
,
...
...
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