Introduce a both Bash and CMake boolean variable
This commit is contained in:
parent
2498d2c210
commit
38e7193b4d
1
.github/workflows/ci.yml
vendored
1
.github/workflows/ci.yml
vendored
@ -82,6 +82,7 @@ jobs:
|
||||
CMAKE_BUILD_TYPE: ${{matrix.CMAKE_BUILD_TYPE}}
|
||||
CMAKE_PREFIX_PATH: ${{steps.FETCH.outputs.CMAKE_PREFIX_PATH}}
|
||||
BUSTER_GITHUB_MAIN_RUN: ${{ github.ref == 'refs/heads/main' }}
|
||||
IS_CI: true
|
||||
- name: Release
|
||||
uses: softprops/action-gh-release@v2
|
||||
if: github.ref == 'refs/heads/main'
|
||||
|
@ -16,6 +16,14 @@ set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
|
||||
set(CMAKE_C_STANDARD 23)
|
||||
set(CMAKE_CXX_STANDARD 23)
|
||||
|
||||
set(IS_CI OFF CACHE BOOL "Variable that determines if the cmake script is run on the CI or not")
|
||||
|
||||
if (IS_CI)
|
||||
message(STATUS "CMake is run on CI")
|
||||
else()
|
||||
message(STATUS "CMake is not run on CI")
|
||||
endif()
|
||||
|
||||
add_compile_options(
|
||||
-pedantic
|
||||
-Wall -Wextra -Wpedantic
|
||||
@ -45,7 +53,6 @@ if ("${LLVM_CONFIG_EXE}" STREQUAL "LLVM_CONFIG_EXE-NOTFOUND")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
|
||||
execute_process(
|
||||
COMMAND ${LLVM_CONFIG_EXE} --libs
|
||||
OUTPUT_VARIABLE LLVM_LIBRARIES_SPACES
|
||||
|
17
project.sh
17
project.sh
@ -36,14 +36,11 @@ esac
|
||||
if [[ -z "${BIRTH_ARCH-}" ]]; then
|
||||
case "$(uname -m)" in
|
||||
x86_64)
|
||||
BIRTH_ARCH=x86_64
|
||||
;;
|
||||
BIRTH_ARCH=x86_64;;
|
||||
arm64)
|
||||
BIRTH_ARCH=aarch64
|
||||
;;
|
||||
BIRTH_ARCH=aarch64;;
|
||||
*)
|
||||
exit 1
|
||||
;;
|
||||
exit 1;;
|
||||
esac
|
||||
fi
|
||||
|
||||
@ -59,6 +56,12 @@ if [[ -z "${BUSTER_GITHUB_MAIN_RUN-}" ]]; then
|
||||
BUSTER_GITHUB_MAIN_RUN=false
|
||||
fi
|
||||
|
||||
if [[ -n "${IS_CI-}" ]]; then
|
||||
IS_CI=ON
|
||||
else
|
||||
IS_CI=OFF
|
||||
fi
|
||||
|
||||
case $BIRTH_OS in
|
||||
windows)
|
||||
C_COMPILER_OPT_ARG="-DCMAKE_C_COMPILER_TARGET=x86_64-pc-windows-msvc"
|
||||
@ -71,6 +74,7 @@ case $BIRTH_OS in
|
||||
ASM_COMPILER_OPT_ARG=""
|
||||
;;
|
||||
esac
|
||||
|
||||
case $BIRTH_OS in
|
||||
linux)
|
||||
USE_MOLD_OPT_ARG=-DCMAKE_EXE_LINKER_FLAGS="-fuse-ld=mold"
|
||||
@ -89,6 +93,7 @@ cmake . \
|
||||
-DCMAKE_C_COMPILER=$C_COMPILER_PATH \
|
||||
-DCMAKE_CXX_COMPILER=$CXX_COMPILER_PATH \
|
||||
-DCMAKE_ASM_COMPILER=$ASM_COMPILER_PATH \
|
||||
-DIS_CI=$IS_CI \
|
||||
$USE_MOLD_OPT_ARG \
|
||||
$C_COMPILER_OPT_ARG \
|
||||
$CXX_COMPILER_OPT_ARG \
|
||||
|
Loading…
x
Reference in New Issue
Block a user