Browse Source

Use `-lfoo` form in pkg-config file if dependency doesn't look like a path

So e.g. `-lpthread` is added to the pkg-config file instead of just
`pthread`.
charconv
Martchus 1 year ago
parent
commit
0be639ea97
  1. 6
      cmake/modules/LibraryTarget.cmake

6
cmake/modules/LibraryTarget.cmake

@ -365,7 +365,11 @@ macro (compute_dependencies_for_package_config DEPENDS OUTPUT_VAR_PKGS OUTPUT_VA
"${OUTPUT_VAR_PKGS}" "${OUTPUT_VAR_LIBS}" NO)
else ()
# add raw dependency
set(${OUTPUT_VAR_LIBS} "${${OUTPUT_VAR_LIBS}} ${DEPENDENCY}")
if (DEPENDENCY MATCHES ".*/.*")
set(${OUTPUT_VAR_LIBS} "${${OUTPUT_VAR_LIBS}} ${DEPENDENCY}")
else ()
set(${OUTPUT_VAR_LIBS} "${${OUTPUT_VAR_LIBS}} -l${DEPENDENCY}")
endif ()
endif ()
endforeach ()
endmacro ()

Loading…
Cancel
Save