adaptation of autocmake for the static linking

This commit is contained in:
Miro ILIAS
2015-08-02 19:00:34 +02:00
parent 44832b57a7
commit 7150ae9793
9 changed files with 84 additions and 18 deletions

View File

@ -1,10 +1,14 @@
if(LAPACK_FOUND)
if(CMAKE_Fortran_COMPILER_ID MATCHES PGI)
# we remove -rdynamic flag added by CMake
# PGI Fortran does not recognize this flag
SET(CMAKE_SHARED_LIBRARY_LINK_Fortran_FLAGS)
endif()
if(CMAKE_Fortran_COMPILER_ID MATCHES PGI)
# remove -rdynamic flag offensive for PGI Fortran
list(REMOVE_ITEM CMAKE_SHARED_LIBRARY_LINK_Fortran_FLAGS "-rdynamic")
endif()
if(CMAKE_Fortran_COMPILER_ID MATCHES Intel AND ENABLE_STATIC_LINKING)
# prevent "ifort: ... warning #10121: overriding '-static-intel' with '-i_dynamic'"
list(REMOVE_ITEM CMAKE_SHARED_LIBRARY_LINK_Fortran_FLAGS "-i_dynamic")
endif()
if(LAPACK_FOUND)
add_executable(example example.F90)
target_link_libraries(example ${MATH_LIBS})
else()