Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
pyodide
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
Boxiang Sun
pyodide
Commits
c2939bca
Commit
c2939bca
authored
Oct 26, 2018
by
Roman Yurchak
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Skip building C extensions for the target
(except for numpy)
parent
34384953
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
33 additions
and
0 deletions
+33
-0
pyodide_build/pywasmcross.py
pyodide_build/pywasmcross.py
+33
-0
No files found.
pyodide_build/pywasmcross.py
View file @
c2939bca
...
...
@@ -59,10 +59,43 @@ def collect_args(basename):
path
=
path
.
replace
(
str
(
ROOTDIR
)
+
':'
,
''
)
env
[
'PATH'
]
=
path
# determine the package name from the current directory
re_res
=
re
.
match
(
'.*packages/(?P<name>[
\
w
\
-]+)/build.*'
,
env
[
'PWD'
])
if
re_res
:
package_name
=
re_res
.
group
(
'name'
)
else
:
package_name
=
None
# Skip compilations of C/Fortran extensions for the target environement.
# We still need to generate the output files for distutils to continue
# the build.
# TODO: This may need slight tuning for new projects. In particular,
# currently ar is not skipped, so a known failure would happen when
# we create some object files (that are empty as gcc is skipped), on
# which we run the actual ar command.
skip
=
False
if
(
basename
in
[
'gcc'
,
'cc'
,
'c++'
,
'gfortran'
,
'ld'
]
and
'-o'
in
sys
.
argv
[
1
:]
# do not skip numpy as it is needed as build time
# dependency by other packages (e.g. matplotlib)
and
package_name
!=
'numpy'
):
out_idx
=
sys
.
argv
.
index
(
'-o'
)
if
(
out_idx
+
1
)
<
len
(
sys
.
argv
):
# get the index of the output file path
out_idx
+=
1
with
open
(
sys
.
argv
[
out_idx
],
'wb'
)
as
fh
:
fh
.
write
(
b''
)
skip
=
True
with
open
(
'build.log'
,
'a'
)
as
fd
:
if
skip
:
fd
.
write
(
'SKIP
\
n
'
)
json
.
dump
([
basename
]
+
sys
.
argv
[
1
:],
fd
)
fd
.
write
(
'
\
n
'
)
if
skip
:
sys
.
exit
(
0
)
sys
.
exit
(
subprocess
.
run
(
[
basename
]
+
sys
.
argv
[
1
:],
...
...
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