Skip to content

Commit

Permalink
No commit message
Browse files Browse the repository at this point in the history
  • Loading branch information
brechtsanders committed Dec 31, 2017
1 parent 671373b commit 2c925bf
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 16 deletions.
12 changes: 1 addition & 11 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -42,25 +42,15 @@ IF(BUILD_SHARED)
ENDIF()

FOREACH(LINKTYPE ${LINKTYPES})
#SET(LINKTYPEDEFINE)
#IF(LINKTYPE STREQUAL "STATIC")
# SET(LINKTYPEDEFINE "BUILD_XLSXIO_STATIC")
#ENDIF()
#IF(LINKTYPE STREQUAL "SHARED")
# SET(LINKTYPEDEFINE "BUILD_XLSXIO_DLL")
#ENDIF()

ADD_LIBRARY(xlsxio_read_${LINKTYPE} ${LINKTYPE} lib/xlsxio_read.c lib/xlsxio_read_sharedstrings.c)
#SET_TARGET_PROPERTIES(xlsxio_read_${LINKTYPE} PROPERTIES COMPILE_DEFINITIONS ${LINKTYPEDEFINE})
SET_TARGET_PROPERTIES(xlsxio_read_${LINKTYPE} PROPERTIES COMPILE_DEFINITIONS "BUILD_XLSXIO")
SET_TARGET_PROPERTIES(xlsxio_read_${LINKTYPE} PROPERTIES DEFINE_SYMBOL "BUILD_XLSXIO_DLL")
SET_TARGET_PROPERTIES(xlsxio_read_${LINKTYPE} PROPERTIES DEFINE_SYMBOL "BUILD_XLSXIO_${LINKTYPE}")
SET_TARGET_PROPERTIES(xlsxio_read_${LINKTYPE} PROPERTIES OUTPUT_NAME xlsxio_read)
TARGET_INCLUDE_DIRECTORIES(xlsxio_read_${LINKTYPE} PRIVATE lib)
TARGET_LINK_LIBRARIES(xlsxio_read_${LINKTYPE} ${LIBZIP_LIBRARIES} ${EXPAT_LIBRARIES})
SET(ALLTARGETS ${ALLTARGETS} xlsxio_read_${LINKTYPE})

ADD_LIBRARY(xlsxio_write_${LINKTYPE} ${LINKTYPE} lib/xlsxio_write.c)
#SET_TARGET_PROPERTIES(xlsxio_write_${LINKTYPE} PROPERTIES COMPILE_DEFINITIONS ${LINKTYPEDEFINE})
SET_TARGET_PROPERTIES(xlsxio_write_${LINKTYPE} PROPERTIES COMPILE_DEFINITIONS "BUILD_XLSXIO")
SET_TARGET_PROPERTIES(xlsxio_write_${LINKTYPE} PROPERTIES DEFINE_SYMBOL "BUILD_XLSXIO_DLL")
SET_TARGET_PROPERTIES(xlsxio_write_${LINKTYPE} PROPERTIES OUTPUT_NAME xlsxio_write)
Expand Down
4 changes: 4 additions & 0 deletions Changelog.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
0.2.11

2017-12-31 Brecht Sanders https://github.com/brechtsanders/

* fixed CMakeLists.txt for proper DLL builds on Windows

2017-11-28 Brecht Sanders https://github.com/brechtsanders/

* fixed bug in XML_Char_poscpy when compiled for UTF-16 (thanks to https://github.com/dsmccall)
Expand Down
17 changes: 16 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,15 @@ CP = cp -f
CPDIR = cp -rf
DOXYGEN := $(shell which doxygen)

OSALIAS := $(OS)
ifeq ($(OS),Windows_NT)
ifneq (,$(findstring x86_64,$(shell gcc --version)))
OSALIAS := win64
else
OSALIAS := win32
endif
endif

XLSXIOREAD_OBJ = lib/xlsxio_read.o lib/xlsxio_read_sharedstrings.o
XLSXIOREAD_LDFLAGS = -lzip -lexpat
XLSXIOREADW_LDFLAGS = -lzip -lexpatw
Expand Down Expand Up @@ -177,7 +186,13 @@ package: version
.PHONY: package
binarypackage: version
$(MAKE) PREFIX=binarypackage_temp install STATICDLL=1
tar cfJ "xlsxio-$(shell cat version)-$(OS).tar.xz" --transform="s?^binarypackage_temp/??" $(COMMON_PACKAGE_FILES) binarypackage_temp/*
ifneq ($(OS),Windows_NT)
tar cfJ "xlsxio-$(shell cat version)-$(OSALIAS).tar.xz" --transform="s?^binarypackage_temp/??" $(COMMON_PACKAGE_FILES) binarypackage_temp/*
else
rm -f xlsxio-$(shell cat version)-$(OSALIAS).zip
cp -f $(COMMON_PACKAGE_FILES) binarypackage_temp/
cd binarypackage_temp && zip -r -9 "../xlsxio-$(shell cat version)-binary-$(OSALIAS).zip" $(COMMON_PACKAGE_FILES) * && cd ..
endif
rm -rf binarypackage_temp

.PHONY: clean
Expand Down
2 changes: 1 addition & 1 deletion include/xlsxio_read.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ typedef unsigned __int64 uint64_t;
/*! \cond PRIVATE */
#ifndef DLL_EXPORT_XLSXIO
#ifdef _WIN32
#if defined(BUILD_XLSXIO_DLL)
#if defined(BUILD_XLSXIO_DLL) || defined(BUILD_XLSXIO_SHARED)
#define DLL_EXPORT_XLSXIO __declspec(dllexport)
#elif !defined(STATIC) && !defined(BUILD_XLSXIO_STATIC) && !defined(BUILD_XLSXIO)
#define DLL_EXPORT_XLSXIO __declspec(dllimport)
Expand Down
2 changes: 1 addition & 1 deletion include/xlsxio_write.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ typedef signed __int64 int64_t;
/*! \cond PRIVATE */
#ifndef DLL_EXPORT_XLSXIO
#ifdef _WIN32
#if defined(BUILD_XLSXIO_DLL)
#if defined(BUILD_XLSXIO_DLL) || defined(BUILD_XLSXIO_SHARED)
#define DLL_EXPORT_XLSXIO __declspec(dllexport)
#elif !defined(STATIC) && !defined(BUILD_XLSXIO_STATIC) && !defined(BUILD_XLSXIO)
#define DLL_EXPORT_XLSXIO __declspec(dllimport)
Expand Down
2 changes: 1 addition & 1 deletion lib/xlsxio_private.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#ifndef INCLUDED_XLSXIO_PRIVATE_H
#define INCLUDED_XLSXIO_PRIVATE_H

#if (defined(STATIC) || defined(BUILD_XLSXIO_STATIC) || defined(BUILD_XLSXIO_STATIC_DLL) || (defined(BUILD_XLSXIO) && !defined(BUILD_XLSXIO_DLL))) && !defined(ZIP_STATIC)
#if (defined(STATIC) || defined(BUILD_XLSXIO_STATIC) || defined(BUILD_XLSXIO_STATIC_DLL) || (defined(BUILD_XLSXIO) && !defined(BUILD_XLSXIO_DLL) && !defined(BUILD_XLSXIO_SHARED))) && !defined(ZIP_STATIC)
#define ZIP_STATIC
#endif
#include <zip.h>
Expand Down
2 changes: 1 addition & 1 deletion lib/xlsxio_write.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#endif
#include <fcntl.h>
#include <stdarg.h>
#if (defined(STATIC) || defined(BUILD_XLSXIO_STATIC) || defined(BUILD_XLSXIO_STATIC_DLL) || (defined(BUILD_XLSXIO) && !defined(BUILD_XLSXIO_DLL))) && !defined(ZIP_STATIC)
#if (defined(STATIC) || defined(BUILD_XLSXIO_STATIC) || defined(BUILD_XLSXIO_STATIC_DLL) || (defined(BUILD_XLSXIO) && !defined(BUILD_XLSXIO_DLL) && !defined(BUILD_XLSXIO_SHARED))) && !defined(ZIP_STATIC)
#define ZIP_STATIC
#endif
#include <zip.h>
Expand Down

0 comments on commit 2c925bf

Please sign in to comment.