From 96e362fdc9c6b138461919c96ef5e5a712dad8fb Mon Sep 17 00:00:00 2001 From: Paul Zehner Date: Thu, 24 Jun 2021 12:09:52 +0900 Subject: Fujitsu: Add IPO support for Fortran --- Modules/Compiler/Fujitsu.cmake | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Modules/Compiler/Fujitsu.cmake b/Modules/Compiler/Fujitsu.cmake index 13bc57c..78495cb 100644 --- a/Modules/Compiler/Fujitsu.cmake +++ b/Modules/Compiler/Fujitsu.cmake @@ -26,6 +26,16 @@ macro(__compiler_fujitsu lang) set(CMAKE_${lang}_LINKER_WRAPPER_FLAG "-Wl,") set(CMAKE_${lang}_LINKER_WRAPPER_FLAG_SEP ",") + # IPO flag + set(_CMAKE_${lang}_IPO_SUPPORTED_BY_CMAKE YES) + if ("${lang}" STREQUAL "Fortran") + # Supported by Fortran compiler only + set(_CMAKE_${lang}_IPO_MAY_BE_SUPPORTED_BY_COMPILER YES) + set(CMAKE_${lang}_COMPILE_OPTIONS_IPO "-Klto") + else() + set(_CMAKE_${lang}_IPO_MAY_BE_SUPPORTED_BY_COMPILER NO) + endif() + # How to actually call the compiler set(CMAKE_${lang}_CREATE_PREPROCESSED_SOURCE " -E $<$:-Cpp> > ") -- cgit v0.12