diff --git a/cmake/CompilerConfiguration.cmake b/cmake/CompilerConfiguration.cmake index 1bc66d6003..1d901033a5 100644 --- a/cmake/CompilerConfiguration.cmake +++ b/cmake/CompilerConfiguration.cmake @@ -226,6 +226,8 @@ if(CMAKE_C_COMPILER_ID STREQUAL "Cray" AND CMAKE_C_COMPILER_VERSION endif() # Suppress GFortran runtime warnings when LIBXS provides the wrapper -if(CMAKE_Fortran_COMPILER_ID STREQUAL "GNU" AND CP2K_USE_LIBXS) +if(CMAKE_Fortran_COMPILER_ID STREQUAL "GNU" + AND CP2K_USE_LIBXS + AND NOT APPLE) add_link_options("-Wl,--wrap=_gfortran_runtime_warning_at") endif()