mirror of
https://github.com/open-source-parsers/jsoncpp.git
synced 2025-01-06 00:31:10 +01:00
Merge pull request #463 from jmealins/fix-errors-as-warnings
Fix JSONCPP_WITH_WARNING_AS_ERROR
This commit is contained in:
commit
b84332249b
@ -81,11 +81,13 @@ CONFIGURE_FILE( "${PROJECT_SOURCE_DIR}/version.in"
|
|||||||
NEWLINE_STYLE UNIX )
|
NEWLINE_STYLE UNIX )
|
||||||
|
|
||||||
macro(UseCompilationWarningAsError)
|
macro(UseCompilationWarningAsError)
|
||||||
if ( MSVC )
|
if ( MSVC )
|
||||||
# Only enabled in debug because some old versions of VS STL generate
|
# Only enabled in debug because some old versions of VS STL generate
|
||||||
# warnings when compiled in release configuration.
|
# warnings when compiled in release configuration.
|
||||||
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /WX ")
|
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /WX ")
|
||||||
endif()
|
elseif (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" OR CMAKE_XX_COMPILER_ID MATCHES "Clang" )
|
||||||
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror")
|
||||||
|
endif()
|
||||||
endmacro()
|
endmacro()
|
||||||
|
|
||||||
# Include our configuration header
|
# Include our configuration header
|
||||||
@ -99,10 +101,10 @@ endif()
|
|||||||
|
|
||||||
if (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
|
if (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
|
||||||
# using regular Clang or AppleClang
|
# using regular Clang or AppleClang
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Werror -Wall -Wshadow -Wshorten-64-to-32")
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wshadow -Wshorten-64-to-32")
|
||||||
elseif (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
|
elseif (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
|
||||||
# using GCC
|
# using GCC
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror -Wall -Wshadow -Wextra -pedantic -Wno-long-long")
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wshadow -Wextra -pedantic -Wno-long-long")
|
||||||
# not yet ready for -Wsign-conversion
|
# not yet ready for -Wsign-conversion
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user