make/common/Defs-windows.gmk
Print this page
@@ -1,7 +1,7 @@
#
-# Copyright (c) 1999, 2009, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License version 2 only, as
# published by the Free Software Foundation. Oracle designates this
@@ -292,10 +292,17 @@
MS_RC_DEBUG_OPTION= -d _DEBUG
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)
# VS2003 compiler option definitions:
# -Zi Cause *.pdb file to be created, full debug information
@@ -393,16 +400,24 @@
#
# 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
CXXFLAGS_COMMON = $(CFLAGS_COMMON)
CXXFLAGS_OPT = $(CFLAGS_OPT)