From 147b4ff102a5656da5146a9301ae85ba603d29b8 Mon Sep 17 00:00:00 2001 From: Brad King Date: Sat, 16 Sep 2006 11:47:21 -0400 Subject: BUG: Need -Wl, to pass linker flags when using gcc on Sun. --- Modules/Platform/SunOS.cmake | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/Modules/Platform/SunOS.cmake b/Modules/Platform/SunOS.cmake index 54cb637..aa1e933 100644 --- a/Modules/Platform/SunOS.cmake +++ b/Modules/Platform/SunOS.cmake @@ -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) -- cgit v0.12