Updated warning options for GCC; fixed new warnings.
This commit is contained in:
@@ -58,6 +58,7 @@ endif()
|
||||
|
||||
if(CMAKE_COMPILER_IS_GNUCXX)
|
||||
# High level of warnings.
|
||||
add_extra_compiler_option(-W)
|
||||
add_extra_compiler_option(-Wall)
|
||||
add_extra_compiler_option(-Werror=return-type)
|
||||
add_extra_compiler_option(-Werror=non-virtual-dtor)
|
||||
@@ -72,6 +73,7 @@ if(CMAKE_COMPILER_IS_GNUCXX)
|
||||
add_extra_compiler_option(-Winit-self)
|
||||
add_extra_compiler_option(-Wpointer-arith)
|
||||
add_extra_compiler_option(-Wshadow)
|
||||
add_extra_compiler_option(-Wsign-promo)
|
||||
|
||||
if(ENABLE_NOISY_WARNINGS)
|
||||
add_extra_compiler_option(-Wcast-align)
|
||||
@@ -81,6 +83,7 @@ if(CMAKE_COMPILER_IS_GNUCXX)
|
||||
add_extra_compiler_option(-Wno-delete-non-virtual-dtor)
|
||||
add_extra_compiler_option(-Wno-unnamed-type-template-args)
|
||||
endif()
|
||||
add_extra_compiler_option(-fdiagnostics-show-option)
|
||||
|
||||
# The -Wno-long-long is required in 64bit systems when including sytem headers.
|
||||
if(X86_64)
|
||||
|
||||
@@ -30,10 +30,7 @@
|
||||
# Advanced variables:
|
||||
# - OpenCV_SHARED
|
||||
# - OpenCV_CONFIG_PATH
|
||||
# - OpenCV_INSTALL_PATH (not set on Windows)
|
||||
# - OpenCV_LIB_COMPONENTS
|
||||
# - OpenCV_USE_MANGLED_PATHS
|
||||
# - OpenCV_HAVE_ANDROID_CAMERA
|
||||
#
|
||||
# ===================================================================================
|
||||
#
|
||||
@@ -41,6 +38,13 @@
|
||||
# - OpenCV_STATIC
|
||||
# - OpenCV_CUDA
|
||||
|
||||
if(CMAKE_VERSION VERSION_GREATER 2.6)
|
||||
get_property(OpenCV_LANGUAGES GLOBAL PROPERTY ENABLED_LANGUAGES)
|
||||
if(NOT ";${OpenCV_LANGUAGES};" MATCHES ";CXX;")
|
||||
enable_language(CXX)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(NOT DEFINED OpenCV_STATIC)
|
||||
# look for global setting
|
||||
if(NOT DEFINED BUILD_SHARED_LIBS OR BUILD_SHARED_LIBS)
|
||||
|
||||
@@ -34,6 +34,7 @@ endmacro()
|
||||
|
||||
set(OCV_COMPILER_FAIL_REGEX
|
||||
"command line option .* is valid for .* but not for C\\+\\+" # GNU
|
||||
"command line option .* is valid for .* but not for C" # GNU
|
||||
"unrecognized .*option" # GNU
|
||||
"unknown .*option" # Clang
|
||||
"ignoring unknown option" # MSVC
|
||||
|
||||
Reference in New Issue
Block a user