提交 21345d6b 编写于 作者: M Megvii Engine Team

fix(cmake): only add -Werror=unused-parameter at CI env

GitOrigin-RevId: 380f7f6ce9129ecf63f3cb0e92fdd6628fa4d07b
上级 744efe72
......@@ -11,8 +11,6 @@ REMOVE_OLD_BUILD=false
NINJA_VERBOSE=OFF
NINJA_DRY_RUN=OFF
SPECIFIED_TARGET="install/strip"
CMAKE_C_FLAGS="-Wno-psabi"
CMAKE_CXX_FLAGS="-Wno-psabi"
READLINK=readlink
OS=$(uname -s)
......@@ -140,12 +138,6 @@ if [ $MGE_WITH_CUDA = "ON" ] && [ ! $ARCH = "arm64-v8a" ];then
exit -1
fi
if [ $MGE_WITH_CUDA = "OFF" ];then
echo "config -Werror=unused-parameter when cuda off for CI check"
CMAKE_C_FLAGS="-Werror=unused-parameter -Wno-psabi"
CMAKE_CXX_FLAGS="-Werror=unused-parameter -Wno-psabi"
fi
function cmake_build() {
BUILD_DIR=$SRC_DIR/build_dir/gnu-linux/MGE_WITH_CUDA_$3/$1/$BUILD_TYPE/build
INSTALL_DIR=$BUILD_DIR/../install
......@@ -163,8 +155,6 @@ function cmake_build() {
mkdir -p $INSTALL_DIR
cd_real_build_dir $BUILD_DIR
bash -c "cmake -G Ninja \
-DCMAKE_C_FLAGS=$CMAKE_C_FLAGS \
-DCMAKE_CXX_FLAGS=$CMAKE_CXX_FLAGS \
-DCMAKE_TOOLCHAIN_FILE=$TOOLCHAIN \
-DCMAKE_BUILD_TYPE=$BUILD_TYPE \
-DMGE_INFERENCE_ONLY=ON \
......
set(ARM_CROSS_BUILD_ARCH aarch64)
set(CMAKE_C_COMPILER "aarch64-linux-gnu-gcc")
set(CMAKE_CXX_COMPILER "aarch64-linux-gnu-g++")
if("$ENV{FORCE_CHECK_UNUSED_PARAMETER}" STREQUAL "true")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror=unused-parameter")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror=unused-parameter")
endif()
set(CMAKE_STRIP "aarch64-linux-gnu-strip")
set(CMAKE_SYSTEM_PROCESSOR aarch64)
set(CMAKE_SYSTEM_NAME Linux)
set(ARM_CROSS_BUILD_ARCH aarch64)
set(CMAKE_C_COMPILER "aarch64-none-linux-gnu-gcc")
set(CMAKE_CXX_COMPILER "aarch64-none-linux-gnu-g++")
set(CMAKE_C_FLAGS "-Werror=unused-parameter -Wno-psabi")
set(CMAKE_CXX_FLAGS "-Werror=unused-parameter -Wno-psabi")
set(CMAKE_C_FLAGS "-Wno-psabi")
set(CMAKE_CXX_FLAGS "-Wno-psabi")
if("$ENV{FORCE_CHECK_UNUSED_PARAMETER}" STREQUAL "true")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror=unused-parameter")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror=unused-parameter")
endif()
set(CMAKE_STRIP "aarch64-none-linux-gnu-strip")
set(CMAKE_SYSTEM_PROCESSOR aarch64)
set(CMAKE_SYSTEM_NAME Linux)
set(ARM_CROSS_BUILD_ARCH armv7)
set(CMAKE_C_COMPILER "arm-linux-gnueabi-gcc")
set(CMAKE_CXX_COMPILER "arm-linux-gnueabi-g++")
set(CMAKE_C_FLAGS "-mfloat-abi=softfp -mfpu=neon-vfpv4 -Werror=unused-parameter -Wno-psabi")
set(CMAKE_CXX_FLAGS "-mfloat-abi=softfp -mfpu=neon-vfpv4 -Werror=unused-parameter -Wno-psabi")
set(CMAKE_C_FLAGS "-mfloat-abi=softfp -mfpu=neon-vfpv4 -Wno-psabi")
set(CMAKE_CXX_FLAGS "-mfloat-abi=softfp -mfpu=neon-vfpv4 -Wno-psabi")
if("$ENV{FORCE_CHECK_UNUSED_PARAMETER}" STREQUAL "true")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror=unused-parameter")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror=unused-parameter")
endif()
set(CMAKE_STRIP "arm-linux-gnueabi-strip")
set(CMAKE_SYSTEM_PROCESSOR armv7)
set(CMAKE_SYSTEM_NAME Linux)
set(ARM_CROSS_BUILD_ARCH armv7)
set(CMAKE_C_COMPILER "arm-linux-gnueabihf-gcc")
set(CMAKE_CXX_COMPILER "arm-linux-gnueabihf-g++")
set(CMAKE_C_FLAGS "-mfloat-abi=hard -mfpu=neon-vfpv4 -Werror=unused-parameter -Wno-psabi")
set(CMAKE_CXX_FLAGS "-mfloat-abi=hard -mfpu=neon-vfpv4 -Werror=unused-parameter -Wno-psabi")
set(CMAKE_C_FLAGS "-mfloat-abi=hard -mfpu=neon-vfpv4 -Wno-psabi")
set(CMAKE_CXX_FLAGS "-mfloat-abi=hard -mfpu=neon-vfpv4 -Wno-psabi")
if("$ENV{FORCE_CHECK_UNUSED_PARAMETER}" STREQUAL "true")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror=unused-parameter")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror=unused-parameter")
endif()
set(CMAKE_STRIP "arm-linux-gnueabihf-strip")
set(CMAKE_SYSTEM_PROCESSOR armv7)
set(CMAKE_SYSTEM_NAME Linux)
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册