Skip to content

Commit

Permalink
Fix issue with defines not being set correctly for win32
Browse files Browse the repository at this point in the history
we always build shared libraries now, so even if the default is to build
static, the python bindings are forced to build shared, which means they
need to set the defines to export the symbols appropriately, add extra
variable set

Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
  • Loading branch information
kdt3rd committed Nov 8, 2019
1 parent b303f67 commit d10895e
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions PyIlmBase/config/ModuleDefine.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -23,19 +23,21 @@ function(PYILMBASE_ADD_LIBRARY_PRIV libname)
OUTPUT_NAME "${PYILMBASE_CURLIB_OUTROOT}${libname}${PYILMBASE_LIB_SUFFIX}"
)
target_compile_features(${libname} PUBLIC cxx_std_${OPENEXR_CXX_STANDARD})
if(PYILMBASE_CURLIB_PRIV_EXPORT AND BUILD_SHARED_LIBS)
# we are always building shared, so don't check for that
if(PYILMBASE_CURLIB_PRIV_EXPORT)
target_compile_definitions(${libname} PRIVATE ${PYILMBASE_CURLIB_PRIV_EXPORT})
if(WIN32)
target_compile_definitions(${libname} PUBLIC OPENEXR_DLL)
endif()
endif()
target_compile_definitions(${libname} PUBLIC OPENEXR_DLL)

if(PYILMBASE_CURLIB_CURDIR)
target_include_directories(${libname} PUBLIC $<BUILD_INTERFACE:${PYILMBASE_CURLIB_CURDIR}>)
endif()
if(PYILMBASE_CURLIB_CURBINDIR)
target_include_directories(${libname} PRIVATE $<BUILD_INTERFACE:${PYILMBASE_CURLIB_CURBINDIR}>)
endif()
target_include_directories(${libname} PUBLIC ${Boost_INCLUDE_DIR})
if(Boost_INCLUDE_DIR)
target_include_directories(${libname} PUBLIC ${Boost_INCLUDE_DIR})
endif()
target_link_libraries(${libname} PUBLIC ${PYILMBASE_CURLIB_DEPENDENCIES})
if(PYILMBASE_CURLIB_PRIVATE_DEPS)
target_link_libraries(${libname} PRIVATE ${PYILMBASE_CURLIB_PRIVATE_DEPS})
Expand Down

0 comments on commit d10895e

Please sign in to comment.