Commit 479a17f0 authored by PRUVOST Florent's avatar PRUVOST Florent

add gcc flag --no-as-needed only if gnu and Linux

parent 7382e524
......@@ -880,11 +880,11 @@ if (MORSE_DISTRIB_DIR OR EXISTS "${CMAKE_SOURCE_DIR}/cmake_modules/")
get_directory_property( CHAMELEON_DEFINITIONS_LIST DIRECTORY ${CMAKE_SOURCE_DIR} COMPILE_DEFINITIONS )
include(PrintOpts)
if (${CMAKE_INSTALL_PREFIX} STREQUAL "/usr/local" OR ${CMAKE_INSTALL_PREFIX} STREQUAL "C:/Program Files")
if (CMAKE_INSTALL_PREFIX STREQUAL "/usr/local" OR CMAKE_INSTALL_PREFIX STREQUAL "C:/Program Files")
message("-- ${Yellow}Your CMAKE_INSTALL_PREFIX is ${CMAKE_INSTALL_PREFIX} which is a default system path."
"You may want to change it: set the CMAKE_INSTALL_PREFIX variable to do so.${ColourReset}")
"You may want to change it: set the CMAKE_INSTALL_PREFIX variable to do so${ColourReset}")
else()
message("-- ${Yellow}Your CMAKE_INSTALL_PREFIX is ${CMAKE_INSTALL_PREFIX}.${ColourReset}")
message("-- ${Yellow}Your CMAKE_INSTALL_PREFIX is ${CMAKE_INSTALL_PREFIX}${ColourReset}")
endif()
else(MORSE_DISTRIB_DIR OR EXISTS "${CMAKE_SOURCE_DIR}/cmake_modules/")
......
......@@ -307,7 +307,10 @@ if (BLA_VENDOR MATCHES "Intel*" OR BLA_VENDOR STREQUAL "All")
set(BLAS_SEARCH_LIBS "")
set(additional_flags "-Wl,--no-as-needed")
set(additional_flags "")
if (CMAKE_C_COMPILER_ID STREQUAL "GNU" AND CMAKE_SYSTEM_NAME STREQUAL "Linux")
set(additional_flags "-Wl,--no-as-needed")
endif()
if(BLA_F95)
......
......@@ -373,7 +373,9 @@ if( NOT FFTW_FOUND )
# MKL
if(FFTW_LOOK_FOR_MKL)
list(APPEND REQUIRED_LIBS "${CMAKE_THREAD_LIBS_INIT};-lm")
list(APPEND REQUIRED_LDFLAGS "-Wl,--no-as-needed")
if (CMAKE_C_COMPILER_ID STREQUAL "GNU" AND CMAKE_SYSTEM_NAME STREQUAL "Linux")
list(APPEND REQUIRED_LDFLAGS "-Wl,--no-as-needed")
endif()
endif()
# set required libraries for link
......
......@@ -366,7 +366,10 @@ if (BLA_VENDOR MATCHES "Intel" OR BLA_VENDOR STREQUAL "All")
set(LAPACK_SEARCH_LIBS "")
set(additional_flags "-Wl,--no-as-needed")
set(additional_flags "")
if (CMAKE_C_COMPILER_ID STREQUAL "GNU" AND CMAKE_SYSTEM_NAME STREQUAL "Linux")
set(additional_flags "-Wl,--no-as-needed")
endif()
if (BLA_F95)
set(LAPACK_mkl_SEARCH_SYMBOL "CHEEV")
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment