Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Force the python binding libraries to shared #536

Merged
merged 1 commit into from
Aug 27, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions PyIlmBase/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,10 @@ include(config/ModuleDefine.cmake)
##########################
add_subdirectory(config)

if(NOT BUILD_SHARED_LIBS)
message(WARNING "Forcing python bindings to be built with dynamic libraries")
endif()

add_subdirectory( PyIex )
add_subdirectory( PyImath )
if(TARGET Python2::IlmBaseNumPy OR TARGET Python3::IlmBaseNumPy)
Expand Down
20 changes: 11 additions & 9 deletions PyIlmBase/config/ModuleDefine.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,17 @@ function(PYILMBASE_ADD_LIBRARY_PRIV libname)
cmake_parse_arguments(PYILMBASE_CURLIB "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})


# let the default behaviour BUILD_SHARED_LIBS control the
# disposition of the default library...
add_library(${libname} ${PYILMBASE_CURLIB_SOURCE})
if(BUILD_SHARED_LIBS)
set_target_properties(${libname} PROPERTIES
SOVERSION ${PYILMBASE_SOVERSION}
VERSION ${PYILMBASE_LIB_VERSION}
)
endif()
# Currently, the python bindings REQUIRE a shared library for
# the Iex stuff to be initialized correctly. As such, force that
# here
# TODO Change this back when these bindings are refactored
add_library(${libname} SHARED ${PYILMBASE_CURLIB_SOURCE})
#if(BUILD_SHARED_LIBS)
set_target_properties(${libname} PROPERTIES
SOVERSION ${PYILMBASE_SOVERSION}
VERSION ${PYILMBASE_LIB_VERSION}
)
#endif()
set_target_properties(${libname} PROPERTIES
OUTPUT_NAME "${PYILMBASE_OUTPUT_OUTROOT}${libname}${PYILMBASE_LIB_SUFFIX}"
)
Expand Down