aboutsummaryrefslogtreecommitdiffstats
path: root/cmake/internal_utils.cmake
diff options
context:
space:
mode:
authorkosak <kosak@google.com>2014-01-29 07:29:19 +0000
committerkosak <kosak@google.com>2014-01-29 07:29:19 +0000
commit41a8bc67ab7e7a81735e9d560f54d8d130dcc3ab (patch)
treeb604cd1d242d6f9cd70b2640c3f7dc4ea1783bdb /cmake/internal_utils.cmake
parent35956659eaaafd4b356acfbabcb48c183d957ff4 (diff)
downloadgoogletest-41a8bc67ab7e7a81735e9d560f54d8d130dcc3ab.tar.gz
googletest-41a8bc67ab7e7a81735e9d560f54d8d130dcc3ab.tar.bz2
googletest-41a8bc67ab7e7a81735e9d560f54d8d130dcc3ab.zip
Suppress "Conditional expression is constant" warning on Visual Studio.
Diffstat (limited to 'cmake/internal_utils.cmake')
-rw-r--r--cmake/internal_utils.cmake11
1 files changed, 10 insertions, 1 deletions
diff --git a/cmake/internal_utils.cmake b/cmake/internal_utils.cmake
index d497ca1f..93e6dbb7 100644
--- a/cmake/internal_utils.cmake
+++ b/cmake/internal_utils.cmake
@@ -55,7 +55,7 @@ macro(config_compiler_and_linker)
if (MSVC)
# Newlines inside flags variables break CMake's NMake generator.
# TODO(vladl@google.com): Add -RTCs and -RTCu to debug builds.
- set(cxx_base_flags "-GS -W4 -WX -wd4127 -wd4251 -wd4275 -nologo -J -Zi")
+ set(cxx_base_flags "-GS -W4 -WX -wd4251 -wd4275 -nologo -J -Zi")
if (MSVC_VERSION LESS 1400) # 1400 is Visual Studio 2005
# Suppress spurious warnings MSVC 7.1 sometimes issues.
# Forcing value to bool.
@@ -66,6 +66,15 @@ macro(config_compiler_and_linker)
# Resolved overload was found by argument-dependent lookup.
set(cxx_base_flags "${cxx_base_flags} -wd4675")
endif()
+ if (MSVC_VERSION LESS 1500) # 1500 is Visual Studio 2008
+ # Conditional expression is constant.
+ # When compiling with /W4, we get several instances of C4127
+ # (Conditional expression is constant). In our code, we disable that
+ # warning on a case-by-case basis. However, on Visual Studio 2005,
+ # the warning fires on std::list. Therefore on that compiler and earlier,
+ # we disable the warning project-wide.
+ set(cxx_base_flags "${cxx_base_flags} -wd4127")
+ endif()
if (NOT (MSVC_VERSION LESS 1700)) # 1700 is Visual Studio 2012.
# Suppress "unreachable code" warning on VS 2012 and later.
# http://stackoverflow.com/questions/3232669 explains the issue.