Changeset View
Changeset View
Standalone View
Standalone View
contrib/devtools/build_cmake.sh
Show All 9 Lines | |||||
function usage() { | function usage() { | ||||
echo "Usage: $0 [--Werror] [targets]" | echo "Usage: $0 [--Werror] [targets]" | ||||
echo "Build the targets using cmake and ninja." | echo "Build the targets using cmake and ninja." | ||||
echo "If no target is provided the default (all) target is built." | echo "If no target is provided the default (all) target is built." | ||||
echo | echo | ||||
echo "Options:" | echo "Options:" | ||||
echo " --clang: build with clang/clang++" | echo " --clang: build with clang/clang++" | ||||
echo " --gcc: build with gcc/g++" | echo " --gcc: build with gcc/g++" | ||||
echo " --junit: enable Junit reports generation" | |||||
echo " --Werror: add -Werror to the compiler flags" | echo " --Werror: add -Werror to the compiler flags" | ||||
echo "Environment variables:" | echo "Environment variables:" | ||||
echo " CMAKE_FLAGS: array of the CMAKE flags to use for the build" | echo " CMAKE_FLAGS: array of the CMAKE flags to use for the build" | ||||
echo " BUILD_DIR: the build directory, (default: ${BUILD_DIR}})" | echo " BUILD_DIR: the build directory, (default: ${BUILD_DIR}})" | ||||
echo " TOPLEVEL: the project root directory, (default: ${TOPLEVEL}})" | echo " TOPLEVEL: the project root directory, (default: ${TOPLEVEL}})" | ||||
} | } | ||||
# Default to nothing | # Default to nothing | ||||
Show All 17 Lines | --clang) | ||||
;; | ;; | ||||
--gcc) | --gcc) | ||||
CMAKE_FLAGS+=( | CMAKE_FLAGS+=( | ||||
"-DCMAKE_C_COMPILER=gcc" | "-DCMAKE_C_COMPILER=gcc" | ||||
"-DCMAKE_CXX_COMPILER=g++" | "-DCMAKE_CXX_COMPILER=g++" | ||||
) | ) | ||||
shift | shift | ||||
;; | ;; | ||||
--junit) | |||||
CMAKE_FLAGS+=( | |||||
"-DENABLE_JUNIT_REPORT=ON" | |||||
) | |||||
shift | |||||
;; | |||||
--Werror) | --Werror) | ||||
CMAKE_FLAGS+=( | CMAKE_FLAGS+=( | ||||
"-DCMAKE_C_FLAGS=-Werror" | "-DCMAKE_C_FLAGS=-Werror" | ||||
"-DCMAKE_CXX_FLAGS=-Werror" | "-DCMAKE_CXX_FLAGS=-Werror" | ||||
) | ) | ||||
shift | shift | ||||
;; | ;; | ||||
*) | *) | ||||
Show All 29 Lines |