GeneratePkgConfig: ignore DEBUG-only dependencies.

GitOrigin-RevId: f4c551006003879bdb079d36fdf3ef76eb553a14
This commit is contained in:
levlam 2020-10-12 23:10:28 +03:00
parent 885a9d8e9c
commit cb0688d792

View File

@ -1,13 +1,15 @@
function(get_relative_link REL PATH) function(get_relative_link OUTPUT PATH)
get_filename_component(NAME ${PATH} NAME_WE) get_filename_component(NAME ${PATH} NAME_WE)
if(${NAME} MATCHES "^lib") if (${PATH} MATCHES "^[$]<[$]<CONFIG:DEBUG>:")
set(LINK "")
elseif (${NAME} MATCHES "^lib")
string(REGEX REPLACE "^lib" "-l" LINK ${NAME}) string(REGEX REPLACE "^lib" "-l" LINK ${NAME})
elseif (${NAME} MATCHES "^-") elseif (${NAME} MATCHES "^-")
set(LINK ${NAME}) set(LINK ${NAME})
else() else()
string(CONCAT LINK "-l" ${NAME}) string(CONCAT LINK "-l" ${NAME})
endif() endif()
set(${REL} ${LINK} PARENT_SCOPE) set(${OUTPUT} ${LINK} PARENT_SCOPE)
endfunction() endfunction()
function(generate_pkgconfig TARGET DESCRIPTION) function(generate_pkgconfig TARGET DESCRIPTION)
@ -24,8 +26,10 @@ function(generate_pkgconfig TARGET DESCRIPTION)
else() else()
set(HAS_LIBS 1) set(HAS_LIBS 1)
get_relative_link(LINK ${LIB}) get_relative_link(LINK ${LIB})
if (NOT LINK EQUAL "")
list(APPEND LIBS ${LINK}) list(APPEND LIBS ${LINK})
endif() endif()
endif()
endforeach() endforeach()
if (HAS_REQS) if (HAS_REQS)