summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2006-09-16 15:47:21 (GMT)
committerBrad King <brad.king@kitware.com>2006-09-16 15:47:21 (GMT)
commit147b4ff102a5656da5146a9301ae85ba603d29b8 (patch)
tree6512885bbe2b0861885d90fbdb169ad1ba684dd2 /Modules
parent0a4e2020b58b83739d0f44eb5c3c3462be8cd8d9 (diff)
downloadCMake-147b4ff102a5656da5146a9301ae85ba603d29b8.zip
CMake-147b4ff102a5656da5146a9301ae85ba603d29b8.tar.gz
CMake-147b4ff102a5656da5146a9301ae85ba603d29b8.tar.bz2
BUG: Need -Wl, to pass linker flags when using gcc on Sun.
Diffstat (limited to 'Modules')
-rw-r--r--Modules/Platform/SunOS.cmake26
1 files 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)