before_build:
- echo Running cmake...
- cd c:\projects\libexpat
- - cmake -G"%GENERATOR%" expat
+ - cmake -DWARNINGS_AS_ERRORS=ON -G"%GENERATOR%" expat
build:
parallel: true # enable MSBuild parallel builds
set(XML_CONTEXT_BYTES 1024 CACHE STRING "Define to specify how much context to retain around the current parse point")\r
option(XML_DTD "Define to make parameter entity parsing functionality available" ON)\r
option(XML_NS "Define to make XML Namespaces functionality available" ON)\r
+option(WARNINGS_AS_ERRORS "Treat all compiler warnings as errors" OFF)\r
if(NOT WIN32)\r
option(XML_DEV_URANDOM "Define to include code reading entropy from `/dev/urandom'." ON)\r
if(XML_DEV_URANDOM)\r
if(FLAG_NO_STRICT_ALIASING)\r
set(EXTRA_COMPILE_FLAGS "${EXTRA_COMPILE_FLAGS} -fno-strict-aliasing")\r
endif()\r
+if (WARNINGS_AS_ERRORS)\r
+ if(MSVC)\r
+ add_definitions(/WX)\r
+ else(MSVC)\r
+ set(EXTRA_COMPILE_FLAGS "${EXTRA_COMPILE_FLAGS} -Werror")\r
+ endif(MSVC)\r
+endif(WARNINGS_AS_ERRORS)\r
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_COMPILE_FLAGS}")\r
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${EXTRA_COMPILE_FLAGS}")\r
\r