Skip to content

Commit 84e61d0

Browse files
committed
remove ABI check, require CMake >= 3.19
1 parent 773ee2f commit 84e61d0

File tree

8 files changed

+10
-103
lines changed

8 files changed

+10
-103
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
cmake_minimum_required(VERSION 3.14...3.28)
1+
cmake_minimum_required(VERSION 3.19...3.28)
22

33
get_property(is_multi_config GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
44
if(NOT is_multi_config AND NOT (CMAKE_BUILD_TYPE OR DEFINED ENV{CMAKE_BUILD_TYPE}))

cmake/FindHDF5.cmake

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,8 @@ Targets
6060
#]=======================================================================]
6161

6262
include(CheckSymbolExists)
63-
include(CheckCSourceCompiles)
64-
include(CheckFortranSourceCompiles)
63+
include(CheckSourceCompiles)
64+
6565

6666
function(get_flags exec outvar)
6767

@@ -146,13 +146,13 @@ endif()
146146
# get version
147147
# from CMake/Modules/FindHDF5.cmake
148148
file(STRINGS ${h5_conf} _def
149-
REGEX "^[ \t]*#[ \t]*define[ \t]+H5_VERSION[ \t]+"
149+
REGEX "^[ \t]*#[ \t]*define[ \t]+H5_VERSION[ \t]+"
150150
)
151151
message(DEBUG "HDF5 version define: ${_def}")
152152

153153
if("${_def}" MATCHES "H5_VERSION[ \t]+\"([0-9]+\\.[0-9]+\\.[0-9]+)")
154154
set(HDF5_VERSION "${CMAKE_MATCH_1}")
155-
endif()
155+
endif()
156156
message(DEBUG "HDF5 version match 0, 1: ${CMAKE_MATCH_0} ${CMAKE_MATCH_1}")
157157

158158
# avoid picking up incompatible zlib over the desired zlib
@@ -501,7 +501,7 @@ if(HDF5_ROOT)
501501
NO_DEFAULT_PATH
502502
HINTS ${HDF5_ROOT}
503503
PATH_SUFFIXES ${hdf5_binsuf}
504-
DOC "HDF5 Fortran compiler script"
504+
DOC "HDF5 Fortran compiler script"
505505
)
506506
else()
507507
find_program(HDF5_Fortran_COMPILER_EXECUTABLE
@@ -695,7 +695,7 @@ else()
695695
]=])
696696
endif(HDF5_parallel_FOUND)
697697

698-
check_c_source_compiles("${src}" HDF5_C_links)
698+
check_source_compiles(C "${src}" HDF5_C_links)
699699

700700
endfunction(check_c_links)
701701

@@ -736,7 +736,7 @@ else()
736736
end program")
737737
endif()
738738

739-
check_fortran_source_compiles(${src} HDF5_Fortran_links SRC_EXT f90)
739+
check_source_compiles(Fortran ${src} HDF5_Fortran_links)
740740

741741
endfunction(check_fortran_links)
742742

@@ -785,6 +785,7 @@ if(NOT HDF5_ROOT)
785785
endif()
786786
endif()
787787

788+
788789
# --- library suffixes
789790

790791
set(hdf5_lsuf lib hdf5/lib) # need explicit "lib" for self-built HDF5

cmake/abi_check/CMakeLists.txt

Lines changed: 0 additions & 19 deletions
This file was deleted.

cmake/abi_check/addone.c

Lines changed: 0 additions & 5 deletions
This file was deleted.

cmake/abi_check/addone.f90

Lines changed: 0 additions & 13 deletions
This file was deleted.

cmake/abi_check/main.c

Lines changed: 0 additions & 14 deletions
This file was deleted.

cmake/abi_check/main.f90

Lines changed: 0 additions & 24 deletions
This file was deleted.

cmake/compilers.cmake

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,8 @@
1-
# check C and Fortran compiler ABI compatibility
2-
3-
if(NOT abi_ok)
4-
message(CHECK_START "checking that compilers can link together")
5-
try_compile(abi_ok
6-
${CMAKE_CURRENT_BINARY_DIR}/abi_check ${CMAKE_CURRENT_LIST_DIR}/abi_check
7-
abi_check
8-
)
9-
if(abi_ok)
10-
message(CHECK_PASS "OK")
11-
else()
12-
set(err_log ${CMAKE_CURRENT_BINARY_DIR}/abi_check/CMakeError.log)
13-
message(FATAL_ERROR "ABI-incompatible compilers:
14-
C compiler ${CMAKE_C_COMPILER_ID} ${CMAKE_C_COMPILER_VERSION}
15-
Fortran compiler ${CMAKE_Fortran_COMPILER_ID} ${CMAKE_Fortran_COMPILER_VERSION}")
16-
endif()
17-
endif()
18-
191
# --- C compile flags
202
if(CMAKE_C_COMPILER_ID MATCHES "Clang|GNU|^Intel")
213
add_compile_options(
224
"$<$<AND:$<COMPILE_LANGUAGE:C>,$<CONFIG:Debug>>:-Wextra>"
23-
"$<$<COMPILE_LANGUAGE:C>:-Wall>"
24-
"$<$<COMPILE_LANGUAGE:C>:-Werror=implicit-function-declaration>"
5+
"$<$<COMPILE_LANGUAGE:C>:-Wall;-Werror=implicit-function-declaration>"
256
)
267
elseif(CMAKE_C_COMPILER_ID MATCHES "MSVC")
278
add_compile_options("$<$<COMPILE_LANGUAGE:C>:/W3>")

0 commit comments

Comments
 (0)