Skip to content

Commit

Permalink
Merge pull request #3274 from hadfl/aarch64
Browse files Browse the repository at this point in the history
pkg-config and cmake should be sysroot aware for cross-builds
  • Loading branch information
oetiker committed Jul 3, 2023
2 parents 7993065 + 207dbfb commit d9108fd
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
2 changes: 0 additions & 2 deletions build/glib/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,6 @@ pre_configure() {

CONFIGURE_CMD+=" --cross-file $SRCDIR/files/aarch64-gcc.txt"

export PKG_CONFIG_SYSROOT_DIR=${SYSROOT[$arch]}

# use GNU msgfmt; otherwise the build fails
PATH="$GNUBIN:$PATH:$OOCEBIN"
}
Expand Down
9 changes: 9 additions & 0 deletions lib/functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -462,6 +462,15 @@ set_crossgcc() {
|| CFLAGS[$arch]+=" --sysroot=${SYSROOT[$arch]}"
[[ ${CXXFLAGS[$arch]} =~ *--sysroot* ]] \
|| CXXFLAGS[$arch]+=" --sysroot=${SYSROOT[$arch]}"

export PKG_CONFIG_SYSROOT_DIR=${SYSROOT[$arch]}

[[ $CONFIGURE_CMD =~ $CMAKE* ]] && CONFIGURE_OPTS[$arch]+="
-DCMAKE_FIND_ROOT_PATH=${SYSROOT[$arch]}
-DCMAKE_FIND_ROOT_PATH_MODE_PROGRAM=NEVER
-DCMAKE_FIND_ROOT_PATH_MODE_LIBRARY=ONLY
-DCMAKE_FIND_ROOT_PATH_MODE_INCLUDE=ONLY
"
}

set_clangver() {
Expand Down

0 comments on commit d9108fd

Please sign in to comment.