fix windows build

This commit is contained in:
Thomas Fussell 2016-09-17 08:06:18 -04:00
parent 07082d0b3e
commit afb9c75369
2 changed files with 7 additions and 4 deletions

View File

@ -68,9 +68,9 @@ SET(LIBSTUDXML ../third-party/libstudxml/xml/parser.cxx ../third-party/libstudxm
if(SHARED) if(SHARED)
add_library(xlnt.shared SHARED ${HEADERS} ${SOURCES} ${MINIZ} ${LIBSTUDXML}) 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) 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\"") set_target_properties(xlnt.shared PROPERTIES COMPILE_FLAGS "/wd\"4251\" /wd\"4275\"")
endif() endif()
install(TARGETS xlnt.shared install(TARGETS xlnt.shared
@ -103,6 +103,10 @@ endif()
if(STATIC) if(STATIC)
add_library(xlnt.static STATIC ${HEADERS} ${SOURCES} ${MINIZ} ${LIBSTUDXML}) add_library(xlnt.static STATIC ${HEADERS} ${SOURCES} ${MINIZ} ${LIBSTUDXML})
target_compile_definitions(xlnt.static PUBLIC XLNT_STATIC=1) 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 install(TARGETS xlnt.static
LIBRARY DESTINATION ${LIB_DEST_DIR} LIBRARY DESTINATION ${LIB_DEST_DIR}
ARCHIVE DESTINATION ${LIB_DEST_DIR} ARCHIVE DESTINATION ${LIB_DEST_DIR}

View File

@ -1,12 +1,11 @@
#pragma once #pragma once
#include <xlnt/xlnt_config.hpp>
#include <xlnt/utils/exceptions.hpp> #include <xlnt/utils/exceptions.hpp>
namespace xlnt { namespace xlnt {
template<typename T> template<typename T>
class XLNT_CLASS optional class optional
{ {
public: public:
optional() : has_value_(false), value_(T()) optional() : has_value_(false), value_(T())