From: Aurelien Jacobs Date: Thu, 19 May 2016 22:23:11 +0000 (+0200) Subject: cmake: use pkg-config ldflags directly instead of spliting libs and dirs X-Git-Tag: pulseview-0.4.0~293 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=bb4dede4c8bd711628566d3eb2136442f7205a41;p=pulseview.git cmake: use pkg-config ldflags directly instead of spliting libs and dirs This allows picking some necessary linker flags such as -Wl,--whole-archive --- diff --git a/CMakeLists.txt b/CMakeLists.txt index a3b41205..9dac69f2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -390,15 +390,13 @@ set(PULSEVIEW_LINK_LIBS ) if(STATIC_PKGDEPS_LIBS) - link_directories(${PKGDEPS_STATIC_LIBRARY_DIRS}) - list(APPEND PULSEVIEW_LINK_LIBS ${PKGDEPS_STATIC_LIBRARIES}) + list(APPEND PULSEVIEW_LINK_LIBS ${PKGDEPS_STATIC_LDFLAGS}) if(WIN32) # Workaround for a MinGW linking issue. list(APPEND PULSEVIEW_LINK_LIBS "-llzma -llcms2") endif() else() - link_directories(${PKGDEPS_LIBRARY_DIRS}) - list(APPEND PULSEVIEW_LINK_LIBS ${PKGDEPS_LIBRARIES}) + list(APPEND PULSEVIEW_LINK_LIBS ${PKGDEPS_LDFLAGS}) endif() if(WIN32)