diff --git a/Jenkinsfile b/Jenkinsfile index 65bfb4d..e493c27 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -42,7 +42,7 @@ pipeline { stage('build on darwin ') { agent { label "darwin" } steps { - sh "STATIC=${STATIC} ${OPT_LTO} ./scripts/build.sh" + sh "${OPT_LTO} ./scripts/build.sh" } } } @@ -61,7 +61,7 @@ pipeline { agent { label "linux && ${ARCH}" } steps { withDockerCreds { - sh "STATIC=${STATIC} ${OPT_LTO} ./scripts/docker_run_image.sh ${DISTRO}" + sh "${OPT_LTO} ./scripts/docker_run_image.sh ${DISTRO}" } } } diff --git a/lib/build.sh b/lib/build.sh index fdd313e..6b08801 100644 --- a/lib/build.sh +++ b/lib/build.sh @@ -123,10 +123,10 @@ set_compile_opts() { # arm prefers -mcpu over -march for native builds # https://community.arm.com/arm-community-blogs/b/tools-software-ides-blog/posts/compiler-flags-across-architectures-march-mtune-and-mcpu local arch_flags=() - if [[ ${HOSTTYPE} == "aarch64" && "${CPU}" == 'native' ]]; then - arch_flags+=("-mcpu=${CPU}") + if [[ ${HOSTTYPE} == "aarch64" && "${ARCH}" == 'native' ]]; then + arch_flags+=("-mcpu=${ARCH}") else - arch_flags+=("-march=${CPU}") + arch_flags+=("-march=${ARCH}") fi # can fail static builds with -fpic @@ -134,7 +134,7 @@ set_compile_opts() { C_FLAGS+=("${arch_flags[@]}" "-fPIC") CXX_FLAGS=("${C_FLAGS[@]}") CPP_FLAGS=("${C_FLAGS[@]}") - RUSTFLAGS+=("-C target-cpu=${CPU}") + RUSTFLAGS+=("-C target-cpu=${ARCH}") CMAKE_FLAGS+=("-DCMAKE_C_FLAGS=${C_FLAGS[*]}") CMAKE_FLAGS+=("-DCMAKE_CXX_FLAGS=${CXX_FLAGS[*]}") MESON_FLAGS+=("-Dc_args=${C_FLAGS[*]}" "-Dcpp_args=${CPP_FLAGS[*]}") @@ -620,7 +620,7 @@ build_ffmpeg() { --pkg-config='pkg-config' \ --pkg-config-flags="${PKG_CFG_FLAGS}" \ --arch="${ARCH}" \ - --cpu="${CPU}" \ + --cpu="${ARCH}" \ --enable-gpl \ --enable-version3 \ --enable-nonfree \ diff --git a/lib/compile_opts.sh b/lib/compile_opts.sh index c8fa6fc..dbc207f 100644 --- a/lib/compile_opts.sh +++ b/lib/compile_opts.sh @@ -13,9 +13,7 @@ DEFAULT_LTO=true DEFAULT_OPT=3 # static or shared build DEFAULT_STATIC=true -# CPU type (amd64/v{1,2,3}...) -DEFAULT_CPU=native -# architecture type +# architecture type (x86-64-v{1,2,3,4}, armv8-a, etc) DEFAULT_ARCH=native # prefix to install to, default is local install DEFAULT_PREFIX='local' @@ -31,7 +29,7 @@ libvmaf \ # user-overridable compile option variable names FB_COMP_OPTS=( - CLEAN LTO OPT STATIC CPU ARCH PREFIX ENABLE + CLEAN LTO OPT STATIC ARCH PREFIX ENABLE ) # sets FB_COMP_OPTS to allow for user-overriding