aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorclick <none@none>2010-08-29 12:56:34 +0200
committerclick <none@none>2010-08-29 12:56:34 +0200
commit9648cf7f3946eea0aa34a64c9f342e181c03a659 (patch)
treefae33ea9b2ad8c54db767b8fe5a0137b93e17eed
parentd81f5facc0df7a2673122e170f28fe7b91fe4c50 (diff)
Buildsystem: Make MSVC behave a wee bit better :
- Overload standard names with "secure" versions - Disable "non-secure" warnings by default - Disable POSIX-warnings by default --HG-- branch : trunk
-rw-r--r--cmake/compiler/msvc/settings.cmake23
1 files changed, 11 insertions, 12 deletions
diff --git a/cmake/compiler/msvc/settings.cmake b/cmake/compiler/msvc/settings.cmake
index cea2911084b..24095086b0b 100644
--- a/cmake/compiler/msvc/settings.cmake
+++ b/cmake/compiler/msvc/settings.cmake
@@ -26,21 +26,20 @@ if(${PLATFORM} STREQUAL "X64")
message(STATUS "- MSVC: 64-bit platform, enforced -D_WIN64 parameter")
endif()
-# Defining _CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES as 1 eliminates the warning by changing the strcpy call to strcpy_s, which prevents buffer overruns
-# DISABLED UNTILL FURTHER, NEEDS TESTING AND VERIFICATION
-#add_definitions(-D_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES)
-#message(STATUS "- MSVC: Overload standard names")
+# Define _CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES - eliminates the warning by changing the strcpy call to strcpy_s, which prevents buffer overruns
+add_definitions(-D_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES)
+message(STATUS "- MSVC: Overloaded standard names")
-# disable warnings in Visual Studio 8 and above if not wanted
-if(NOT WITH_WARNINGS)
- # Ignore warnings about older, less secure functions
- add_definitions(-D_CRT_SECURE_NO_WARNINGS)
- message(STATUS "- MSVC: Disabled NON-SECURE warnings")
+# Ignore warnings about older, less secure functions
+add_definitions(-D_CRT_SECURE_NO_WARNINGS)
+message(STATUS "- MSVC: Disabled NON-SECURE warnings")
- #Ignore warnings about POSIX deprecation
- add_definitions(-D_CRT_NONSTDC_NO_WARNINGS)
- message(STATUS "- MSVC: Disabled POSIX warnings")
+#Ignore warnings about POSIX deprecation
+add_definitions(-D_CRT_NONSTDC_NO_WARNINGS)
+message(STATUS "- MSVC: Disabled POSIX warnings")
+# disable warnings in Visual Studio 8 and above if not wanted
+if(NOT WITH_WARNINGS)
if(MSVC AND NOT CMAKE_GENERATOR MATCHES "Visual Studio 7")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /wd4996 /wd4355 /wd4244 /wd4985 /wd4267 /wd4619")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4996 /wd4355 /wd4244 /wd4985 /wd4267 /wd4619")