Author: rleigh
Date: Wed Jun 14 20:45:24 2017
New Revision: 1798747

URL: http://svn.apache.org/viewvc?rev=1798747&view=rev
Log:
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.

Modified:
    xerces/c/trunk/cmake/XercesIntTypes.cmake

Modified: xerces/c/trunk/cmake/XercesIntTypes.cmake
URL: 
http://svn.apache.org/viewvc/xerces/c/trunk/cmake/XercesIntTypes.cmake?rev=1798747&r1=1798746&r2=1798747&view=diff
==============================================================================
--- xerces/c/trunk/cmake/XercesIntTypes.cmake (original)
+++ xerces/c/trunk/cmake/XercesIntTypes.cmake Wed Jun 14 20:45:24 2017
@@ -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})
 



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to