From 3e9a22853835594ce0dcbe31d9883ef547e03a1d Mon Sep 17 00:00:00 2001 From: Xpol Wan Date: Tue, 5 Jul 2016 11:07:41 +0800 Subject: [PATCH 1/5] Enable static build for appveyor. and cleanup for appveyor build script. --- appveyor.yml | 28 ++++++++++++++++++++-------- 1 file changed, 20 insertions(+), 8 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 4765da5b..879cd0d7 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,14 +1,26 @@ version: '{build}' os: Visual Studio 2015 + +configuration: +- Debug + +environment: + matrix: + - SHARED: ON + STATIC: OFF + - SHARED: OFF + STATIC: ON + init: [] install: [] -build_script: -- git submodule init -- git submodule update -- set PATH=C:\Program Files (x86)\MSBuild\14.0\Bin;%PATH% -- mkdir build -- cd build -- cmake -G "Visual Studio 14 2015 Win64" -D SHARED=1 -D TESTS=1 .. -- cmake --build . --config Debug +before_build: +- git submodule update --init --recursive +- cmake -H. -Bbuild -G "Visual Studio 14 2015 Win64" -D SHARED=%SHARED% -D STATIC=%STATIC% -D TESTS=1 + +build: + project: build\xlnt.sln + parallel: true + verbosity: minimal + test_script: - bin\xlnt.test.exe From e214192de0f1baa15e1a08d1d643d3675793ff28 Mon Sep 17 00:00:00 2001 From: Xpol Wan Date: Tue, 5 Jul 2016 11:32:06 +0800 Subject: [PATCH 2/5] Debug appveyor. --- appveyor.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index 879cd0d7..2cafb661 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -15,7 +15,8 @@ init: [] install: [] before_build: - git submodule update --init --recursive -- cmake -H. -Bbuild -G "Visual Studio 14 2015 Win64" -D SHARED=%SHARED% -D STATIC=%STATIC% -D TESTS=1 +- echo cmake -H. -Bbuild -G"Visual Studio 14 2015 Win64" -DSHARED=%SHARED% -DSTATIC=%STATIC% -DTESTS=ON +- cmake -H. -Bbuild -G"Visual Studio 14 2015 Win64" -DSHARED=%SHARED% -DSTATIC=%STATIC% -DTESTS=ON build: project: build\xlnt.sln From 076d42280e67898600fb79c2975fd4be82363b6e Mon Sep 17 00:00:00 2001 From: Xpol Wan Date: Tue, 5 Jul 2016 11:41:41 +0800 Subject: [PATCH 3/5] Update test location. --- appveyor.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 2cafb661..b585531d 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -15,7 +15,6 @@ init: [] install: [] before_build: - git submodule update --init --recursive -- echo cmake -H. -Bbuild -G"Visual Studio 14 2015 Win64" -DSHARED=%SHARED% -DSTATIC=%STATIC% -DTESTS=ON - cmake -H. -Bbuild -G"Visual Studio 14 2015 Win64" -DSHARED=%SHARED% -DSTATIC=%STATIC% -DTESTS=ON build: @@ -24,4 +23,4 @@ build: verbosity: minimal test_script: -- bin\xlnt.test.exe +- build\bin\xlnt.test.exe From 4976f54145ba06d555bb81888f0dd943e6dec444 Mon Sep 17 00:00:00 2001 From: Xpol Wan Date: Tue, 5 Jul 2016 13:03:00 +0800 Subject: [PATCH 4/5] Fixes static build for msvc. --- cmake/xlnt.cmake | 2 +- include/xlnt/xlnt_config.hpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cmake/xlnt.cmake b/cmake/xlnt.cmake index 388cae4e..9d029a8b 100644 --- a/cmake/xlnt.cmake +++ b/cmake/xlnt.cmake @@ -103,7 +103,7 @@ endif() if(STATIC) add_library(xlnt.static STATIC ${HEADERS} ${SOURCES} ${MINIZ} ${PUGIXML}) - target_compile_definitions(xlnt.static PRIVATE XLNT_STATIC=1) + target_compile_definitions(xlnt.static PUBLIC XLNT_STATIC=1) install(TARGETS xlnt.static LIBRARY DESTINATION ${LIB_DEST_DIR} ARCHIVE DESTINATION ${LIB_DEST_DIR} diff --git a/include/xlnt/xlnt_config.hpp b/include/xlnt/xlnt_config.hpp index e30eb729..718f71bb 100644 --- a/include/xlnt/xlnt_config.hpp +++ b/include/xlnt/xlnt_config.hpp @@ -55,7 +55,7 @@ enum class limit_style const limit_style LimitStyle = limit_style::openpyxl; #ifndef XLNT_API -#if defined(_DLL) && defined(_MSC_VER) +#if !defined(XLNT_STATIC) && defined(_MSC_VER) #ifdef XLNT_EXPORT #define XLNT_API __declspec(dllexport) #else From 10964c44ace59996cdbb03ab292565b78362476e Mon Sep 17 00:00:00 2001 From: Xpol Wan Date: Tue, 5 Jul 2016 15:35:04 +0800 Subject: [PATCH 5/5] whitespaces. --- cmake/xlnt.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmake/xlnt.cmake b/cmake/xlnt.cmake index 9d029a8b..f99d1717 100644 --- a/cmake/xlnt.cmake +++ b/cmake/xlnt.cmake @@ -149,7 +149,7 @@ configure_file( "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake" IMMEDIATE @ONLY) -install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/../include/xlnt +install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/../include/xlnt DESTINATION include PATTERN ".DS_Store" EXCLUDE ) @@ -159,4 +159,4 @@ install(FILES "${CMAKE_BINARY_DIR}/${PROJECT_NAME}.pc" ) add_custom_target(uninstall - COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake) \ No newline at end of file + COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake)