diff options
author | Andreas Schuh <andreas.schuh.84@gmail.com> | 2017-07-11 15:41:01 +0100 |
---|---|---|
committer | Andreas Schuh <andreas.schuh.84@gmail.com> | 2017-07-11 17:47:32 +0100 |
commit | 6348ea9d7e9ba004067f4bb5b487318542deeeac (patch) | |
tree | 3b4b21d24b9d2ea47298e0f9928a3c4ed711e1ae /CMakeLists.txt | |
parent | 3d5bc48dc8b75dfd86b739abbcbc1fcc52a9b2f4 (diff) | |
download | gflags-6348ea9d7e9ba004067f4bb5b487318542deeeac.tar.gz gflags-6348ea9d7e9ba004067f4bb5b487318542deeeac.tar.bz2 gflags-6348ea9d7e9ba004067f4bb5b487318542deeeac.zip |
fix: Check HAVE_STDINT_H or HAVE_INTTYPES_H for older MSVC versions
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 603f6bd..e5df000 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -224,12 +224,22 @@ endif () if (MSVC) set (HAVE_SYS_TYPES_H 1) - set (HAVE_STDINT_H 1) set (HAVE_STDDEF_H 1) # used by CheckTypeSize module - set (HAVE_INTTYPES_H 0) set (HAVE_UNISTD_H 0) set (HAVE_SYS_STAT_H 1) set (HAVE_SHLWAPI_H 1) + if (MSVC_VERSION VERSION_LESS 1600) + check_include_file_cxx ("stdint.h" HAVE_STDINT_H) + bool_to_int (HAVE_STDINT_H) # used in #if directive + else () + set (HAVE_STDINT_H 1) + endif () + if (MSVC_VERSION VERSION_LESS 1800) + check_include_file_cxx ("inttypes.h" HAVE_INTTYPES_H) + bool_to_int (HAVE_INTTYPES_H) # used in #if directive + else () + set (HAVE_INTTYPES_H 1) + endif () else () foreach (fname IN ITEMS unistd stdint inttypes sys/types sys/stat fnmatch) string (TOUPPER "${fname}" FNAME) @@ -238,13 +248,13 @@ else () check_include_file_cxx ("${fname}.h" HAVE_${FNAME}_H) endif () endforeach () + if (NOT HAVE_FNMATCH_H AND OS_WINDOWS) + check_include_file_cxx ("shlwapi.h" HAVE_SHLWAPI_H) + endif () # the following are used in #if directives not #ifdef bool_to_int (HAVE_STDINT_H) bool_to_int (HAVE_SYS_TYPES_H) bool_to_int (HAVE_INTTYPES_H) - if (NOT HAVE_FNMATCH_H AND OS_WINDOWS) - check_include_file_cxx ("shlwapi.h" HAVE_SHLWAPI_H) - endif () endif () gflags_define (STRING INTTYPES_FORMAT "Format of integer types: \"C99\" (uint32_t), \"BSD\" (u_int32_t), \"VC7\" (__int32)" "") |