From afb9c75369cce6a9e5bbd115d3062c772177e16a Mon Sep 17 00:00:00 2001 From: Thomas Fussell Date: Sat, 17 Sep 2016 08:06:18 -0400 Subject: [PATCH] fix windows build --- cmake/xlnt.cmake | 8 ++++++-- include/xlnt/utils/optional.hpp | 3 +-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/cmake/xlnt.cmake b/cmake/xlnt.cmake index 1dc61da0..b6bae9aa 100644 --- a/cmake/xlnt.cmake +++ b/cmake/xlnt.cmake @@ -68,9 +68,9 @@ SET(LIBSTUDXML ../third-party/libstudxml/xml/parser.cxx ../third-party/libstudxm if(SHARED) add_library(xlnt.shared SHARED ${HEADERS} ${SOURCES} ${MINIZ} ${LIBSTUDXML}) - target_compile_definitions(xlnt.shared PRIVATE XLNT_SHARED=1) + target_compile_definitions(xlnt.shared PRIVATE XLNT_SHARED=1 LIBSTUDXML_STATIC_LIB=1) if(MSVC) - target_compile_definitions(xlnt.shared PRIVATE XLNT_EXPORT=1) + target_compile_definitions(xlnt.shared PRIVATE XLNT_EXPORT=1 _CRT_SECURE_NO_WARNINGS=1) set_target_properties(xlnt.shared PROPERTIES COMPILE_FLAGS "/wd\"4251\" /wd\"4275\"") endif() install(TARGETS xlnt.shared @@ -103,6 +103,10 @@ endif() if(STATIC) add_library(xlnt.static STATIC ${HEADERS} ${SOURCES} ${MINIZ} ${LIBSTUDXML}) target_compile_definitions(xlnt.static PUBLIC XLNT_STATIC=1) + target_compile_definitions(xlnt.static PRIVATE LIBSTUDXML_STATIC_LIB=1) + if(MSVC) + target_compile_definitions(xlnt.static PRIVATE _CRT_SECURE_NO_WARNINGS=1) + endif() install(TARGETS xlnt.static LIBRARY DESTINATION ${LIB_DEST_DIR} ARCHIVE DESTINATION ${LIB_DEST_DIR} diff --git a/include/xlnt/utils/optional.hpp b/include/xlnt/utils/optional.hpp index 020a86e5..6924be61 100644 --- a/include/xlnt/utils/optional.hpp +++ b/include/xlnt/utils/optional.hpp @@ -1,12 +1,11 @@ #pragma once -#include #include namespace xlnt { template -class XLNT_CLASS optional +class optional { public: optional() : has_value_(false), value_(T())