Commit 0c7c88e6 authored by Brennan Ashton's avatar Brennan Ashton Committed by GitHub

Fix static library builds (#13)

Signed-off-by: default avatarBrennan Ashton <bashton@brennanashton.com>
parent 0c0453a0
......@@ -43,9 +43,6 @@ option(BUILD_SHARED_LIBS "Build Shared Libraries" ON)
if(BUILD_SHARED_LIBS)
set (LIB_TYPE SHARED)
else(BUILD_SHARED_LIBS)
if(WIN32)
message(WARNING "You will have to modify libaec.h for static libs.")
endif(WIN32)
set(LIB_TYPE STATIC)
endif(BUILD_SHARED_LIBS)
......
include (GenerateExportHeader)
add_library(aec ${LIB_TYPE} ${libaec_SRCS})
set_target_properties(aec PROPERTIES VERSION 0.0.10 SOVERSION 0)
generate_export_header(aec
BASE_NAME libaec
EXPORT_MACRO_NAME libaec_EXPORT
EXPORT_FILE_NAME ${PROJECT_BINARY_DIR}/libaec_Export.h
STATIC_DEFINE libaec_BUILT_AS_STATIC
)
add_library(sz ${LIB_TYPE} sz_compat.c)
set_target_properties(sz PROPERTIES VERSION 2.0.1 SOVERSION 2)
......@@ -41,7 +49,7 @@ else(WIN32)
DESTINATION ${CMAKE_INSTALL_FULL_MANDIR}/man1 COMPONENT doc)
endif(WIN32)
install(FILES libaec.h szlib.h
install(FILES libaec.h szlib.h ${PROJECT_BINARY_DIR}/libaec_Export.h
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
COMPONENT headers)
install(TARGETS aec_client
......
......@@ -52,20 +52,12 @@
#include <stddef.h>
#include "libaec_Export.h"
#ifdef __cplusplus
extern "C"{
#endif
#if BUILDING_LIBAEC && HAVE_VISIBILITY
# define LIBAEC_DLL_EXPORTED __attribute__((__visibility__("default")))
#elif BUILDING_LIBAEC && defined _MSC_VER
# define LIBAEC_DLL_EXPORTED __declspec(dllexport)
#elif defined _MSC_VER
# define LIBAEC_DLL_EXPORTED __declspec(dllimport)
#else
# define LIBAEC_DLL_EXPORTED
#endif
struct internal_state;
struct aec_stream {
......@@ -155,19 +147,19 @@ struct aec_stream {
/*********************************************/
/* Streaming encoding and decoding functions */
/*********************************************/
LIBAEC_DLL_EXPORTED int aec_encode_init(struct aec_stream *strm);
LIBAEC_DLL_EXPORTED int aec_encode(struct aec_stream *strm, int flush);
LIBAEC_DLL_EXPORTED int aec_encode_end(struct aec_stream *strm);
libaec_EXPORT int aec_encode_init(struct aec_stream *strm);
libaec_EXPORT int aec_encode(struct aec_stream *strm, int flush);
libaec_EXPORT int aec_encode_end(struct aec_stream *strm);
LIBAEC_DLL_EXPORTED int aec_decode_init(struct aec_stream *strm);
LIBAEC_DLL_EXPORTED int aec_decode(struct aec_stream *strm, int flush);
LIBAEC_DLL_EXPORTED int aec_decode_end(struct aec_stream *strm);
libaec_EXPORT int aec_decode_init(struct aec_stream *strm);
libaec_EXPORT int aec_decode(struct aec_stream *strm, int flush);
libaec_EXPORT int aec_decode_end(struct aec_stream *strm);
/***************************************************************/
/* Utility functions for encoding or decoding a memory buffer. */
/***************************************************************/
LIBAEC_DLL_EXPORTED int aec_buffer_encode(struct aec_stream *strm);
LIBAEC_DLL_EXPORTED int aec_buffer_decode(struct aec_stream *strm);
libaec_EXPORT int aec_buffer_encode(struct aec_stream *strm);
libaec_EXPORT int aec_buffer_decode(struct aec_stream *strm);
#ifdef __cplusplus
}
......
......@@ -80,15 +80,15 @@ typedef struct SZ_com_t_s
int pixels_per_scanline;
} SZ_com_t;
LIBAEC_DLL_EXPORTED int SZ_BufftoBuffCompress(
libaec_EXPORT int SZ_BufftoBuffCompress(
void *dest, size_t *destLen,
const void *source, size_t sourceLen,
SZ_com_t *param);
LIBAEC_DLL_EXPORTED int SZ_BufftoBuffDecompress(
libaec_EXPORT int SZ_BufftoBuffDecompress(
void *dest, size_t *destLen,
const void *source, size_t sourceLen,
SZ_com_t *param);
LIBAEC_DLL_EXPORTED int SZ_encoder_enabled(void);
libaec_EXPORT int SZ_encoder_enabled(void);
#endif /* SZLIB_H */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment