Skip to content
Snippets Groups Projects
Commit 58fe4f07 authored by Roger Leigh's avatar Roger Leigh
Browse files

cmake: XercesIntTypes: Add a <cstdint> functional check

Header presence isn't always sufficient; if the headers is
present but the compiler is in C++98 mode it will error out.


git-svn-id: https://svn.apache.org/repos/asf/xerces/c/trunk@1798747 13f79535-47bb-0310-9956-ffa450edef68
parent 96c92239
No related branches found
No related tags found
No related merge requests found
......@@ -20,13 +20,29 @@
# Integer type checks.
include(CheckCXXSourceCompiles)
include(CheckIncludeFileCXX)
include(CheckTypeSize)
check_include_file_cxx(cstdint HAVE_CSTDINT)
check_include_file_cxx(cstdint HAVE_CSTDINT)
check_cxx_source_compiles("
#include <cstdint>
int main() {
uint32_t v1 = 342;
int64_t v2 = -23;
return 0;
}" CSTDINT_FUNCTIONAL)
check_include_file_cxx(stdint.h HAVE_STDINT_H)
check_include_file_cxx(inttypes.h HAVE_INTTYPES_H)
set(XERCES_HAVE_CSTDINT ${HAVE_CSTDINT})
if(HAVE_CSTDINT AND CSTDINT_FUNCTIONAL)
set(XERCES_HAVE_CSTDINT TRUE)
else()
set(XERCES_HAVE_CSTDINT FALSE)
endif()
set(XERCES_HAVE_STDINT_H ${HAVE_STDINT_H})
set(XERCES_HAVE_INTTYPES_H ${HAVE_INTTYPES_H})
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment