diff options
-rw-r--r-- | Modules/Compiler/Fujitsu.cmake | 10 | ||||
-rw-r--r-- | Modules/FindOpenMP.cmake | 4 |
2 files changed, 14 insertions, 0 deletions
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 "<CMAKE_${lang}_COMPILER> <DEFINES> <INCLUDES> <FLAGS> -E $<$<COMPILE_LANGUAGE:Fortran>:-Cpp> <SOURCE> > <PREPROCESSED_SOURCE>") diff --git a/Modules/FindOpenMP.cmake b/Modules/FindOpenMP.cmake index e982e2d..929a809 100644 --- a/Modules/FindOpenMP.cmake +++ b/Modules/FindOpenMP.cmake @@ -570,6 +570,10 @@ foreach(LANG IN LISTS OpenMP_FINDLIST) separate_arguments(_OpenMP_${LANG}_OPTIONS NATIVE_COMMAND "${OpenMP_${LANG}_FLAGS}") set_property(TARGET OpenMP::OpenMP_${LANG} PROPERTY INTERFACE_COMPILE_OPTIONS "$<$<COMPILE_LANGUAGE:${LANG}>:${_OpenMP_${LANG}_OPTIONS}>") + if(CMAKE_${LANG}_COMPILER_ID STREQUAL "Fujitsu") + set_property(TARGET OpenMP::OpenMP_${LANG} PROPERTY + INTERFACE_LINK_OPTIONS "${OpenMP_${LANG}_FLAGS}") + endif() unset(_OpenMP_${LANG}_OPTIONS) endif() if(OpenMP_${LANG}_INCLUDE_DIRS) |