Skip to content

Commit

Permalink
For static make sure we grab private libs for pkg-config manual
Browse files Browse the repository at this point in the history
  • Loading branch information
mitchcapper committed Dec 7, 2024
1 parent b6252f0 commit 7cbc5d4
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
10 changes: 9 additions & 1 deletion helpers.sh
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,16 @@ pkg_config_manual_add(){
echo $PKG_CONFIG_PATH
for VAR in "$@"; do
pkg-config --print-errors "${VAR}"
local ADD_LIBS=`pkg-config --libs "${VAR}"`
staticAdd=""
if [[ $BLD_CONFIG_PREFER_STATIC_LINKING -eq 1 ]]; then
staticAdd="--static"
fi
local ADD_LIBS=`pkg-config $staticAdd --libs "${VAR}"`
local ADD_FLAGS=`pkg-config --cflags "${VAR}"`
if [[ -z "${ADD_LIBS}" && -z "${ADD_LIBS}" ]]; then
echo "Error Asked to not able to find pkg-config for $VAR but it returned no libs or flags, something probably wrong" 1>&2;
exit 1
fi
CFLAGS="${CFLAGS} ${ADD_FLAGS}"
#not everrything pays attention to LIBS=
LDFLAGS="${LDFLAGS} ${ADD_LIBS}"
Expand Down
1 change: 1 addition & 0 deletions helpers_vcpkg.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@


vcpkg_ensure_installed(){
unset VCPKG_ROOT #can be set by visual studio so we want to unset it to be safe
echo CHECKING FOR $BLD_CONFIG_VCPKG_BIN
if [[ -f "${BLD_CONFIG_VCPKG_BIN}" ]]; then
return
Expand Down

0 comments on commit 7cbc5d4

Please sign in to comment.