Skip to content

Commit

Permalink
Merge pull request #348 from isuruf/hide
Browse files Browse the repository at this point in the history
Hide all symbols except PyInit_symengine_wrapper
  • Loading branch information
isuruf committed Mar 24, 2021
2 parents 04ae3b1 + 16690b7 commit 8458563
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 5 deletions.
13 changes: 10 additions & 3 deletions cmake/FindPython.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -112,12 +112,19 @@ macro(ADD_PYTHON_LIBRARY name)
# and "-flat_namespace -undefined suppress" link flags, that we need
# to add by hand:
set_target_properties(${name} PROPERTIES
LINK_FLAGS "-flat_namespace -undefined suppress")
ELSE(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
LINK_FLAGS "-flat_namespace -undefined suppress -Wl,--exported_symbol,_PyInit_${name}")
ELSEIF(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
# on Linux, we need to use the "-shared" gcc flag, which is what SHARED
# does:
set(PYTHON_EXTENSION_NAME ${name})
add_library(${name} SHARED ${ARGN})
ENDIF(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
configure_file(${CMAKE_SOURCE_DIR}/cmake/version_script.txt
${CMAKE_CURRENT_BINARY_DIR}/version_script_${name}.txt @ONLY)
set_target_properties(${name} PROPERTIES
LINK_FLAGS "-Wl,--version-script=${CMAKE_CURRENT_BINARY_DIR}/version_script_${name}.txt")
ELSE()
add_library(${name} SHARED ${ARGN})
ENDIF()
set_target_properties(${name} PROPERTIES PREFIX "")
set_target_properties(${name} PROPERTIES OUTPUT_NAME "${name}${PYTHON_EXTENSION_SOABI}")
IF(${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
Expand Down
4 changes: 4 additions & 0 deletions cmake/version_script.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
global: PyInit_@PYTHON_EXTENSION_NAME@;
local: *;
};
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ def finalize_options(self):
'''

setup(name="symengine",
version="0.7.0.post3",
version="0.7.1",
description="Python library providing wrappers to SymEngine",
setup_requires=['cython>=0.19.1'],
long_description=long_description,
Expand Down
2 changes: 1 addition & 1 deletion symengine/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def lambdify(args, exprs, **kwargs):
return Lambdify(args, *exprs, **kwargs)


__version__ = "0.7.0.post3"
__version__ = "0.7.1"


# To not expose internals
Expand Down

0 comments on commit 8458563

Please sign in to comment.