ENH: Move to a def solution to avoid polluting header file with declspec
This commit is contained in:
parent
72de930d08
commit
c5c3ca370e
|
@ -23,17 +23,26 @@ SET(OpenJPEG_SRCS
|
||||||
tgt.c
|
tgt.c
|
||||||
)
|
)
|
||||||
|
|
||||||
# Handle the dllimport/dllexport for building shared lib on Win32
|
IF(WIN32 AND BUILD_SHARED_LIBS)
|
||||||
IF (WIN32)
|
SET(UNDERSCORE)
|
||||||
IF (BUILD_SHARED_LIBS)
|
IF(BORLAND)
|
||||||
ADD_DEFINITIONS(-DOPJ_SHARED)
|
SET(UNDERSCORE "_")
|
||||||
ELSE (BUILD_SHARED_LIBS)
|
ENDIF(BORLAND)
|
||||||
ADD_DEFINITIONS(-DOPJ_STATIC)
|
CONFIGURE_FILE(
|
||||||
ENDIF (BUILD_SHARED_LIBS)
|
${OPENJPEG_SOURCE_DIR}/libopenjpeg/openjpeg.def.in
|
||||||
ENDIF (WIN32)
|
${OPENJPEG_BINARY_DIR}/libopenjpeg/openjpeg.def
|
||||||
|
@ONLY IMMEDIATE
|
||||||
|
)
|
||||||
|
IF(NOT BORLAND)
|
||||||
|
SET(OpenJPEG_SRCS ${OpenJPEG_SRCS}
|
||||||
|
${OPENJPEG_BINARY_DIR}/libopenjpeg/openjpeg.def
|
||||||
|
)
|
||||||
|
ENDIF(NOT BORLAND)
|
||||||
|
ENDIF(WIN32 AND BUILD_SHARED_LIBS)
|
||||||
|
|
||||||
# Create the library
|
# Create the library
|
||||||
ADD_LIBRARY(${OPJ_PREFIX}openjpeg ${OpenJPEG_SRCS})
|
ADD_LIBRARY(${OPJ_PREFIX}openjpeg ${OpenJPEG_SRCS})
|
||||||
|
|
||||||
# Install library
|
# Install library
|
||||||
INSTALL_TARGETS(/lib/ ${OPJ_PREFIX}openjpeg)
|
INSTALL_TARGETS(/lib/ ${OPJ_PREFIX}openjpeg)
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,17 @@
|
||||||
|
LIBRARY openjpeg.dll
|
||||||
|
EXPORTS @UNDERSCORE@opj_image_create
|
||||||
|
@UNDERSCORE@opj_image_destroy
|
||||||
|
@UNDERSCORE@opj_cio_open
|
||||||
|
@UNDERSCORE@opj_cio_close
|
||||||
|
@UNDERSCORE@cio_tell
|
||||||
|
@UNDERSCORE@opj_set_event_mgr
|
||||||
|
@UNDERSCORE@opj_create_decompress
|
||||||
|
@UNDERSCORE@opj_destroy_decompress
|
||||||
|
@UNDERSCORE@opj_set_default_decoder_parameters
|
||||||
|
@UNDERSCORE@opj_setup_decoder
|
||||||
|
@UNDERSCORE@opj_decode
|
||||||
|
@UNDERSCORE@opj_create_compress
|
||||||
|
@UNDERSCORE@opj_destroy_compress
|
||||||
|
@UNDERSCORE@opj_set_default_encoder_parameters
|
||||||
|
@UNDERSCORE@opj_setup_encoder
|
||||||
|
@UNDERSCORE@opj_encode
|
|
@ -32,19 +32,7 @@
|
||||||
|
|
||||||
#define OPENJPEG_VERSION "1.0.0"
|
#define OPENJPEG_VERSION "1.0.0"
|
||||||
|
|
||||||
#if defined(_WIN32) && !defined (OPJ_STATIC)
|
|
||||||
#ifdef OPJ_SHARED
|
|
||||||
#define OPJ_EXPORT __declspec(dllexport)
|
|
||||||
#else
|
|
||||||
#define OPJ_EXPORT __declspec(dllimport)
|
|
||||||
#endif
|
|
||||||
#else
|
|
||||||
#ifdef OPJ_STATIC
|
|
||||||
#define OPJ_EXPORT extern
|
|
||||||
#else
|
|
||||||
#define OPJ_EXPORT
|
#define OPJ_EXPORT
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
==========================================================
|
==========================================================
|
||||||
|
|
Loading…
Reference in New Issue