6991482: Add global jdk makefile options to silence some VS2010 warnings
Reviewed-by: prr
This commit is contained in:
parent
6b6a611c8e
commit
875160bd93
jdk/make/common
@ -294,6 +294,13 @@ endif
|
||||
|
||||
# Always add _STATIC_CPPLIB definition
|
||||
STATIC_CPPLIB_OPTION = /D _STATIC_CPPLIB
|
||||
|
||||
# Silence the warning about using _STATIC_CPPLIB
|
||||
ifneq ($(SHOW_ALL_WARNINGS),true)
|
||||
# Needed with VS2010 to turn off the deprecated warning.
|
||||
STATIC_CPPLIB_OPTION += /D _DISABLE_DEPRECATE_STATIC_CPPLIB
|
||||
endif
|
||||
|
||||
MS_RUNTIME_OPTION += $(STATIC_CPPLIB_OPTION)
|
||||
|
||||
ifeq ($(CC_VERSION),msvc)
|
||||
@ -305,7 +312,7 @@ ifeq ($(CC_VERSION),msvc)
|
||||
# -Od Turns off optimization and speeds compilation
|
||||
# -YX -Fp/.../foobar.pch Use precompiled headers (try someday?)
|
||||
# -nologo Don't print out startup message
|
||||
# /D _STATIC_CPPLIB
|
||||
# /D _STATIC_CPPLIB
|
||||
# Use static link for the C++ runtime (so msvcpnn.dll not needed)
|
||||
#
|
||||
CFLAGS_COMMON += -Zi -nologo
|
||||
@ -395,12 +402,20 @@ CFLAGS_COMMON += $(COMPILER_WARNINGS_TO_IGNORE:%=-wd%)
|
||||
# Treat compiler warnings as errors, if requested
|
||||
#
|
||||
CFLAGS_COMMON += -W$(COMPILER_WARNING_LEVEL)
|
||||
# Turn off security warnings about using the standard C library function strcpy
|
||||
CFLAGS_COMMON += -D _CRT_SECURE_NO_DEPRECATE
|
||||
ifeq ($(COMPILER_WARNINGS_FATAL),true)
|
||||
CFLAGS_COMMON += -WX
|
||||
endif
|
||||
|
||||
# Turn off some warnings by default, enable them all if asked.
|
||||
ifneq ($(SHOW_ALL_WARNINGS),true)
|
||||
# The -D _CRT_SECURE_NO_DEPRECATE turns off security/deprecated warnings on
|
||||
# the standard C library functions like strcpy.
|
||||
CFLAGS_COMMON += -D _CRT_SECURE_NO_DEPRECATE
|
||||
# The -D _CRT_NONSTDC_NO_DEPRECATE turns off deprecation warnings about using
|
||||
# non-standard C POSIX functions.
|
||||
CFLAGS_COMMON += -D _CRT_NONSTDC_NO_DEPRECATE
|
||||
endif
|
||||
|
||||
CPPFLAGS_OPT = -DNDEBUG
|
||||
CPPFLAGS_DBG = -DDEBUG -DLOGGING
|
||||
|
||||
|
@ -34,12 +34,17 @@
|
||||
# Program.gmk may turn this down to 2 (building .exe's).
|
||||
# Windows 64bit platforms are less likely to be warning free.
|
||||
# Historically, Windows 32bit builds should be mostly warning free.
|
||||
# VS2010 introduced a large number of security warnings that are off by
|
||||
# default but will be turned back on with SHOW_ALL_WARNINGS=true.
|
||||
ifndef COMPILER_WARNING_LEVEL
|
||||
COMPILER_WARNING_LEVEL=3
|
||||
endif
|
||||
ifndef COMPILER_WARNINGS_FATAL
|
||||
COMPILER_WARNINGS_FATAL=false
|
||||
endif
|
||||
ifndef SHOW_ALL_WARNINGS
|
||||
SHOW_ALL_WARNINGS = false
|
||||
endif
|
||||
|
||||
# Windows should use parallel compilation for best build times
|
||||
ifndef COMPILE_APPROACH
|
||||
|
@ -138,6 +138,7 @@ endif
|
||||
ALL_SETTINGS+=$(call addOptionalSetting,FASTDEBUG)
|
||||
ALL_SETTINGS+=$(call addRequiredSetting,COMPILER_WARNINGS_FATAL)
|
||||
ALL_SETTINGS+=$(call addOptionalSetting,COMPILER_WARNING_LEVEL)
|
||||
ALL_SETTINGS+=$(call addOptionalSetting,SHOW_ALL_WARNINGS)
|
||||
ALL_SETTINGS+=$(call addRequiredSetting,INCREMENTAL_BUILD)
|
||||
ALL_SETTINGS+=$(call addOptionalSetting,CC_HIGHEST_OPT)
|
||||
ALL_SETTINGS+=$(call addOptionalSetting,CC_HIGHER_OPT)
|
||||
|
Loading…
x
Reference in New Issue
Block a user