mirror of
https://github.com/Kitware/CMake.git
synced 2025-10-14 02:08:27 +08:00
Merge topic 'reduce-try_compile'
9f3923893c
libarchive: Map fixed-size integer types from KWIML as typedefsd20bf471c8
liblzma: Map fixed-size integer types from KWIML as typedefs92c4316d81
KWSys: Hard-code try_compile results on Windows2bc89f1a03
cmSystemTools: Hard-code try_compile results for Windowsd350d4668a
libarchive: Hard-code try_compile results for bundled dependenciesbf60ac24ae
Source: Assume elf.h does not exist on Windowsf408cc2c40
expat: Remove unused try_compile checks6c4f3dcd7b
Utilities: Update hard-coded try_compile results for third-party libraries Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !4848
This commit is contained in:
@@ -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.
|
||||
|
@@ -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)
|
||||
|
@@ -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)
|
||||
|
@@ -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)
|
||||
|
@@ -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@
|
||||
|
@@ -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. */
|
||||
|
@@ -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
|
||||
|
Reference in New Issue
Block a user