Путь к cmake задаётся переменной

This commit is contained in:
Andrei Astafev 2022-10-08 20:06:08 +03:00
parent 9c79f48f64
commit 84b91698a8

View File

@ -4,6 +4,7 @@ variables:
CI_SOURCE_DIR: . CI_SOURCE_DIR: .
CI_BUILD_DIR: _build CI_BUILD_DIR: _build
CI_OUTPUT_DIR: _output CI_OUTPUT_DIR: _output
CI_CMAKE: /usr/bin/cmake
.add-ssh-key: .add-ssh-key:
before_script: before_script:
@ -59,22 +60,22 @@ variables:
if [ -n "${CONFIGURE_CMD}" ]; then if [ -n "${CONFIGURE_CMD}" ]; then
${CONFIGURE_CMD} ${CONFIGURE_CMD}
else else
cmake -DCMAKE_VERBOSE_MAKEFILE=ON -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=${CI_OUTPUT_DIR} -DCPACK_PACKAGING_INSTALL_PREFIX=/opt/ecs5 -B${CI_BUILD_DIR} -H. ${CI_CMAKE} -DCMAKE_VERBOSE_MAKEFILE=ON -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=${CI_OUTPUT_DIR} -DCPACK_PACKAGING_INSTALL_PREFIX=/opt/ecs5 -B${CI_BUILD_DIR} -H.
fi fi
- > - >
if [ -n "${BUILD_CMD}" ]; then if [ -n "${BUILD_CMD}" ]; then
${BUILD_CMD} ${BUILD_CMD}
else else
cmake --build ${CI_BUILD_DIR} ${CI_CMAKE} --build ${CI_BUILD_DIR}
fi fi
- > - >
if [ -z "${CI_SHARED_ENVIRONMENT+x}" ]; then if [ -z "${CI_SHARED_ENVIRONMENT+x}" ]; then
if [ -n "${PACKAGE_CMD}" ]; then if [ -n "${PACKAGE_CMD}" ]; then
${PACKAGE_CMD} ${PACKAGE_CMD}
else else
cmake --install ${CI_BUILD_DIR} ${CI_CMAKE} --install ${CI_BUILD_DIR}
cmake --build ${CI_BUILD_DIR} --target package ${CI_CMAKE} --build ${CI_BUILD_DIR} --target package
cmake --build ${CI_BUILD_DIR} --target package_source ${CI_CMAKE} --build ${CI_BUILD_DIR} --target package_source
fi fi
fi fi
- echo "${CI_COMMIT_SHA}" > "${CI_JOB_NAME}.status" - echo "${CI_COMMIT_SHA}" > "${CI_JOB_NAME}.status"
@ -118,6 +119,9 @@ variables:
expire_in: 10 days expire_in: 10 days
.scheduled-mxe-focal: .scheduled-mxe-focal:
variables:
CI_CMAKE: /usr/lib/mxe/usr/bin/cmake-configure-file
CI_USE_MXE: 1
extends: .scheduled-test extends: .scheduled-test
image: mxe-focal-dev image: mxe-focal-dev
tags: ['docker'] tags: ['docker']
@ -169,8 +173,8 @@ variables:
before_script: before_script:
- !reference [.add-ssh-key, before_script] - !reference [.add-ssh-key, before_script]
script: script:
- cmake -B ${CI_BUILD_DIR} . - ${CI_CMAKE} -B ${CI_BUILD_DIR} .
- cmake --build ${CI_BUILD_DIR} --target check-format-sources - ${CI_CMAKE} --build ${CI_BUILD_DIR} --target check-format-sources
.myx-cmake-uncrustify-check: .myx-cmake-uncrustify-check:
extends: .use-ninja extends: .use-ninja
@ -179,8 +183,8 @@ variables:
before_script: before_script:
- !reference [.add-ssh-key, before_script] - !reference [.add-ssh-key, before_script]
script: script:
- cmake -B ${CI_BUILD_DIR} . - ${CI_CMAKE} -B ${CI_BUILD_DIR} .
- cmake --build ${CI_BUILD_DIR} --target myx-uncrustify-check - ${CI_CMAKE} --build ${CI_BUILD_DIR} --target myx-uncrustify-check
.format-sources-check-custom: .format-sources-check-custom:
extends: .use-ninja extends: .use-ninja
@ -240,7 +244,7 @@ variables:
if [ -n "${CUSTOM_ANALYZE_PVS}" ]; then if [ -n "${CUSTOM_ANALYZE_PVS}" ]; then
${CUSTOM_ANALYZE_PVS} ${CUSTOM_ANALYZE_PVS}
else else
cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -B ${CI_BUILD_DIR} . ${CI_CMAKE} -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -B ${CI_BUILD_DIR} .
pvs-studio-analyzer analyze -a 29 -f ${CI_BUILD_DIR}/compile_commands.json -j -o ${CI_BUILD_DIR}/PVS-Studio.log pvs-studio-analyzer analyze -a 29 -f ${CI_BUILD_DIR}/compile_commands.json -j -o ${CI_BUILD_DIR}/PVS-Studio.log
plog-converter -a "GA:1,2,3;64:1;OP:1,2;CS:1,2" -t errorfile ${CI_BUILD_DIR}/PVS-Studio.log plog-converter -a "GA:1,2,3;64:1;OP:1,2;CS:1,2" -t errorfile ${CI_BUILD_DIR}/PVS-Studio.log
fi fi
@ -257,7 +261,7 @@ variables:
if [ -n "${CUSTOM_ANALYZE_CLANG_TIDY}" ]; then if [ -n "${CUSTOM_ANALYZE_CLANG_TIDY}" ]; then
${CUSTOM_ANALYZE_CLANG_TIDY} ${CUSTOM_ANALYZE_CLANG_TIDY}
else else
cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -B ${CI_BUILD_DIR} . ${CI_CMAKE} -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -B ${CI_BUILD_DIR} .
run-clang-tidy-14 -checks=-*,bugprone-*,clang-analyzer-*,misc-*,modernize-*,performance-*,portability-* -p ${CI_BUILD_DIR} run-clang-tidy-14 -checks=-*,bugprone-*,clang-analyzer-*,misc-*,modernize-*,performance-*,portability-* -p ${CI_BUILD_DIR}
fi fi
@ -273,7 +277,7 @@ variables:
if [ -n "${CUSTOM_ANALYZE_CLAZY}" ]; then if [ -n "${CUSTOM_ANALYZE_CLAZY}" ]; then
${CUSTOM_ANALYZE_CLAZY} ${CUSTOM_ANALYZE_CLAZY}
else else
cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -B ${CI_BUILD_DIR} . ${CI_CMAKE} -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -B ${CI_BUILD_DIR} .
find . -name "*.cpp" -print0 | xargs -0 clazy-standalone --ignore-dirs=/usr -checks=level2 -p ${CI_BUILD_DIR}/compile_commands.json find . -name "*.cpp" -print0 | xargs -0 clazy-standalone --ignore-dirs=/usr -checks=level2 -p ${CI_BUILD_DIR}/compile_commands.json
fi fi
@ -285,8 +289,8 @@ variables:
before_script: before_script:
- !reference [.add-ssh-key, before_script] - !reference [.add-ssh-key, before_script]
script: script:
- cmake -B ${CI_BUILD_DIR} . - ${CI_CMAKE} -B ${CI_BUILD_DIR} .
- cmake --build ${CI_BUILD_DIR} --target myx-cmake-analyze-pvs-studio --parallel - ${CI_CMAKE} --build ${CI_BUILD_DIR} --target myx-cmake-analyze-pvs-studio --parallel
.myx-cmake-analyze-clang-tidy: .myx-cmake-analyze-clang-tidy:
extends: .use-ninja extends: .use-ninja
@ -296,8 +300,8 @@ variables:
before_script: before_script:
- !reference [.add-ssh-key, before_script] - !reference [.add-ssh-key, before_script]
script: script:
- cmake -B ${CI_BUILD_DIR} . - ${CI_CMAKE} -B ${CI_BUILD_DIR} .
- cmake --build build --target myx-cmake-analyze-clang-tidy --parallel - ${CI_CMAKE} --build build --target myx-cmake-analyze-clang-tidy --parallel
.myx-cmake-analyze-clazy: .myx-cmake-analyze-clazy:
extends: .use-ninja extends: .use-ninja
@ -306,6 +310,6 @@ variables:
before_script: before_script:
- !reference [.add-ssh-key, before_script] - !reference [.add-ssh-key, before_script]
script: script:
- cmake -B ${CI_BUILD_DIR} . - ${CI_CMAKE} -B ${CI_BUILD_DIR} .
- cmake --build ${CI_BUILD_DIR} --target myx-cmake-analyze-clazy --parallel - ${CI_CMAKE} --build ${CI_BUILD_DIR} --target myx-cmake-analyze-clazy --parallel