Fixes Solaris Studio build.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=50802
Signed-off-by: Vinson Lee <[email protected]>
---
 CMakeLists.txt |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 893a14d..2f0c280 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -152,6 +152,14 @@ if (MINGW)
        endif ()
 endif ()
 
+if (${CMAKE_C_COMPILER_ID} STREQUAL "SunPro")
+       # Use C++ to link C files.
+       # http://developers.sun.com/solaris/articles/mixing.html#linking
+       # Modified rule from Modules/CMakeCInformation.cmake.
+       set (CMAKE_C_LINK_EXECUTABLE
+               "<CMAKE_CXX_COMPILER> <FLAGS> <CMAKE_C_LINK_FLAGS> <LINK_FLAGS> 
<OBJECTS> -o <TARGET> <LINK_LIBRARIES>")
+endif()
+
 if (WIN32)
        # MSVC & MinGW only define & use APIENTRY
        add_definitions (-DGLAPIENTRY=__stdcall)
-- 
1.7.3.2

_______________________________________________
Piglit mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/piglit

Reply via email to