diff options
author | Allen Byrne <50328838+byrnHDF@users.noreply.github.com> | 2021-08-21 01:45:49 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-08-21 01:45:49 (GMT) |
commit | d4a9a064cbcc11965cc67c79c1690a7f92c2e1cb (patch) | |
tree | f1cfacb1829225ae5104bb2e5f7de730e63424dc /config/cmake_ext_mod | |
parent | bfde29127563374424a7d80a2a1f10de7626af19 (diff) | |
download | hdf5-d4a9a064cbcc11965cc67c79c1690a7f92c2e1cb.zip hdf5-d4a9a064cbcc11965cc67c79c1690a7f92c2e1cb.tar.gz hdf5-d4a9a064cbcc11965cc67c79c1690a7f92c2e1cb.tar.bz2 |
Merge windows compiler fixes #912 (#948)
Diffstat (limited to 'config/cmake_ext_mod')
-rw-r--r-- | config/cmake_ext_mod/ConfigureChecks.cmake | 1 | ||||
-rw-r--r-- | config/cmake_ext_mod/HDFUseCXX.cmake | 67 |
2 files changed, 3 insertions, 65 deletions
diff --git a/config/cmake_ext_mod/ConfigureChecks.cmake b/config/cmake_ext_mod/ConfigureChecks.cmake index 004aded..699dfa4 100644 --- a/config/cmake_ext_mod/ConfigureChecks.cmake +++ b/config/cmake_ext_mod/ConfigureChecks.cmake @@ -122,6 +122,7 @@ CHECK_INCLUDE_FILE_CONCAT ("setjmp.h" ${HDF_PREFIX}_HAVE_SETJMP_H) CHECK_INCLUDE_FILE_CONCAT ("stddef.h" ${HDF_PREFIX}_HAVE_STDDEF_H) CHECK_INCLUDE_FILE_CONCAT ("stdint.h" ${HDF_PREFIX}_HAVE_STDINT_H) CHECK_INCLUDE_FILE_CONCAT ("unistd.h" ${HDF_PREFIX}_HAVE_UNISTD_H) +CHECK_INCLUDE_FILE_CONCAT ("pwd.h" ${HDF_PREFIX}_HAVE_PWD_H) # Windows CHECK_INCLUDE_FILE_CONCAT ("io.h" ${HDF_PREFIX}_HAVE_IO_H) diff --git a/config/cmake_ext_mod/HDFUseCXX.cmake b/config/cmake_ext_mod/HDFUseCXX.cmake index 580c409..fcd3ba6 100644 --- a/config/cmake_ext_mod/HDFUseCXX.cmake +++ b/config/cmake_ext_mod/HDFUseCXX.cmake @@ -43,68 +43,5 @@ if (${HDF_PREFIX}_HAVE_STDINT_H AND CMAKE_CXX_COMPILER_LOADED) endif () endif () -# For other CXX specific tests, use this MACRO. -macro (HDF_CXX_FUNCTION_TEST OTHER_TEST) - if (NOT DEFINED ${OTHER_TEST}) - set (MACRO_CHECK_FUNCTION_DEFINITIONS "-D${OTHER_TEST} ${CMAKE_REQUIRED_FLAGS}") - set (OTHER_TEST_ADD_LIBRARIES) - if (HDF5_REQUIRED_LIBRARIES) - set (OTHER_TEST_ADD_LIBRARIES "-DLINK_LIBRARIES:STRING=${HDF5_REQUIRED_LIBRARIES}") - endif () - - foreach (def - HAVE_SYS_TIME_H - HAVE_UNISTD_H - HAVE_SYS_TYPES_H - HAVE_SYS_SOCKET_H - HAVE_SYS_FILE_H - ) - if ("${${HDF_PREFIX}_${def}}") - set (MACRO_CHECK_FUNCTION_DEFINITIONS "${MACRO_CHECK_FUNCTION_DEFINITIONS} -D${def}") - endif () - endforeach () - - if (LARGEFILE) - set (MACRO_CHECK_FUNCTION_DEFINITIONS - "${MACRO_CHECK_FUNCTION_DEFINITIONS} -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE" - ) - endif () - - if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") - message (TRACE "Performing ${OTHER_TEST}") - endif () - TRY_COMPILE (${OTHER_TEST} - ${CMAKE_BINARY_DIR} - ${HDF_RESOURCES_EXT_DIR}/HDFCXXTests.cpp - CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=${MACRO_CHECK_FUNCTION_DEFINITIONS} - "${OTHER_TEST_ADD_LIBRARIES}" - OUTPUT_VARIABLE OUTPUT - ) - if (${OTHER_TEST} EQUAL 0) - set (${OTHER_TEST} 1 CACHE INTERNAL "CXX test ${FUNCTION}") - if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") - message (VERBOSE "Performing CXX Test ${OTHER_TEST} - Success") - endif () - else () - if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") - message (VERBOSE "Performing CXX Test ${OTHER_TEST} - Failed") - endif () - set (${OTHER_TEST} "" CACHE INTERNAL "CXX test ${FUNCTION}") - file (APPEND ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeError.log - "Performing CXX Test ${OTHER_TEST} failed with the following output:\n" - "${OUTPUT}\n" - ) - endif () - endif () -endmacro () - -#----------------------------------------------------------------------------- -# Check a bunch of cxx functions -#----------------------------------------------------------------------------- -if (CMAKE_CXX_COMPILER_LOADED) - foreach (cxx_test - CXX_HAVE_OFFSETOF - ) - HDF_CXX_FUNCTION_TEST (${cxx_test}) - endforeach () -endif () +#Always define +set (${HDF_PREFIX}_CXX_HAVE_OFFSETOF 1) |