CMake: Rename WARNINGS_AS_ERRORS to EXPAT_WARNINGS_AS_ERRORS

This commit is contained in:
Sebastian Pipping 2019-08-30 21:20:55 +02:00
parent 20bb6ed0b3
commit 458be796ae
2 changed files with 4 additions and 4 deletions

View File

@ -164,7 +164,7 @@ environment:
before_build:
- echo Running cmake...
- cd c:\projects\libexpat
- cmake -DWARNINGS_AS_ERRORS=ON -G"%GENERATOR%" expat
- cmake -DEXPAT_WARNINGS_AS_ERRORS=ON -G"%GENERATOR%" expat
build:
parallel: true # enable MSBuild parallel builds

View File

@ -52,7 +52,7 @@ option(INSTALL "install expat files in cmake install target" ON)
set(XML_CONTEXT_BYTES 1024 CACHE STRING "Define to specify how much context to retain around the current parse point")
option(XML_DTD "Define to make parameter entity parsing functionality available" ON)
option(XML_NS "Define to make XML Namespaces functionality available" ON)
option(WARNINGS_AS_ERRORS "Treat all compiler warnings as errors" OFF)
option(EXPAT_WARNINGS_AS_ERRORS "Treat all compiler warnings as errors" OFF)
if(NOT WIN32)
option(XML_DEV_URANDOM "Define to include code reading entropy from `/dev/urandom'." ON)
set(USE_GETRANDOM "AUTO" CACHE STRING
@ -158,13 +158,13 @@ if(FLAG_VISIBILITY)
add_definitions(-DXML_ENABLE_VISIBILITY=1)
set(EXTRA_COMPILE_FLAGS "${EXTRA_COMPILE_FLAGS} -fvisibility=hidden")
endif(FLAG_VISIBILITY)
if (WARNINGS_AS_ERRORS)
if (EXPAT_WARNINGS_AS_ERRORS)
if(MSVC)
add_definitions(/WX)
else(MSVC)
set(EXTRA_COMPILE_FLAGS "${EXTRA_COMPILE_FLAGS} -Werror")
endif(MSVC)
endif(WARNINGS_AS_ERRORS)
endif(EXPAT_WARNINGS_AS_ERRORS)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_COMPILE_FLAGS}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${EXTRA_COMPILE_FLAGS}")