Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
N
ngraph
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
ngraph
Commits
4ec6e731
Unverified
Commit
4ec6e731
authored
Mar 16, 2018
by
Scott Cyphers
Committed by
GitHub
Mar 16, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' into jennifer/contributing
parents
38756397
54e3b619
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
5 deletions
+26
-5
setup.py
python/setup.py
+15
-4
setup.py.in
python/setup.py.in
+11
-1
No files found.
python/setup.py
View file @
4ec6e731
...
...
@@ -209,21 +209,32 @@ ext_modules = [Extension(
class
BuildExt
(
build_ext
):
"""A custom build extension for adding compiler-specific options."""
"""
A custom build extension for adding compiler-specific options.
"""
def
build_extensions
(
self
):
ct
=
self
.
compiler
.
compiler_type
for
ext
in
self
.
extensions
:
ext
.
extra_compile_args
+=
[
cpp_flag
(
self
.
compiler
)]
ext
.
extra_compile_args
+=
[
'-w'
]
if
has_flag
(
self
.
compiler
,
'-fstack-protector-strong'
):
ext
.
extra_compile_args
+=
[
'-fstack-protector-strong'
]
else
:
ext
.
extra_compile_args
+=
[
'-fstack-protector'
]
if
has_flag
(
self
.
compiler
,
'-frtti'
):
ext
.
extra_compile_args
+=
[
'-frtti'
]
if
sys
.
platform
==
'darwin'
:
ext
.
extra_compile_args
+=
[
'-stdlib=libc++'
,
'-mmacosx-version-min=10.7'
]
ext
.
extra_link_args
+=
[
'-Wl,-rpath,@loader_path/../..'
]
ext
.
extra_link_args
+=
[
"-Wl,-rpath,@loader_path/../.."
]
else
:
if
has_flag
(
self
.
compiler
,
'-fvisibility=hidden'
):
ext
.
extra_compile_args
+=
[
'-fvisibility=hidden'
]
ext
.
extra_link_args
+=
[
'-Wl,-rpath,$ORIGIN/../..'
]
if
sys
.
platform
!=
'darwin'
:
ext
.
extra_link_args
+=
[
'-z'
,
'noexecstack'
]
ext
.
extra_link_args
+=
[
'-z'
,
'relro'
]
ext
.
extra_link_args
+=
[
'-z'
,
'now'
]
ext
.
extra_compile_args
+=
[
'-Wformat'
,
'-Wformat-security'
]
ext
.
extra_compile_args
+=
[
'-O2'
,
'-D_FORTIFY_SOURCE=2'
]
build_ext
.
build_extensions
(
self
)
...
...
python/setup.py.in
View file @
4ec6e731
...
...
@@ -226,6 +226,10 @@ class BuildExt(build_ext):
ct = self.compiler.compiler_type
for ext in self.extensions:
ext.extra_compile_args += [cpp_flag(self.compiler)]
if has_flag(self.compiler, '-fstack-protector-strong'):
ext.extra_compile_args += ['-fstack-protector-strong']
else:
ext.extra_compile_args += ['-fstack-protector']
if has_flag(self.compiler, '-frtti'):
ext.extra_compile_args += ['-frtti']
if sys.platform == 'darwin':
...
...
@@ -234,7 +238,13 @@ class BuildExt(build_ext):
else:
if has_flag(self.compiler, '-fvisibility=hidden'):
ext.extra_compile_args += ['-fvisibility=hidden']
ext.extra_link_args += ["-Wl,-rpath,$ORIGIN/../.."]
ext.extra_link_args += ['-Wl,-rpath,$ORIGIN/../..']
if sys.platform != 'darwin':
ext.extra_link_args += ['-z', 'noexecstack']
ext.extra_link_args += ['-z', 'relro']
ext.extra_link_args += ['-z', 'now']
ext.extra_compile_args += ['-Wformat', '-Wformat-security']
ext.extra_compile_args += ['-O2', '-D_FORTIFY_SOURCE=2']
build_ext.build_extensions(self)
...
...
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