Compile python bindings with -fvisibility=hidden, when possible. Closes #515.
This commit is contained in:
@@ -15,7 +15,7 @@ import Build
|
||||
import Utils
|
||||
|
||||
## https://launchpad.net/pybindgen/
|
||||
REQUIRED_PYBINDGEN_VERSION = (0, 10, 0, 626)
|
||||
REQUIRED_PYBINDGEN_VERSION = (0, 10, 0, 630)
|
||||
REQUIRED_PYGCCXML_VERSION = (0, 9, 5)
|
||||
|
||||
|
||||
@@ -70,6 +70,12 @@ def configure(conf):
|
||||
conf.report_optional_feature("python", "Python Bindings", False, str(ex))
|
||||
return
|
||||
|
||||
# -fvisibility=hidden optimization
|
||||
if conf.env['CXX_NAME'] == 'gcc' and conf.env['CC_VERSION'] >= (4,0,0):
|
||||
conf.env.append_value('CXXFLAGS_PYEXT', '-fvisibility=hidden')
|
||||
if conf.env['CC_NAME'] == 'gcc' and conf.env['CC_VERSION'] >= (4,0,0):
|
||||
conf.env.append_value('CCFLAGS_PYEXT', '-fvisibility=hidden')
|
||||
|
||||
# Check for the location of pybindgen
|
||||
if Options.options.with_pybindgen is not None:
|
||||
if os.path.isdir(Options.options.with_pybindgen):
|
||||
|
||||
Reference in New Issue
Block a user