Skip to content

Commit

Permalink
Applies OPENEXR_DLL only to shared libraries and no longer to static …
Browse files Browse the repository at this point in the history
…libraries

Signed-off-by: Transporter <ogre.transporter@gmail.com>
  • Loading branch information
OgreTransporter authored and cary-ilm committed Jun 10, 2020
1 parent 90420f0 commit 2ba5d79
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions IlmBase/config/LibraryDefine.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ function(ILMBASE_DEFINE_LIBRARY libname)
# only do the object library mechanism in a few cases:
# - xcode doesn't handle "empty" targets (i.e. add_library with
# an object lib only)
# - under windows, we don't want the static library targets to
# have the export tags
# - if we're not compiling both, don't add the extra layer to prevent
# extra compiles since we aren't doing that anyway
if(ILMBASE_BUILD_BOTH_STATIC_SHARED AND NOT (APPLE OR WIN32))
Expand All @@ -39,7 +37,7 @@ function(ILMBASE_DEFINE_LIBRARY libname)
target_compile_features(${objlib} PUBLIC cxx_std_${OPENEXR_CXX_STANDARD})
if(ILMBASE_CURLIB_PRIV_EXPORT AND BUILD_SHARED_LIBS)
target_compile_definitions(${objlib} PRIVATE ${ILMBASE_CURLIB_PRIV_EXPORT})
if(WIN32)
if(WIN32 AND NOT ILMBASE_BUILD_BOTH_STATIC_SHARED)
target_compile_definitions(${objlib} PUBLIC OPENEXR_DLL)
endif()
endif()
Expand Down Expand Up @@ -113,6 +111,7 @@ function(ILMBASE_DEFINE_LIBRARY libname)
target_link_libraries(${libname}_static INTERFACE ${objlib})
else()
# have to build multiple times... but have different flags anyway (i.e. no dll)
target_compile_definitions(${libname} PRIVATE OPENEXR_DLL)
set(curlib ${libname}_static)
add_library(${curlib} STATIC ${ILMBASE_CURLIB_SOURCES})
target_compile_features(${curlib} PUBLIC cxx_std_${OPENEXR_CXX_STANDARD})
Expand Down

0 comments on commit 2ba5d79

Please sign in to comment.