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
b2122025
Commit
b2122025
authored
Feb 24, 2021
by
Michael Davidsaver
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
doc
parent
0adb63b5
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
4 deletions
+12
-4
src/setuptools_dso/dsocmd.py
src/setuptools_dso/dsocmd.py
+12
-4
No files found.
src/setuptools_dso/dsocmd.py
View file @
b2122025
...
...
@@ -93,6 +93,7 @@ class DSO(_Extension):
class
dso2libmixin
:
def
dso2lib_pre
(
self
,
ext
):
# ext may be our Extension or DSO
mypath
=
os
.
path
.
join
(
'.'
,
*
ext
.
name
.
split
(
'.'
)[:
-
1
])
soargs
=
set
()
...
...
@@ -112,7 +113,7 @@ class dso2libmixin:
dsosearch
=
[
os
.
path
.
join
(
self
.
build_lib
,
*
parts
[:
-
1
])]
# maybe we just built it
try
:
# a
ssume
this DSO lives in an external package.
# a
lso check if
this DSO lives in an external package.
dsobase
=
os
.
path
.
dirname
(
import_module
(
parts
[
0
]).
__file__
)
dsodir
=
os
.
path
.
join
(
dsobase
,
*
parts
[
1
:
-
1
])
dsosearch
.
append
(
dsodir
)
...
...
@@ -224,6 +225,9 @@ class build_dso(dso2libmixin, Command):
self.build_dso(dso)
def _name2file(self, dso, so=False):
"""Translate DSO name (eg. "pkg.mod.mylib" into
"pkg/mod/mylib.so" or (if so==True) "pkg/mod/mylib.so.0"
"""
parts = dso.name.split('
.
')
if sys.platform == "win32":
...
...
@@ -245,13 +249,16 @@ class build_dso(dso2libmixin, Command):
def build_dso(self, dso):
# dso is an instance of DSO
self.dso2lib_pre(dso)
expand_sources(self, dso.sources)
expand_sources(self, dso.depends)
baselib = self._name2file(dso)
solib = self._name2file(dso, so=True)
baselib = self._name2file(dso) # eg. "pkg/mod/mylib.so"
solib = self._name2file(dso, so=True) # eg. "pkg/mod/mylib.so.0"
# on windows always baselib==solib
# prepend staging area path
outbaselib = os.path.join(self.build_lib, baselib)
outlib = os.path.join(self.build_lib, solib)
sources = list(dso.sources)
...
...
@@ -315,7 +322,7 @@ class build_dso(dso2libmixin, Command):
objects.extend(dso.extra_objects)
extra_args = dso.extra_link_args or []
solibbase = os.path.basename(solib)
solibbase = os.path.basename(solib)
# eg. "mylib.so.0"
if sys.platform == '
darwin
':
# we always want to produce relocatable (movable) binaries
...
...
@@ -325,6 +332,7 @@ class build_dso(dso2libmixin, Command):
elif sys.platform == "win32":
# The .lib is considered "temporary" for extensions, but not for us
# so we pass export_symbols=None and put it along side the .dll
# eg. "pkg
\
mod
\
mylib.dll" and "pkg
\
mod
\
mylib.lib"
extra_args.append('
/
IMPLIB
:
%
s
.
lib
'%(os.path.splitext(outlib)[0]))
elif baselib!=solib: # ELF
...
...
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