BUG: Need -Wl, to pass linker flags when using gcc on Sun.

This commit is contained in:
Brad King 2006-09-16 11:47:21 -04:00
parent 0a4e2020b5
commit 147b4ff102
1 changed files with 22 additions and 4 deletions

View File

@ -76,7 +76,25 @@ ENDIF(NOT CMAKE_COMPILER_IS_GNUCXX)
# building a shared library, shared module, or executable that links
# to other libraries to select whether to use the static or shared
# versions of the libraries.
FOREACH(type SHARED_LIBRARY SHARED_MODULE EXE)
SET(CMAKE_${type}_LINK_STATIC_C_FLAGS "-Bstatic")
SET(CMAKE_${type}_LINK_DYNAMIC_C_FLAGS "-Bdynamic")
ENDFOREACH(type)
IF(CMAKE_COMPILER_IS_GNUCC)
FOREACH(type SHARED_LIBRARY SHARED_MODULE EXE)
SET(CMAKE_${type}_LINK_STATIC_C_FLAGS "-Wl,-Bstatic")
SET(CMAKE_${type}_LINK_DYNAMIC_C_FLAGS "-Wl,-Bdynamic")
ENDFOREACH(type)
ELSE(CMAKE_COMPILER_IS_GNUCC)
FOREACH(type SHARED_LIBRARY SHARED_MODULE EXE)
SET(CMAKE_${type}_LINK_STATIC_C_FLAGS "-Bstatic")
SET(CMAKE_${type}_LINK_DYNAMIC_C_FLAGS "-Bdynamic")
ENDFOREACH(type)
ENDIF(CMAKE_COMPILER_IS_GNUCC)
IF(CMAKE_COMPILER_IS_GNUCXX)
FOREACH(type SHARED_LIBRARY SHARED_MODULE EXE)
SET(CMAKE_${type}_LINK_STATIC_CXX_FLAGS "-Wl,-Bstatic")
SET(CMAKE_${type}_LINK_DYNAMIC_CXX_FLAGS "-Wl,-Bdynamic")
ENDFOREACH(type)
ELSE(CMAKE_COMPILER_IS_GNUCXX)
FOREACH(type SHARED_LIBRARY SHARED_MODULE EXE)
SET(CMAKE_${type}_LINK_STATIC_CXX_FLAGS "-Bstatic")
SET(CMAKE_${type}_LINK_DYNAMIC_CXX_FLAGS "-Bdynamic")
ENDFOREACH(type)
ENDIF(CMAKE_COMPILER_IS_GNUCXX)