From 28f9ce4e331095dc9b8adf0519e90a824c78c11e Mon Sep 17 00:00:00 2001 From: Alexander Alekhin Date: Fri, 10 Feb 2017 15:28:50 +0300 Subject: [PATCH] cmake: cleanup MSVC checks --- 3rdparty/libtiff/CMakeLists.txt | 6 ++++-- 3rdparty/zlib/CMakeLists.txt | 4 +++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/3rdparty/libtiff/CMakeLists.txt b/3rdparty/libtiff/CMakeLists.txt index 93bcf7ee6a..67ceac9e3f 100644 --- a/3rdparty/libtiff/CMakeLists.txt +++ b/3rdparty/libtiff/CMakeLists.txt @@ -11,11 +11,13 @@ check_include_file(assert.h HAVE_ASSERT_H) check_include_file(fcntl.h HAVE_FCNTL_H) check_include_file(io.h HAVE_IO_H) check_function_exists(jbg_newlen HAVE_JBG_NEWLEN) -check_function_exists(mmap HAVE_MMAP) check_include_file(search.h HAVE_SEARCH_H) check_include_file(string.h HAVE_STRING_H) check_include_file(sys/types.h HAVE_SYS_TYPES_H) -check_include_file(unistd.h HAVE_UNISTD_H) +if(NOT MSVC) + check_include_file(unistd.h HAVE_UNISTD_H) + check_function_exists(mmap HAVE_MMAP) +endif() if(WIN32 AND NOT WINRT) set(USE_WIN32_FILEIO 1) diff --git a/3rdparty/zlib/CMakeLists.txt b/3rdparty/zlib/CMakeLists.txt index 3376c3efda..84d46189a6 100644 --- a/3rdparty/zlib/CMakeLists.txt +++ b/3rdparty/zlib/CMakeLists.txt @@ -21,7 +21,9 @@ endif() # # Check for unistd.h # -check_include_file(unistd.h Z_HAVE_UNISTD_H) +if(NOT MSVC) + check_include_file(unistd.h Z_HAVE_UNISTD_H) +endif() if(MSVC) add_definitions(-D_CRT_SECURE_NO_DEPRECATE)