mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-11 16:32:14 -06:00
FindHDF5: Tolerate failure during compiler interrogation
Check that the file that is accessed via `file(STRINGS...)` truly exists. This is not the case in some EMSCRIPTEN/WebASM builds where we want to overwrite the HDF5 find logic manually. The missing check here prevents that one can overwrite the search logic in exotic environments.
This commit is contained in:
@@ -242,7 +242,7 @@ function(_HDF5_test_regular_compiler_C success version is_parallel)
|
||||
COPY_FILE ${scratch_directory}/compiler_has_h5_c
|
||||
)
|
||||
endif()
|
||||
if(${success})
|
||||
if(${success} AND EXISTS ${scratch_directory}/compiler_has_h5_c)
|
||||
file(STRINGS ${scratch_directory}/compiler_has_h5_c INFO_STRINGS
|
||||
REGEX "^INFO:"
|
||||
)
|
||||
@@ -290,7 +290,7 @@ function(_HDF5_test_regular_compiler_CXX success version is_parallel)
|
||||
COPY_FILE ${scratch_directory}/compiler_has_h5_cxx
|
||||
)
|
||||
endif()
|
||||
if(${success})
|
||||
if(${success} AND EXISTS ${scratch_directory}/compiler_has_h5_cxx)
|
||||
file(STRINGS ${scratch_directory}/compiler_has_h5_cxx INFO_STRINGS
|
||||
REGEX "^INFO:"
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user