Skip to content

Commit

Permalink
optimized
Browse files Browse the repository at this point in the history
  • Loading branch information
leleliu008 committed Aug 17, 2024
1 parent a75d7dc commit 9379bf1
Showing 1 changed file with 25 additions and 4 deletions.
29 changes: 25 additions & 4 deletions xcpkg
Original file line number Diff line number Diff line change
Expand Up @@ -3102,6 +3102,8 @@ __install_the_given_package() {
STATIC_LIBRARY_SUFFIX=.a
SHARED_LIBRARY_SUFFIX=.dylib

#########################################################################################

if [ "$TARGET_PLATFORM_NAME-$TARGET_PLATFORM_ARCH" = "$NATIVE_OS_NAME-$NATIVE_OS_ARCH" ] ; then
CROSS_COMPILING=0
else
Expand All @@ -3110,6 +3112,12 @@ __install_the_given_package() {

#########################################################################################

# these two variable might be set in formula file to control cmakew's behavor
unset CMAKE_BUILD_TARGETS
unset CMAKE_INSTALL_COMPONENTS

#########################################################################################

if [ "$LOG_LEVEL" -ge "$LOG_LEVEL_VERBOSE" ] ; then
cat <<EOF
TIMESTAMP_UNIX = $TIMESTAMP_UNIX
Expand Down Expand Up @@ -5834,9 +5842,22 @@ EOF
-DCMAKE_TOOLCHAIN_FILE="$CMAKE_TOOLCHAIN_FILE" \
-DCMAKE_VERBOSE_MAKEFILE="$CMAKE_VERBOSE_MAKEFILE" \
-DCMAKE_COLOR_MAKEFILE="$CMAKE_COLOR_MAKEFILE" \
"$CMAKE_CONFIG_OPTIONS_EXTRA" "$@" &&
run "$CMAKE" --build "$PACKAGE_BCACHED_DIR" -- "-j$BUILD_NJOBS" &&
run "$CMAKE" --install "$PACKAGE_BCACHED_DIR"
"$CMAKE_CONFIG_OPTIONS_EXTRA" "$@"

if [ -z "$CMAKE_BUILD_TARGETS" ] ; then
run "$CMAKE" --build "$PACKAGE_BCACHED_DIR"
else
run "$CMAKE" --build "$PACKAGE_BCACHED_DIR" --target "$CMAKE_BUILD_TARGETS"
fi

if [ -z "$CMAKE_INSTALL_COMPONENTS" ] ; then
run "$CMAKE" --install "$PACKAGE_BCACHED_DIR"
else
for component in $CMAKE_INSTALL_COMPONENTS
do
run "$CMAKE" --install "$PACKAGE_BCACHED_DIR" --component "$component"
done
fi
fi
}

Expand Down Expand Up @@ -7889,7 +7910,7 @@ fi

##################################################################################

XCPKG_VERSION=0.22.10
XCPKG_VERSION=0.22.11

XCPKG_ARG0="$0"
XCPKG_ARG1="$1"
Expand Down

0 comments on commit 9379bf1

Please sign in to comment.