Dev flags are now off by default
"Dev" flags are -Werror, -Wextra, -Wall and -Wc++98-compat. People who are compiling YCM as users and not developers (99.99999% of all YCM compilations) don't care about those flags and were just burdened by their inclusion by default. Fixes #502.
This commit is contained in:
parent
d35b39a20c
commit
ce136cd5b6
@ -28,6 +28,7 @@ if ( NOT PYTHONLIBS_VERSION_STRING VERSION_LESS "3.0.0" )
|
|||||||
"python2.\n" )
|
"python2.\n" )
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
option( DEV_FLAGS "Use compilation flags meant for YCM developers" OFF )
|
||||||
option( USE_CLANG_COMPLETER "Use Clang semantic completer for C/C++/ObjC" OFF )
|
option( USE_CLANG_COMPLETER "Use Clang semantic completer for C/C++/ObjC" OFF )
|
||||||
option( USE_SYSTEM_LIBCLANG "Set to ON to use the system libclang library" OFF )
|
option( USE_SYSTEM_LIBCLANG "Set to ON to use the system libclang library" OFF )
|
||||||
set( PATH_TO_LLVM_ROOT "" CACHE PATH "Path to the root of a LLVM+Clang binary distribution" )
|
set( PATH_TO_LLVM_ROOT "" CACHE PATH "Path to the root of a LLVM+Clang binary distribution" )
|
||||||
@ -295,7 +296,7 @@ set_target_properties( ${PROJECT_NAME} PROPERTIES
|
|||||||
|
|
||||||
# For some reason, Xcode is too dumb to understand the -isystem flag and thus
|
# For some reason, Xcode is too dumb to understand the -isystem flag and thus
|
||||||
# borks on warnings in Boost.
|
# borks on warnings in Boost.
|
||||||
if ( ( CMAKE_COMPILER_IS_GNUCXX OR COMPILER_IS_CLANG ) AND
|
if ( DEV_FLAGS AND ( CMAKE_COMPILER_IS_GNUCXX OR COMPILER_IS_CLANG ) AND
|
||||||
NOT CMAKE_GENERATOR_IS_XCODE )
|
NOT CMAKE_GENERATOR_IS_XCODE )
|
||||||
# We want all warnings, and warnings should be treated as errors
|
# We want all warnings, and warnings should be treated as errors
|
||||||
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Werror" )
|
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Werror" )
|
||||||
@ -306,7 +307,7 @@ endif()
|
|||||||
# We want warnings if we accidentally use C++11 features
|
# We want warnings if we accidentally use C++11 features
|
||||||
# We can't use this warning on FreeBSD because std headers on that OS are dumb.
|
# We can't use this warning on FreeBSD because std headers on that OS are dumb.
|
||||||
# See here: https://github.com/Valloric/YouCompleteMe/issues/260
|
# See here: https://github.com/Valloric/YouCompleteMe/issues/260
|
||||||
if ( COMPILER_IS_CLANG AND NOT CMAKE_GENERATOR_IS_XCODE AND NOT
|
if ( DEV_FLAGS AND COMPILER_IS_CLANG AND NOT CMAKE_GENERATOR_IS_XCODE AND NOT
|
||||||
SYSTEM_IS_FREEBSD )
|
SYSTEM_IS_FREEBSD )
|
||||||
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wc++98-compat" )
|
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wc++98-compat" )
|
||||||
endif()
|
endif()
|
||||||
|
@ -138,7 +138,7 @@ fi
|
|||||||
if [ -z "$YCM_TESTRUN" ]; then
|
if [ -z "$YCM_TESTRUN" ]; then
|
||||||
install $cmake_args $EXTRA_CMAKE_ARGS
|
install $cmake_args $EXTRA_CMAKE_ARGS
|
||||||
else
|
else
|
||||||
testrun $cmake_args $EXTRA_CMAKE_ARGS
|
testrun $cmake_args -DDEV_FLAGS=ON $EXTRA_CMAKE_ARGS
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if $omnisharp_completer; then
|
if $omnisharp_completer; then
|
||||||
|
Loading…
Reference in New Issue
Block a user