summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoger Leigh <rleigh@codelibre.net>2022-07-13 06:56:03 +0100
committerRoger Leigh <rleigh@codelibre.net>2022-07-13 06:56:03 +0100
commit42fc3324e177ef21eb752329d7f56f984019b665 (patch)
tree63b1045dac9c2cb702460188e3acb9be78fab82d
parenteb4087c52655986c8f5a15faf65c54031bf13858 (diff)
downloadlibtiff-git-42fc3324e177ef21eb752329d7f56f984019b665.tar.gz
cmake: Fixes for Visual Studio 2022
-rw-r--r--CMakeLists.txt5
-rw-r--r--cmake/WindowsSupport.cmake14
2 files changed, 9 insertions, 10 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 561a5de4..26acca80 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -137,11 +137,6 @@ find_package(CMath REQUIRED)
# Release support
include(Release)
-if(MSVC)
- add_compile_definitions(-D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS)
- add_compile_options(/wd4996)
-endif()
-
# Process subdirectories
add_subdirectory(port)
add_subdirectory(libtiff)
diff --git a/cmake/WindowsSupport.cmake b/cmake/WindowsSupport.cmake
index 8cfe7ae3..4161880c 100644
--- a/cmake/WindowsSupport.cmake
+++ b/cmake/WindowsSupport.cmake
@@ -23,13 +23,17 @@
# LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
# OF THIS SOFTWARE.
-# Debug postfix
if(MSVC)
+ # Debug postfix
set(CMAKE_DEBUG_POSTFIX "d")
-# disable deprecation warnings
- add_definitions(-D_CRT_SECURE_NO_WARNINGS)
-# suppress deprecation warning for MSVC POSIX names
- add_definitions(-D_CRT_NONSTDC_NO_WARNINGS)
+
+ # disable deprecation warnings
+ add_definitions(-D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_DEPRECATE)
+ # suppress deprecation warning for MSVC POSIX names
+ add_definitions(-D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_WARNINGS)
+
+ # Don't warn about use of deprecated functions
+ add_compile_options(/wd4996)
endif()
# Win32 file I/O