mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-11-24 19:39:00 +08:00
[ffmpeg] Use nproc - 1 build jobs for ffmpeg instead of 6. (#12659)
This commit is contained in:
parent
913c7f91ce
commit
085225b7ba
@ -1,24 +0,0 @@
|
||||
#!/usr/bin/bash
|
||||
set -e
|
||||
export PATH=/usr/bin:$PATH
|
||||
export PKG_CONFIG_PATH="`cygpath -p ${PKG_CONFIG_PATH}`"
|
||||
# Export HTTP(S)_PROXY as http(s)_proxy:
|
||||
if [ "$HTTP_PROXY" ]; then
|
||||
export http_proxy=$HTTP_PROXY
|
||||
fi
|
||||
if [ "$HTTPS_PROXY" ]; then
|
||||
export https_proxy=$HTTPS_PROXY
|
||||
fi
|
||||
|
||||
PATH_TO_BUILD_DIR="`cygpath "$1"`"
|
||||
PATH_TO_SRC_DIR="`cygpath "$2"`"
|
||||
PATH_TO_PACKAGE_DIR="`cygpath "$3"`"
|
||||
# Note: $4 is extra configure options
|
||||
|
||||
cd "$PATH_TO_BUILD_DIR"
|
||||
echo "=== CONFIGURING ==="
|
||||
"$PATH_TO_SRC_DIR/configure" --toolchain=msvc "--prefix=$PATH_TO_PACKAGE_DIR" $4
|
||||
echo "=== BUILDING ==="
|
||||
make -j6
|
||||
echo "=== INSTALLING ==="
|
||||
make install
|
45
ports/ffmpeg/build.sh.in
Normal file
45
ports/ffmpeg/build.sh.in
Normal file
@ -0,0 +1,45 @@
|
||||
#!/bin/sh
|
||||
|
||||
set -e
|
||||
|
||||
export PATH=/usr/bin:$PATH
|
||||
|
||||
command -v cygpath >/dev/null && have_cygpath=1
|
||||
|
||||
cygpath() {
|
||||
if [ -n "$have_cygpath" ]; then
|
||||
command cygpath "$@"
|
||||
else
|
||||
eval _p='$'$#
|
||||
printf '%s\n' "$_p"
|
||||
fi
|
||||
}
|
||||
|
||||
export PKG_CONFIG_PATH="$(cygpath -p "${PKG_CONFIG_PATH}")"
|
||||
|
||||
# Export HTTP(S)_PROXY as http(s)_proxy:
|
||||
[ -n "$HTTP_PROXY" ] && export http_proxy="$HTTP_PROXY"
|
||||
[ -n "$HTTPS_PROXY" ] && export https_proxy="$HTTPS_PROXY"
|
||||
|
||||
PATH_TO_BUILD_DIR=$( cygpath "@BUILD_DIR@")
|
||||
PATH_TO_SRC_DIR=$( cygpath "@SOURCE_PATH@")
|
||||
PATH_TO_PACKAGE_DIR=$(cygpath "@INST_PREFIX@")
|
||||
|
||||
JOBS=@VCPKG_CONCURRENCY@
|
||||
|
||||
# Default to hardware concurrency if unset.
|
||||
: ${JOBS:=$(nproc)}
|
||||
|
||||
cd "$PATH_TO_BUILD_DIR"
|
||||
|
||||
echo "=== CONFIGURING ==="
|
||||
|
||||
sh "$PATH_TO_SRC_DIR/configure" "--prefix=$PATH_TO_PACKAGE_DIR" @CONFIGURE_OPTIONS@
|
||||
|
||||
echo "=== BUILDING ==="
|
||||
|
||||
make -j${JOBS}
|
||||
|
||||
echo "=== INSTALLING ==="
|
||||
|
||||
make install
|
@ -1,24 +0,0 @@
|
||||
#!/usr/bin/bash
|
||||
set -e
|
||||
export PATH=/usr/bin:$PATH
|
||||
# Export HTTP(S)_PROXY as http(s)_proxy:
|
||||
if [ "$HTTP_PROXY" ]; then
|
||||
export http_proxy=$HTTP_PROXY
|
||||
fi
|
||||
if [ "$HTTPS_PROXY" ]; then
|
||||
export https_proxy=$HTTPS_PROXY
|
||||
fi
|
||||
|
||||
PATH_TO_BUILD_DIR=$1
|
||||
PATH_TO_SRC_DIR=$2
|
||||
PATH_TO_PACKAGE_DIR=$3
|
||||
# Note: $4 is extra configure options
|
||||
|
||||
cd "$PATH_TO_BUILD_DIR"
|
||||
echo "=== CONFIGURING ==="
|
||||
chmod a+x "$PATH_TO_SRC_DIR/configure"
|
||||
"$PATH_TO_SRC_DIR/configure" "--prefix=$PATH_TO_PACKAGE_DIR" $4
|
||||
echo "=== BUILDING ==="
|
||||
make -j6
|
||||
echo "=== INSTALLING ==="
|
||||
make install
|
@ -36,22 +36,22 @@ else()
|
||||
set(LIB_PATH_VAR "LIBRARY_PATH")
|
||||
endif()
|
||||
|
||||
set(OPTIONS "--enable-asm --enable-yasm --disable-doc --enable-debug --enable-runtime-cpudetect")
|
||||
|
||||
if(VCPKG_TARGET_IS_WINDOWS)
|
||||
set(ENV{PATH} "$ENV{PATH};${YASM_EXE_PATH}")
|
||||
|
||||
set(BUILD_SCRIPT ${CMAKE_CURRENT_LIST_DIR}\\build.sh)
|
||||
|
||||
if(VCPKG_TARGET_ARCHITECTURE STREQUAL "arm" OR VCPKG_TARGET_ARCHITECTURE STREQUAL "arm64")
|
||||
vcpkg_acquire_msys(MSYS_ROOT PACKAGES perl gcc diffutils make pkg-config)
|
||||
else()
|
||||
vcpkg_acquire_msys(MSYS_ROOT PACKAGES diffutils make pkg-config)
|
||||
endif()
|
||||
|
||||
set(BASH ${MSYS_ROOT}/usr/bin/bash.exe)
|
||||
set(SHELL ${MSYS_ROOT}/usr/bin/bash.exe)
|
||||
set(OPTIONS "--toolchain=msvc ${OPTIONS}")
|
||||
else()
|
||||
set(ENV{PATH} "$ENV{PATH}:${YASM_EXE_PATH}")
|
||||
set(BASH /bin/bash)
|
||||
set(BUILD_SCRIPT ${CMAKE_CURRENT_LIST_DIR}/build_linux.sh)
|
||||
set(SHELL /bin/sh)
|
||||
endif()
|
||||
|
||||
set(ENV{${INCLUDE_VAR}} "${CURRENT_INSTALLED_DIR}/include${SEP}$ENV{${INCLUDE_VAR}}")
|
||||
@ -60,9 +60,6 @@ set(_csc_PROJECT_PATH ffmpeg)
|
||||
|
||||
file(REMOVE_RECURSE ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel)
|
||||
|
||||
set(OPTIONS "--enable-asm --enable-yasm --disable-doc --enable-debug")
|
||||
set(OPTIONS "${OPTIONS} --enable-runtime-cpudetect")
|
||||
|
||||
if("nonfree" IN_LIST FEATURES)
|
||||
set(OPTIONS "${OPTIONS} --enable-nonfree")
|
||||
endif()
|
||||
@ -391,13 +388,16 @@ if (NOT VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL release)
|
||||
set(ENV{PKG_CONFIG_PATH} "${CURRENT_INSTALLED_DIR}/lib/pkgconfig")
|
||||
message(STATUS "Building ${_csc_PROJECT_PATH} for Release")
|
||||
file(MAKE_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel)
|
||||
|
||||
set(BUILD_DIR "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel")
|
||||
set(CONFIGURE_OPTIONS "${OPTIONS} ${OPTIONS_RELEASE}")
|
||||
set(INST_PREFIX "${CURRENT_PACKAGES_DIR}")
|
||||
|
||||
configure_file("${CMAKE_CURRENT_LIST_DIR}/build.sh.in" "${BUILD_DIR}/build.sh" @ONLY)
|
||||
|
||||
vcpkg_execute_required_process(
|
||||
COMMAND ${BASH} --noprofile --norc "${BUILD_SCRIPT}"
|
||||
"${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel" # BUILD DIR
|
||||
"${SOURCE_PATH}" # SOURCE DIR
|
||||
"${CURRENT_PACKAGES_DIR}" # PACKAGE DIR
|
||||
"${OPTIONS} ${OPTIONS_RELEASE}"
|
||||
WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel
|
||||
COMMAND ${SHELL} ./build.sh
|
||||
WORKING_DIRECTORY ${BUILD_DIR}
|
||||
LOGNAME build-${TARGET_TRIPLET}-rel
|
||||
)
|
||||
endif()
|
||||
@ -411,13 +411,16 @@ if (NOT VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL debug)
|
||||
set(ENV{PKG_CONFIG_PATH} "${CURRENT_INSTALLED_DIR}/debug/lib/pkgconfig")
|
||||
message(STATUS "Building ${_csc_PROJECT_PATH} for Debug")
|
||||
file(MAKE_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg)
|
||||
|
||||
set(BUILD_DIR "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg")
|
||||
set(CONFIGURE_OPTIONS "${OPTIONS} ${OPTIONS_DEBUG}")
|
||||
set(INST_PREFIX "${CURRENT_PACKAGES_DIR}/debug")
|
||||
|
||||
configure_file("${CMAKE_CURRENT_LIST_DIR}/build.sh.in" "${BUILD_DIR}/build.sh" @ONLY)
|
||||
|
||||
vcpkg_execute_required_process(
|
||||
COMMAND ${BASH} --noprofile --norc "${BUILD_SCRIPT}"
|
||||
"${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg" # BUILD DIR
|
||||
"${SOURCE_PATH}" # SOURCE DIR
|
||||
"${CURRENT_PACKAGES_DIR}/debug" # PACKAGE DIR
|
||||
"${OPTIONS} ${OPTIONS_DEBUG}"
|
||||
WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg
|
||||
COMMAND ${SHELL} ./build.sh
|
||||
WORKING_DIRECTORY ${BUILD_DIR}
|
||||
LOGNAME build-${TARGET_TRIPLET}-dbg
|
||||
)
|
||||
endif()
|
||||
|
Loading…
Reference in New Issue
Block a user