extend static flags to CXX

This commit is contained in:
Radovan Bast 2015-09-17 00:21:06 +02:00
parent b38e7ce3d2
commit d33cab4a43

View File

@ -18,13 +18,13 @@ option(ENABLE_STATIC_LINKING "Enable static libraries linking" OFF)
if(ENABLE_STATIC_LINKING) if(ENABLE_STATIC_LINKING)
if(DEFINED CMAKE_Fortran_COMPILER_ID) if(DEFINED CMAKE_Fortran_COMPILER_ID)
if(CMAKE_Fortran_COMPILER_ID MATCHES GNU) if(CMAKE_Fortran_COMPILER_ID MATCHES GNU)
set(CMAKE_Fortran_FLAGS "-static ${CMAKE_Fortran_FLAGS}") set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -static")
endif() endif()
if(CMAKE_Fortran_COMPILER_ID MATCHES Intel) if(CMAKE_Fortran_COMPILER_ID MATCHES Intel)
set(CMAKE_Fortran_FLAGS "-static -static-libgcc -static-intel ${CMAKE_Fortran_FLAGS}") set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -static -static-libgcc -static-intel")
endif() endif()
if(CMAKE_Fortran_COMPILER_ID MATCHES PGI) if(CMAKE_Fortran_COMPILER_ID MATCHES PGI)
set(CMAKE_Fortran_FLAGS "-Bstatic ${CMAKE_Fortran_FLAGS}") set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -Bstatic")
endif() endif()
endif() endif()
@ -32,8 +32,11 @@ if(ENABLE_STATIC_LINKING)
if(CMAKE_C_COMPILER_ID MATCHES GNU) if(CMAKE_C_COMPILER_ID MATCHES GNU)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -static -fpic") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -static -fpic")
endif() endif()
if(CMAKE_C_COMPILER_ID MATCHES Clang) endif()
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Bstatic -fpic")
if(DEFINED CMAKE_CXX_COMPILER_ID)
if(CMAKE_C_COMPILER_ID MATCHES GNU)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -static -fpic")
endif() endif()
endif() endif()
endif() endif()