]> source.dussan.org Git - tigervnc.git/commitdiff
Put quotes around entire static link variables
authorPierre Ossman <ossman@cendio.se>
Tue, 28 Oct 2014 15:57:05 +0000 (16:57 +0100)
committerPierre Ossman <ossman@cendio.se>
Tue, 28 Oct 2014 15:57:05 +0000 (16:57 +0100)
CMake is very aggressive about minimising the list of libraries,
so we need to be similarily aggressive about quotes to make sure
we get everything we want and in the correct order.

cmake/StaticBuild.cmake

index 5800a0789512dcf433fb5701491700affe4f68d4..67f01b2f311d3114b7dfcb70764971cd77aee622 100644 (file)
@@ -44,7 +44,7 @@ if(BUILD_STATIC)
 
     # nanosleep() lives here on Solaris
     if(${CMAKE_SYSTEM_NAME} MATCHES "SunOS")
-      set(GNUTLS_LIBRARIES ${GNUTLS_LIBRARIES} -lrt)
+      set(GNUTLS_LIBRARIES "${GNUTLS_LIBRARIES} -lrt")
     endif()
   endif()
 
@@ -52,21 +52,21 @@ if(BUILD_STATIC)
     set(FLTK_LIBRARIES "-Wl,-Bstatic -lfltk_images -lpng -ljpeg -lfltk -Wl,-Bdynamic")
 
     if(WIN32)
-      set(FLTK_LIBRARIES ${FLTK_LIBRARIES} comctl32)
+      set(FLTK_LIBRARIES "${FLTK_LIBRARIES} -lcomctl32")
     elseif(APPLE)
-      set(FLTK_LIBRARIES ${FLTK_LIBRARIES} "-framework Cocoa")
+      set(FLTK_LIBRARIES "${FLTK_LIBRARIES} -framework Cocoa")
     else()
-      set(FLTK_LIBRARIES ${FLTK_LIBRARIES} m)
+      set(FLTK_LIBRARIES "${FLTK_LIBRARIES} -lm")
     endif()
 
     if(X11_FOUND AND NOT APPLE)
       if(${CMAKE_SYSTEM_NAME} MATCHES "SunOS")
-        set(FLTK_LIBRARIES ${FLTK_LIBRARIES} ${X11_Xcursor_LIB} ${X11_Xfixes_LIB} "-Wl,-Bstatic -lXft -Wl,-Bdynamic" fontconfig Xext -R/usr/sfw/lib)
+        set(FLTK_LIBRARIES "${FLTK_LIBRARIES} ${X11_Xcursor_LIB} ${X11_Xfixes_LIB} -Wl,-Bstatic -lXft -Wl,-Bdynamic -lfontconfig -lXext -R/usr/sfw/lib")
       else()
-        set(FLTK_LIBRARIES ${FLTK_LIBRARIES} "-Wl,-Bstatic -lXcursor -lXfixes -lXft -lfontconfig -lexpat -lfreetype -lbz2 -lXrender -lXext -lXinerama -Wl,-Bdynamic")
+        set(FLTK_LIBRARIES "${FLTK_LIBRARIES} -Wl,-Bstatic -lXcursor -lXfixes -lXft -lfontconfig -lexpat -lfreetype -lbz2 -lXrender -lXext -lXinerama -Wl,-Bdynamic")
       endif()
 
-      set(FLTK_LIBRARIES ${FLTK_LIBRARIES} X11)
+      set(FLTK_LIBRARIES "${FLTK_LIBRARIES} -lX11")
     endif()
   endif()
 
@@ -74,7 +74,7 @@ if(BUILD_STATIC)
   # them statically, even libXext. libX11 is somewhat stable, although
   # even it has had an ABI change once or twice.
   if(X11_FOUND AND NOT ${CMAKE_SYSTEM_NAME} MATCHES "SunOS")
-    set(X11_LIBRARIES "-Wl,-Bstatic -lXext -Wl,-Bdynamic" X11)
+    set(X11_LIBRARIES "-Wl,-Bstatic -lXext -Wl,-Bdynamic -lX11")
     if(X11_XTest_LIB)
       set(X11_XTest_LIB "-Wl,-Bstatic -lXtst -Wl,-Bdynamic")
     endif()