From: Pierre Ossman Date: Tue, 28 Oct 2014 15:57:05 +0000 (+0100) Subject: Put quotes around entire static link variables X-Git-Tag: v1.3.90~18^2~5 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=4790e114da83d5a2b4a048f3774f9b1751edc5ae;p=tigervnc.git Put quotes around entire static link variables 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. --- diff --git a/cmake/StaticBuild.cmake b/cmake/StaticBuild.cmake index 5800a078..67f01b2f 100644 --- a/cmake/StaticBuild.cmake +++ b/cmake/StaticBuild.cmake @@ -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()