Skip to content
/ CMake Public

Commit 18f3dce

Browse files
FortranCInterface: handle LFortran lowercase symbol mangling
LFortran emits lowercase symbols without a trailing underscore by default (e.g. VerifyFortran → verifyfortran). Extend the FortranCInterface verification to recognize this symbol when the Fortran compiler is LFortran.
1 parent 9877e11 commit 18f3dce

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

Modules/FortranCInterface/Verify/CMakeLists.txt

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,18 @@ endif()
2222

2323
include(FortranCInterface)
2424

25-
FortranCInterface_HEADER(VerifyFortran.h SYMBOLS VerifyFortran)
25+
if(CMAKE_Fortran_COMPILER_ID STREQUAL "LFortran")
26+
FortranCInterface_HEADER(
27+
VerifyFortran.h
28+
SYMBOLS VerifyFortran verifyfortran
29+
)
30+
else()
31+
FortranCInterface_HEADER(
32+
VerifyFortran.h
33+
SYMBOLS VerifyFortran
34+
)
35+
endif()
36+
2637
include_directories(${VerifyFortranC_BINARY_DIR})
2738

2839
add_library(VerifyFortran STATIC VerifyFortran.f)

0 commit comments

Comments
 (0)