Skip to content

Commit

Permalink
Fix export of OPJ_STATIC macro
Browse files Browse the repository at this point in the history
  • Loading branch information
dg0yt authored and rouault committed Mar 4, 2024
1 parent 3beb2e1 commit 4b8b397
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions src/lib/openjp2/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -83,12 +83,12 @@ endif()

# Build the library
if(WIN32)
add_library(${OPENJPEG_LIBRARY_NAME} ${OPENJPEG_SRCS})
if(BUILD_SHARED_LIBS)
add_definitions(-DOPJ_EXPORTS)
target_compile_definitions(${OPENJPEG_LIBRARY_NAME} PRIVATE OPJ_EXPORTS)
else()
add_definitions(-DOPJ_STATIC)
target_compile_definitions(${OPENJPEG_LIBRARY_NAME} PUBLIC OPJ_STATIC)
endif()
add_library(${OPENJPEG_LIBRARY_NAME} ${OPENJPEG_SRCS})
set(INSTALL_LIBS ${OPENJPEG_LIBRARY_NAME})
else()
if(BUILD_SHARED_LIBS AND BUILD_STATIC_LIBS)
Expand Down
6 changes: 3 additions & 3 deletions src/lib/openjpip/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,14 @@ set(LOCAL_SRCS
)

# Build the library
add_library(openjpip ${OPENJPIP_SRCS} ${LOCAL_SRCS})
if(WIN32)
if(BUILD_SHARED_LIBS)
add_definitions(-DOPJ_EXPORTS)
target_compile_definitions(openjpip PRIVATE OPJ_EXPORTS)
else()
add_definitions(-DOPJ_STATIC)
target_compile_definitions(openjpip PUBLIC OPJ_STATIC)
endif()
endif()
add_library(openjpip ${OPENJPIP_SRCS} ${LOCAL_SRCS})
set_target_properties(openjpip
PROPERTIES ${OPENJPEG_LIBRARY_PROPERTIES})
target_compile_options(openjpip PRIVATE ${OPENJPEG_LIBRARY_COMPILE_OPTIONS})
Expand Down

0 comments on commit 4b8b397

Please sign in to comment.