Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
setuptools_dso
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
setuptools_dso
Commits
54e2ce01
Commit
54e2ce01
authored
Jan 22, 2021
by
Michael Davidsaver
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
example
parent
0a8ac378
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
14 deletions
+19
-14
example/setup.py
example/setup.py
+6
-0
example/src/dsodemo/__init__.py
example/src/dsodemo/__init__.py
+13
-0
example/src/dsodemo/cli.py
example/src/dsodemo/cli.py
+0
-14
No files found.
example/setup.py
View file @
54e2ce01
...
@@ -4,11 +4,17 @@ from setuptools_dso import DSO, Extension, setup
...
@@ -4,11 +4,17 @@ from setuptools_dso import DSO, Extension, setup
dso
=
DSO
(
'dsodemo.lib.demo'
,
[
'src/foo.c'
,
'src/bar.cpp'
],
dso
=
DSO
(
'dsodemo.lib.demo'
,
[
'src/foo.c'
,
'src/bar.cpp'
],
define_macros
=
[(
'BUILD_FOO'
,
None
)],
define_macros
=
[(
'BUILD_FOO'
,
None
)],
# demonstrate passing other compiler flags, either conditionally or not.
# these are not actually used.
extra_compile_args
=
[
'-DALL'
],
extra_compile_args
=
[
'-DALL'
],
lang_compile_args
=
{
lang_compile_args
=
{
'c'
:[
'-DISC'
],
'c'
:[
'-DISC'
],
'c++'
:[
'-DISCXX'
],
'c++'
:[
'-DISCXX'
],
},
},
# demonstrate how to set an SONAME.
# eg. on linux the result will be two files:
# dsodemo/lib/libdemo.so
# dsodemo/lib/libdemo.so.1.0
soversion
=
'1.0'
,
soversion
=
'1.0'
,
)
)
...
...
example/src/dsodemo/__init__.py
View file @
54e2ce01
import
sys
,
os
def
fixpath
():
path
=
os
.
environ
.
get
(
'PATH'
,
''
).
split
(
os
.
pathsep
)
libdir
=
os
.
path
.
join
(
os
.
path
.
dirname
(
__file__
),
'lib'
)
path
.
append
(
libdir
)
os
.
environ
[
'PATH'
]
=
os
.
pathsep
.
join
(
path
)
if
hasattr
(
os
,
'add_dll_directory'
):
os
.
add_dll_directory
(
libdir
)
if
sys
.
platform
==
"win32"
:
fixpath
()
example/src/dsodemo/cli.py
View file @
54e2ce01
from
__future__
import
print_function
from
__future__
import
print_function
import
sys
,
os
def
fixpath
():
path
=
os
.
environ
.
get
(
'PATH'
,
''
).
split
(
os
.
pathsep
)
libdir
=
os
.
path
.
join
(
os
.
path
.
dirname
(
__file__
),
'lib'
)
path
.
append
(
libdir
)
os
.
environ
[
'PATH'
]
=
os
.
pathsep
.
join
(
path
)
if
hasattr
(
os
,
'add_dll_directory'
):
os
.
add_dll_directory
(
libdir
)
if
sys
.
platform
==
"win32"
:
fixpath
()
from
.ext
import
dtest
from
.ext
import
dtest
if
__name__
==
'__main__'
:
if
__name__
==
'__main__'
:
...
...
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