Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
P
protobuf
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
protobuf
Commits
2ea2ad20
Commit
2ea2ad20
authored
7 years ago
by
Bo Yang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix setup.py for windows build.
parent
91317c29
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
4 deletions
+22
-4
setup.py
python/setup.py
+22
-4
No files found.
python/setup.py
View file @
2ea2ad20
...
...
@@ -178,9 +178,6 @@ if __name__ == '__main__':
# extension. Note that those libraries have to be compiled with
# -fPIC for this to work.
compile_static_ext
=
get_option_from_sys_argv
(
'--compile_static_extension'
)
extra_compile_args
=
[
'-Wno-write-strings'
,
'-Wno-invalid-offsetof'
,
'-Wno-sign-compare'
]
libraries
=
[
'protobuf'
]
extra_objects
=
None
if
compile_static_ext
:
...
...
@@ -189,6 +186,27 @@ if __name__ == '__main__':
'../src/.libs/libprotobuf-lite.a'
]
test_conformance
.
target
=
'test_python_cpp'
extra_compile_args
=
[]
if
sys
.
platform
!=
'win32'
:
extra_compile_args
.
append
(
'-Wno-write-strings'
)
extra_compile_args
.
append
(
'-Wno-invalid-offsetof'
)
extra_compile_args
.
append
(
'-Wno-sign-compare'
)
# https://github.com/Theano/Theano/issues/4926
if
sys
.
platform
==
'win32'
:
extra_compile_args
.
append
(
'-D_hypot=hypot'
)
# https://github.com/tpaviot/pythonocc-core/issues/48
if
sys
.
platform
==
'win32'
and
'64 bit'
in
sys
.
version
:
extra_compile_args
.
append
(
'-DMS_WIN64'
)
# MSVS default is dymanic
if
(
sys
.
platform
==
'win32'
and
((
sys
.
version_info
[
0
]
==
3
and
sys
.
version_info
[
1
]
==
5
)
or
(
sys
.
version_info
[
0
]
==
3
and
sys
.
version_info
[
1
]
==
6
))):
extra_compile_args
.
append
(
'/MT'
)
if
"clang"
in
os
.
popen
(
'$CC --version 2> /dev/null'
)
.
read
():
extra_compile_args
.
append
(
'-Wno-shorten-64-to-32'
)
...
...
@@ -216,7 +234,7 @@ if __name__ == '__main__':
Extension
(
"google.protobuf.internal._api_implementation"
,
glob
.
glob
(
'google/protobuf/internal/api_implementation.cc'
),
extra_compile_args
=
[
'-DPYTHON_PROTO2_CPP_IMPL_V2'
],
extra_compile_args
=
extra_compile_args
+
[
'-DPYTHON_PROTO2_CPP_IMPL_V2'
],
),
])
os
.
environ
[
'PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION'
]
=
'cpp'
...
...
This diff is collapsed.
Click to expand it.
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