Skip to content

Commit e4808b0

Browse files
committed
don't repeat abi check
1 parent a939815 commit e4808b0

File tree

4 files changed

+12
-8
lines changed

4 files changed

+12
-8
lines changed

CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ cmake_minimum_required(VERSION 3.14)
1212

1313
project(Fortran_C_CXX_interface
1414
LANGUAGES C Fortran CXX
15-
VERSION 1.1.0)
15+
VERSION 1.1.1)
1616

1717
include(CTest)
1818

cmake/abi_check/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
cmake_minimum_required(VERSION 3.14)
1+
cmake_minimum_required(VERSION 3.13)
22
project(abi_check LANGUAGES C Fortran)
33

44
add_library(addone OBJECT addone.c)

cmake/compilers.cmake

+9-5
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
11
# check C and Fortran compiler ABI compatibility
22

3-
try_compile(abi_ok ${CMAKE_CURRENT_BINARY_DIR}/abi_check ${CMAKE_CURRENT_LIST_DIR}/abi_check abi_check)
4-
if(abi_ok)
5-
message(STATUS "C and Fortran compiler detected to be ABI-compatible.")
6-
else()
7-
message(FATAL ERROR "C compiler {CMAKE_C_COMPILER_ID} {CMAKE_C_COMPILER_VERSION} and Fortran compiler ${CMAKE_Fortran_COMPILER_ID} ${CMAKE_Fortran_COMPILER_VERSION} are ABI-incompatible.")
3+
if(NOT abi_ok)
4+
message(CHECK_START "checking that C and Fortran compilers can link")
5+
try_compile(abi_ok ${CMAKE_CURRENT_BINARY_DIR}/abi_check ${CMAKE_CURRENT_LIST_DIR}/abi_check abi_check)
6+
if(abi_ok)
7+
message(CHECK_PASS "OK")
8+
else()
9+
message(FATAL ERROR "C compiler {CMAKE_C_COMPILER_ID} {CMAKE_C_COMPILER_VERSION} and Fortran compiler ${CMAKE_Fortran_COMPILER_ID} ${CMAKE_Fortran_COMPILER_VERSION} are ABI-incompatible.")
10+
endif()
811
endif()
912

13+
# --- compiler options
1014

1115
if(CMAKE_Fortran_COMPILER_ID STREQUAL GNU)
1216
# this helps show the options are/aren't conflicting between C and Fortran

meson.build

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
project('Fortran_c_cxx_interface', 'c', 'cpp', 'fortran',
2-
version : '1.0.0',
2+
version : '1.1.1',
33
meson_version: '>= 0.52.0',
44
default_options : ['default_library=static', 'buildtype=release', 'warning_level=3',
55
'cpp_std=c++11', 'c_std=c99'])

0 commit comments

Comments
 (0)