Skip to content

Commit 8458563

Browse files
authored
Merge pull request #348 from isuruf/hide
Hide all symbols except PyInit_symengine_wrapper
2 parents 04ae3b1 + 16690b7 commit 8458563

File tree

4 files changed

+16
-5
lines changed

4 files changed

+16
-5
lines changed

cmake/FindPython.cmake

+10-3
Original file line numberDiff line numberDiff line change
@@ -112,12 +112,19 @@ macro(ADD_PYTHON_LIBRARY name)
112112
# and "-flat_namespace -undefined suppress" link flags, that we need
113113
# to add by hand:
114114
set_target_properties(${name} PROPERTIES
115-
LINK_FLAGS "-flat_namespace -undefined suppress")
116-
ELSE(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
115+
LINK_FLAGS "-flat_namespace -undefined suppress -Wl,--exported_symbol,_PyInit_${name}")
116+
ELSEIF(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
117117
# on Linux, we need to use the "-shared" gcc flag, which is what SHARED
118118
# does:
119+
set(PYTHON_EXTENSION_NAME ${name})
119120
add_library(${name} SHARED ${ARGN})
120-
ENDIF(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
121+
configure_file(${CMAKE_SOURCE_DIR}/cmake/version_script.txt
122+
${CMAKE_CURRENT_BINARY_DIR}/version_script_${name}.txt @ONLY)
123+
set_target_properties(${name} PROPERTIES
124+
LINK_FLAGS "-Wl,--version-script=${CMAKE_CURRENT_BINARY_DIR}/version_script_${name}.txt")
125+
ELSE()
126+
add_library(${name} SHARED ${ARGN})
127+
ENDIF()
121128
set_target_properties(${name} PROPERTIES PREFIX "")
122129
set_target_properties(${name} PROPERTIES OUTPUT_NAME "${name}${PYTHON_EXTENSION_SOABI}")
123130
IF(${CMAKE_SYSTEM_NAME} STREQUAL "Windows")

cmake/version_script.txt

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
global: PyInit_@PYTHON_EXTENSION_NAME@;
3+
local: *;
4+
};

setup.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ def finalize_options(self):
214214
'''
215215

216216
setup(name="symengine",
217-
version="0.7.0.post3",
217+
version="0.7.1",
218218
description="Python library providing wrappers to SymEngine",
219219
setup_requires=['cython>=0.19.1'],
220220
long_description=long_description,

symengine/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ def lambdify(args, exprs, **kwargs):
5555
return Lambdify(args, *exprs, **kwargs)
5656

5757

58-
__version__ = "0.7.0.post3"
58+
__version__ = "0.7.1"
5959

6060

6161
# To not expose internals

0 commit comments

Comments
 (0)