diff options
| author | Charles Karney <charles@karney.com> | 2017-12-14 08:46:14 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-12-14 08:46:14 -0500 |
| commit | 3ccc6c35ef0388d4d5ceee80e256a1b6e0d810bf (patch) | |
| tree | 45c3ca1a4d9d6f64d796bcb4f9696ccd902c7323 | |
| parent | ced0cbc05167822337488836071c920e18741eba (diff) | |
| parent | d4cc6e3ea21acadc2083ab926d6a9ba28ae468f6 (diff) | |
| download | PROJ-3ccc6c35ef0388d4d5ceee80e256a1b6e0d810bf.tar.gz PROJ-3ccc6c35ef0388d4d5ceee80e256a1b6e0d810bf.zip | |
Merge pull request #698 from cffk/squelch
Squelch Visual Studio's obnoxious warnings about sprintf being unsafe.
| -rw-r--r-- | CMakeLists.txt | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index a9c9cdbf..88f2b594 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -15,9 +15,13 @@ cmake_minimum_required(VERSION 2.6.0 FATAL_ERROR) project(PROJ4 C) set(PROJECT_INTERN_NAME PROJ) +if (NOT CMAKE_VERSION VERSION_LESS 3.1) + cmake_policy(SET CMP0054 NEW) +endif () # Set warnings if("${CMAKE_C_COMPILER_ID}" STREQUAL "MSVC") - set(CMAKE_C_FLAGS "/WX ${CMAKE_C_FLAGS}") + # Suppress warning 4996 about sprintf, etc., being unsafe + set(CMAKE_C_FLAGS "/wd4996 /WX ${CMAKE_C_FLAGS}") elseif("${CMAKE_C_COMPILER_ID}" STREQUAL "GNU") set(CMAKE_C_FLAGS "-std=c89 -Wall -Wextra -Wswitch -Werror \ -Wunused-parameter -Wmissing-prototypes -Wmissing-declarations -Wformat \ |
