mirror of
https://github.com/HDFGroup/hdf5.git
synced 2026-09-25 04:09:44 +03:00
Behavior:
Modify HDF5UseFortran.cmake to handle cross-compilation by providing default KINDs and sizes when CMAKE_CROSSCOMPILING is true.
Default values for INTEGER and REAL KINDs and their sizes are set when cross-compiling.
Error messages are adjusted to reflect cross-compilation scenarios.
Logic:
Conditional checks added for CMAKE_CROSSCOMPILING to determine if default values should be used.
Default values include INTEGER KINDs {1,2,4,8,16} and REAL KINDs {4,8,10,16}.
Default sizes for native kinds are set to 4 for INTEGER and REAL, and 8 for DOUBLE PRECISION when cross-compiling.
Misc:
Adjustments to verbose messages to indicate when defaults are used during cross-compilation.
18 lines
439 B
CMake
18 lines
439 B
CMake
# Uncomment the following to use cross-compiling
|
|
#set (CMAKE_SYSTEM_NAME Linux)
|
|
|
|
set (CMAKE_COMPILER_VENDOR "clang")
|
|
|
|
if(WIN32)
|
|
set (CMAKE_C_COMPILER clang-cl)
|
|
set (CMAKE_CXX_COMPILER clang-cl)
|
|
else()
|
|
set (CMAKE_C_COMPILER clang)
|
|
set (CMAKE_CXX_COMPILER clang++)
|
|
#set (CMAKE_Fortran_COMPILER flang)
|
|
endif()
|
|
set (CMAKE_EXPORT_COMPILE_COMMANDS ON)
|
|
|
|
# the following is used if cross-compiling
|
|
set (CMAKE_CROSSCOMPILING_EMULATOR "")
|