forked from github/server
additional clang warning for tautological comparisons.
added to catch a /Wall VS warning in Travis builds.
This commit is contained in:
parent
69821b2a32
commit
80deef30b0
|
@ -12,26 +12,31 @@ include_directories (${LUA_INCLUDE_DIR})
|
|||
include_directories (${BSON_INCLUDE_DIR})
|
||||
include_directories (${INIPARSER_INCLUDE_DIR})
|
||||
|
||||
IF(CMAKE_COMPILER_IS_GNUCC)
|
||||
execute_process(COMMAND ${CMAKE_C_COMPILER} -dumpversion
|
||||
OUTPUT_VARIABLE GCC_VERSION)
|
||||
if (GCC_VERSION VERSION_GREATER 4.9)
|
||||
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wfloat-conversion")
|
||||
endif()
|
||||
IF(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_CLANG)
|
||||
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wconversion -Wno-sign-conversion")
|
||||
|
||||
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -pedantic -Wsign-compare -Wall -Werror -Wno-unknown-pragmas -Wstrict-prototypes -Wpointer-arith -Wno-char-subscripts -Wno-long-long")
|
||||
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-error=unused-but-set-variable")
|
||||
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99 -DHAVE__BOOL")
|
||||
elseif(MSVC)
|
||||
ELSEIF(MSVC)
|
||||
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /Wall /WX /MP")
|
||||
set(CMAKE_EXE_LINKER_FLAGS_DEBUG
|
||||
"${CMAKE_EXE_LINKER_FLAGS_DEBUG} /NODEFAULTLIB:libc.lib /NODEFAULTLIB:libcmt.lib /NODEFAULTLIB:libcd.lib /NODEFAULTLIB:libcmtd.lib /NODEFAULTLIB:msvcrt.lib")
|
||||
set(CMAKE_EXE_LINKER_FLAGS_RELEASE
|
||||
"${CMAKE_EXE_LINKER_FLAGS_RELEASE} /NODEFAULTLIB:libc.lib /NODEFAULTLIB:libcmt.lib /NODEFAULTLIB:libcd.lib /NODEFAULTLIB:libcmtd.lib /NODEFAULTLIB:msvcrtd.lib")
|
||||
ELSE(CMAKE_COMPILER_IS_GNUCC)
|
||||
MESSAGE(STATUS "Unknown compiler ${CMAKE_C_COMPILER_ID}")
|
||||
ENDIF(CMAKE_COMPILER_IS_GNUCC)
|
||||
ELSE()
|
||||
MESSAGE(STATUS "unknown compiler ${CMAKE_C_COMPILER_ID}")
|
||||
ENDIF()
|
||||
|
||||
IF(CMAKE_COMPILER_IS_CLANG)
|
||||
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wtautological-compare -Weverything")
|
||||
MESSAGE(STATUS "compiler is clang: ${CMAKE_C_COMPILER_ID}")
|
||||
ELSEIF(CMAKE_COMPILER_IS_GCC)
|
||||
EXECUTE_PROCESS(COMMAND ${CMAKE_C_COMPILER} -dumpversion
|
||||
OUTPUT_VARIABLE GCC_VERSION)
|
||||
IF (GCC_VERSION VERSION_GREATER 4.9)
|
||||
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wfloat-conversion")
|
||||
ENDIF()
|
||||
ENDIF(CMAKE_COMPILER_IS_CLANG)
|
||||
|
||||
add_subdirectory(util)
|
||||
add_subdirectory(kernel)
|
||||
|
|
|
@ -282,7 +282,6 @@ int main(int argc, char **argv)
|
|||
int err = 0;
|
||||
lua_State *L;
|
||||
setup_signal_handler();
|
||||
|
||||
/* parse args once to read config file location */
|
||||
if (parse_args(argc, argv, &err) != 0) {
|
||||
return err;
|
||||
|
|
Loading…
Reference in New Issue