CMake: Fix Fortran cross-compilation support

Refactor the cross-compilation infrastructure to rely on the standard
CMAKE_CROSSCOMPILING_EMULATOR variable instead of the custom
CROSSCOMPILING_PATH environment hack.

Key changes:
- Removed `ENVIRONMENT "${CROSSCOMPILING_PATH}"` from all test definitions.
- Updated custom commands (e.g., H5match_types, H5_gen) to invoke the
  emulator explicitly when cross-compiling.
- Updated ConfigureChecks.cmake and HDF5UseFortran.cmake to enable
  `try_run` checks when an emulator is defined.
- Added config/toolchain/mingw-w64-x86-64-wine.sh wrapper to automatically
  locate MinGW runtime libraries (like libgfortran) for Wine execution.
- Cleaned up toolchain files to remove hardcoded emulator paths, deferring
  configuration to the build environment.
This commit is contained in:
Julien Schueller
2026-02-13 14:45:02 -06:00
committed by GitHub
parent 3748e4308e
commit d58638be09
60 changed files with 110 additions and 379 deletions
-1
View File
@@ -33,7 +33,6 @@ else ()
endif ()
set_tests_properties (CPP_testhdf5 PROPERTIES
WORKING_DIRECTORY ${PROJECT_BINARY_DIR}
ENVIRONMENT "${CROSSCOMPILING_PATH}"
)
if ("CPP_testhdf5" MATCHES "${HDF5_DISABLE_TESTS_REGEX}")
set_tests_properties (CPP_testhdf5 PROPERTIES DISABLED true)
-1
View File
@@ -37,7 +37,6 @@ macro (ADD_VFD_TEST vfdname resultcode)
)
set_tests_properties (CPP_VFD-${vfdname}-cpp_testhdf5 PROPERTIES
TIMEOUT ${CTEST_SHORT_TIMEOUT}
ENVIRONMENT "${CROSSCOMPILING_PATH}"
)
if ("CPP_VFD-${vfdname}-cpp_testhdf5" MATCHES "${HDF5_DISABLE_TESTS_REGEX}")
set_tests_properties (CPP_VFD-${vfdname}-cpp_testhdf5 PROPERTIES DISABLED true)