mirror of
https://gitlab.kitware.com/cmake/cmake.git
synced 2026-09-25 04:09:36 +03:00
FortranCInterface: Fix failure with gfortran 12 and Clang
The C flags added by commit 6a0ce19ce1 (FortranCInterface: Fix
compatibility with GCC gfortran 12 LTO, 2022-01-19, v3.22.2~5^2)
should only be added for the GNU C compiler.
Fixes: #23500
Issue: #23123
This commit is contained in:
@@ -112,6 +112,9 @@ if(CMAKE_Fortran_COMPILER_ID STREQUAL "GNU" AND
|
|||||||
CMAKE_Fortran_COMPILER_VERSION VERSION_GREATER_EQUAL 12)
|
CMAKE_Fortran_COMPILER_VERSION VERSION_GREATER_EQUAL 12)
|
||||||
target_compile_options(FortranCInterface PRIVATE "-fno-lto")
|
target_compile_options(FortranCInterface PRIVATE "-fno-lto")
|
||||||
target_compile_options(myfort PRIVATE "-flto=auto" "-ffat-lto-objects")
|
target_compile_options(myfort PRIVATE "-flto=auto" "-ffat-lto-objects")
|
||||||
|
endif()
|
||||||
|
if(CMAKE_C_COMPILER_ID STREQUAL "GNU" AND
|
||||||
|
CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 12)
|
||||||
target_compile_options(symbols PRIVATE "-flto=auto" "-ffat-lto-objects")
|
target_compile_options(symbols PRIVATE "-flto=auto" "-ffat-lto-objects")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user