mirror of
https://github.com/Kitware/CMake.git
synced 2026-05-05 22:00:10 -05:00
FindHDF5: Find C component with only CXX compiler
For CXX-only projects it is sometimes useful to detect the C component even with just a CXX compiler. Fixes: #24241
This commit is contained in:
committed by
Christoph Junghans
parent
ff875ed859
commit
14c46fb16a
@@ -222,6 +222,10 @@ function(_HDF5_test_regular_compiler_C success version is_parallel)
|
||||
if(NOT ${success} OR
|
||||
NOT EXISTS ${scratch_directory}/compiler_has_h5_c)
|
||||
set(test_file ${scratch_directory}/cmake_hdf5_test.c)
|
||||
# CXX project without C enabled
|
||||
if(CMAKE_CXX_COMPILER_LOADED AND NOT CMAKE_C_COMPILER_LOADED)
|
||||
set(test_file ${scratch_directory}/cmake_hdf5_test.cpp)
|
||||
endif()
|
||||
file(WRITE ${test_file}
|
||||
"#include <hdf5.h>\n"
|
||||
"const char* info_ver = \"INFO\" \":\" H5_VERSION;\n"
|
||||
|
||||
Reference in New Issue
Block a user