summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2020-06-05 11:57:50 (GMT)
committerKitware Robot <kwrobot@kitware.com>2020-06-05 11:58:38 (GMT)
commit3414ee155e0423284a9171497d7724828fd324a5 (patch)
treed5e80a5eafa6817b0a5841860d14d718840df4f3
parent6aa87468100c1d6f518df1a48efbd42d6f4a59e2 (diff)
parent9f3923893ceff962d733bba839457a4c75d045f0 (diff)
downloadCMake-3414ee155e0423284a9171497d7724828fd324a5.zip
CMake-3414ee155e0423284a9171497d7724828fd324a5.tar.gz
CMake-3414ee155e0423284a9171497d7724828fd324a5.tar.bz2
Merge topic 'reduce-try_compile'
9f3923893c libarchive: Map fixed-size integer types from KWIML as typedefs d20bf471c8 liblzma: Map fixed-size integer types from KWIML as typedefs 92c4316d81 KWSys: Hard-code try_compile results on Windows 2bc89f1a03 cmSystemTools: Hard-code try_compile results for Windows d350d4668a libarchive: Hard-code try_compile results for bundled dependencies bf60ac24ae Source: Assume elf.h does not exist on Windows f408cc2c40 expat: Remove unused try_compile checks 6c4f3dcd7b Utilities: Update hard-coded try_compile results for third-party libraries Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !4848
-rw-r--r--CMakeLists.txt40
-rw-r--r--Source/CMakeLists.txt4
-rw-r--r--Utilities/cmThirdPartyChecks.cmake16
-rw-r--r--Utilities/cmexpat/ConfigureChecks.cmake11
-rw-r--r--Utilities/cmexpat/expat_config.h.cmake6
-rw-r--r--Utilities/cmlibarchive/build/cmake/config.h.in20
-rw-r--r--Utilities/cmliblzma/config.h.in18
7 files changed, 70 insertions, 45 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 15dbcd3..f62c666 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -356,6 +356,21 @@ macro (CMAKE_BUILD_UTILITIES)
if(CMake_NO_CXX_STANDARD)
set(KWSYS_CXX_STANDARD "")
endif()
+ if(WIN32)
+ # FIXME: Teach KWSys to hard-code these checks on Windows.
+ set(KWSYS_C_HAS_CLOCK_GETTIME_MONOTONIC_COMPILED 0)
+ set(KWSYS_C_HAS_PTRDIFF_T_COMPILED 1)
+ set(KWSYS_CXX_HAS_ENVIRON_IN_STDLIB_H_COMPILED 1)
+ set(KWSYS_CXX_HAS_RLIMIT64_COMPILED 0)
+ set(KWSYS_CXX_HAS_SETENV_COMPILED 0)
+ set(KWSYS_CXX_HAS_UNSETENV_COMPILED 0)
+ set(KWSYS_CXX_HAS_UTIMENSAT_COMPILED 0)
+ set(KWSYS_CXX_HAS_UTIMES_COMPILED 0)
+ set(KWSYS_CXX_STAT_HAS_ST_MTIM_COMPILED 0)
+ set(KWSYS_CXX_STAT_HAS_ST_MTIMESPEC_COMPILED 0)
+ set(KWSYS_STL_HAS_WSTRING_COMPILED 1)
+ set(KWSYS_SYS_HAS_IFADDRS_H 0)
+ endif()
add_subdirectory(Source/kwsys)
set(kwsys_folder "Utilities/KWSys")
CMAKE_SET_TARGET_FOLDER(${KWSYS_NAMESPACE} "${kwsys_folder}")
@@ -438,6 +453,13 @@ macro (CMAKE_BUILD_UTILITIES)
else()
set(CMAKE_ZLIB_INCLUDES ${CMake_SOURCE_DIR}/Utilities)
set(CMAKE_ZLIB_LIBRARIES cmzlib)
+ set(WITHOUT_ZLIB_DLL "")
+ set(WITHOUT_ZLIB_DLL_WITH_LIB cmzlib)
+ set(ZLIB_DLL "")
+ set(ZLIB_DLL_WITH_LIB cmzlib)
+ set(ZLIB_WINAPI "")
+ set(ZLIB_WINAPI_COMPILED 0)
+ set(ZLIB_WINAPI_WITH_LIB cmzlib)
add_subdirectory(Utilities/cmzlib)
CMAKE_SET_TARGET_FOLDER(cmzlib "Utilities/3rdParty")
endif()
@@ -514,6 +536,11 @@ macro (CMAKE_BUILD_UTILITIES)
set(BZIP2_INCLUDE_DIR
"${CMAKE_CURRENT_SOURCE_DIR}/Utilities/cmbzip2")
set(BZIP2_LIBRARIES cmbzip2)
+ set(BZIP2_NEED_PREFIX "")
+ set(USE_BZIP2_DLL "")
+ set(USE_BZIP2_DLL_WITH_LIB cmbzip2)
+ set(USE_BZIP2_STATIC "")
+ set(USE_BZIP2_STATIC_WITH_LIB cmbzip2)
add_subdirectory(Utilities/cmbzip2)
CMAKE_SET_TARGET_FOLDER(cmbzip2 "Utilities/3rdParty")
endif()
@@ -699,10 +726,15 @@ if(NOT CMake_TEST_EXTERNAL_CMAKE)
include(${CMake_SOURCE_DIR}/Tests/CMakeInstall.cmake)
endif()
- # no clue why we are testing for this here
- include(CheckSymbolExists)
- CHECK_SYMBOL_EXISTS(unsetenv "stdlib.h" HAVE_UNSETENV)
- CHECK_SYMBOL_EXISTS(environ "stdlib.h" HAVE_ENVIRON_NOT_REQUIRE_PROTOTYPE)
+ # Checks for cmSystemTools.
+ if(WIN32)
+ set(HAVE_UNSETENV 0)
+ set(HAVE_ENVIRON_NOT_REQUIRE_PROTOTYPE 1)
+ else()
+ include(CheckSymbolExists)
+ CHECK_SYMBOL_EXISTS(unsetenv "stdlib.h" HAVE_UNSETENV)
+ CHECK_SYMBOL_EXISTS(environ "stdlib.h" HAVE_ENVIRON_NOT_REQUIRE_PROTOTYPE)
+ endif()
endif()
# CMAKE_TESTS_CDASH_SERVER: CDash server used by CMake/Tests.
diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt
index 22d8032..1b6bb00 100644
--- a/Source/CMakeLists.txt
+++ b/Source/CMakeLists.txt
@@ -8,7 +8,9 @@ set(CMAKE_CXX_EXTENSIONS FALSE)
include(CheckIncludeFile)
# Check if we can build support for ELF parsing.
-if(CMAKE_CXX_PLATFORM_ID MATCHES "OpenBSD")
+if(WIN32)
+ set(HAVE_ELF_H 0)
+elseif(CMAKE_CXX_PLATFORM_ID MATCHES "OpenBSD")
CHECK_INCLUDE_FILES("stdint.h;elf_abi.h" HAVE_ELF_H)
else()
CHECK_INCLUDE_FILE("elf.h" HAVE_ELF_H)
diff --git a/Utilities/cmThirdPartyChecks.cmake b/Utilities/cmThirdPartyChecks.cmake
index 0b57940..4ccfdfc 100644
--- a/Utilities/cmThirdPartyChecks.cmake
+++ b/Utilities/cmThirdPartyChecks.cmake
@@ -19,9 +19,10 @@ set(HAVE_STRFTIME 1)
set(HAVE_STRING_H 1)
set(HAVE_STRRCHR 1)
set(HAVE_WCHAR_H 1)
-set(SIZEOF_INT 4)
-set(SIZEOF_LONG_LONG 8)
-set(SIZEOF_SHORT 2)
+
+# Used by TEST_BIG_ENDIAN.
+set(CMAKE_SIZEOF_UNSIGNED_SHORT 2)
+set(HAVE_CMAKE_SIZEOF_UNSIGNED_SHORT 1)
if(WIN32)
# Results for builds targeting Windows platforms.
@@ -151,7 +152,7 @@ if(WIN32)
set(HAVE_READLINK 0)
set(HAVE_READLINKAT 0)
set(HAVE_READPASSPHRASE 0)
- set(HAVE_READPASSPHRASE 0)
+ set(HAVE_READPASSPHRASE_H 0)
set(HAVE_REGEX_H 0)
set(HAVE_RSA_H 0)
set(HAVE_SELECT 0)
@@ -260,6 +261,13 @@ if(WIN32)
# curl and expat: stdlib.h, stdarg.h, string.h, float.h
set(STDC_HEADERS 1)
+ # UNIX device APIs do not exist on Windows.
+ set(MAJOR_IN_MKDEV 0)
+ set(MAJOR_IN_SYSMACROS 0)
+
+ # FreeBSD libmd does not exist on Windows.
+ set(LIBMD_FOUND 0)
+
# libarchive looks for external hash implementations.
set(ARCHIVE_CRYPTO_MD5_LIBC 0)
set(ARCHIVE_CRYPTO_MD5_LIBMD 0)
diff --git a/Utilities/cmexpat/ConfigureChecks.cmake b/Utilities/cmexpat/ConfigureChecks.cmake
index d85e48c..4da252c 100644
--- a/Utilities/cmexpat/ConfigureChecks.cmake
+++ b/Utilities/cmexpat/ConfigureChecks.cmake
@@ -44,14 +44,6 @@ else(WORDS_BIGENDIAN)
set(BYTEORDER 1234)
endif(WORDS_BIGENDIAN)
-if(HAVE_SYS_TYPES_H)
- check_symbol_exists("off_t" "sys/types.h" OFF_T)
- check_symbol_exists("size_t" "sys/types.h" SIZE_T)
-else(HAVE_SYS_TYPES_H)
- set(OFF_T "long")
- set(SIZE_T "unsigned")
-endif(HAVE_SYS_TYPES_H)
-
check_c_source_compiles("
#include <stdlib.h> /* for NULL */
#include <unistd.h> /* for syscall */
@@ -61,6 +53,3 @@ check_c_source_compiles("
return 0;
}"
HAVE_SYSCALL_GETRANDOM)
-
-check_c_compiler_flag("-fno-strict-aliasing" FLAG_NO_STRICT_ALIASING)
-check_c_compiler_flag("-fvisibility=hidden" FLAG_VISIBILITY)
diff --git a/Utilities/cmexpat/expat_config.h.cmake b/Utilities/cmexpat/expat_config.h.cmake
index 795b607..e91861e 100644
--- a/Utilities/cmexpat/expat_config.h.cmake
+++ b/Utilities/cmexpat/expat_config.h.cmake
@@ -86,9 +86,3 @@
#ifdef _MSC_VER
# define __func__ __FUNCTION__
#endif
-
-/* Define to `long' if <sys/types.h> does not define. */
-#cmakedefine off_t @OFF_T@
-
-/* Define to `unsigned' if <sys/types.h> does not define. */
-#cmakedefine size_t @SIZE_T@
diff --git a/Utilities/cmlibarchive/build/cmake/config.h.in b/Utilities/cmlibarchive/build/cmake/config.h.in
index e889781..f38601f 100644
--- a/Utilities/cmlibarchive/build/cmake/config.h.in
+++ b/Utilities/cmlibarchive/build/cmake/config.h.in
@@ -1118,34 +1118,34 @@
#include <cm3p/kwiml/int.h>
#ifndef KWIML_INT_HAVE_INT64_T
-# define int64_t KWIML_INT_int64_t
+typedef KWIML_INT_int64_t int64_t;
#endif
#ifndef KWIML_INT_HAVE_INT32_T
-# define int32_t KWIML_INT_int32_t
+typedef KWIML_INT_int32_t int32_t;
#endif
#ifndef KWIML_INT_HAVE_INT16_T
-# define int16_t KWIML_INT_int16_t
+typedef KWIML_INT_int16_t int16_t;
#endif
#ifndef KWIML_INT_HAVE_INT8_T
-# define int8_t KWIML_INT_int8_t
+typedef KWIML_INT_int8_t int8_t;
#endif
#ifndef KWIML_INT_HAVE_INTPTR_T
-# define intptr_t KWIML_INT_intptr_t
+typedef KWIML_INT_intptr_t intptr_t;
#endif
#ifndef KWIML_INT_HAVE_UINT64_T
-# define uint64_t KWIML_INT_uint64_t
+typedef KWIML_INT_uint64_t uint64_t;
#endif
#ifndef KWIML_INT_HAVE_UINT32_T
-# define uint32_t KWIML_INT_uint32_t
+typedef KWIML_INT_uint32_t uint32_t;
#endif
#ifndef KWIML_INT_HAVE_UINT16_T
-# define uint16_t KWIML_INT_uint16_t
+typedef KWIML_INT_uint16_t uint16_t;
#endif
#ifndef KWIML_INT_HAVE_UINT8_T
-# define uint8_t KWIML_INT_uint8_t
+typedef KWIML_INT_uint8_t uint8_t;
#endif
#ifndef KWIML_INT_HAVE_UINTPTR_T
-# define uintptr_t KWIML_INT_uintptr_t
+typedef KWIML_INT_uintptr_t uintptr_t;
#endif
/* Define to 1 if you have the <stdint.h> header file. */
diff --git a/Utilities/cmliblzma/config.h.in b/Utilities/cmliblzma/config.h.in
index 8e4dc93..20916ca 100644
--- a/Utilities/cmliblzma/config.h.in
+++ b/Utilities/cmliblzma/config.h.in
@@ -6,31 +6,31 @@
#include <cm3p/kwiml/int.h>
#ifndef KWIML_INT_HAVE_INT64_T
-# define int64_t KWIML_INT_int64_t
+typedef KWIML_INT_int64_t int64_t;
#endif
#ifndef KWIML_INT_HAVE_INT32_T
-# define int32_t KWIML_INT_int32_t
+typedef KWIML_INT_int32_t int32_t;
#endif
#ifndef KWIML_INT_HAVE_INT16_T
-# define int16_t KWIML_INT_int16_t
+typedef KWIML_INT_int16_t int16_t;
#endif
#ifndef KWIML_INT_HAVE_INT8_T
-# define int8_t KWIML_INT_int8_t
+typedef KWIML_INT_int8_t int8_t;
#endif
#ifndef KWIML_INT_HAVE_UINT64_T
-# define uint64_t KWIML_INT_uint64_t
+typedef KWIML_INT_uint64_t uint64_t;
#endif
#ifndef KWIML_INT_HAVE_UINT32_T
-# define uint32_t KWIML_INT_uint32_t
+typedef KWIML_INT_uint32_t uint32_t;
#endif
#ifndef KWIML_INT_HAVE_UINT16_T
-# define uint16_t KWIML_INT_uint16_t
+typedef KWIML_INT_uint16_t uint16_t;
#endif
#ifndef KWIML_INT_HAVE_UINT8_T
-# define uint8_t KWIML_INT_uint8_t
+typedef KWIML_INT_uint8_t uint8_t;
#endif
#ifndef KWIML_INT_HAVE_UINTPTR_T
-# define uintptr_t KWIML_INT_uintptr_t
+typedef KWIML_INT_uintptr_t uintptr_t;
#endif
#cmakedefine WORDS_BIGENDIAN 1