toxcore/.github/scripts/cmake-windows.sh
iphydf c81038c963
chore: Add sonar-scan analysis on pushes.
We can't run this on pull requests because it needs access to the
`SONAR_TOKEN` secret. Perhaps in the future we can make it a
`pull_request_target` workflow, but then we can't use cmake to initialise
the environment, meaning we need to specify the inputs manually.
2022-01-14 12:38:35 +00:00

51 lines
1.1 KiB
Bash

#!/bin/bash
ACTION="$1"
set -eu
NPROC=$(nproc)
ci_install() {
cd other/docker/windows
docker build \
--build-arg SUPPORT_ARCH_i686="$i686" \
--build-arg SUPPORT_ARCH_x86_64="$x86_64" \
--build-arg SUPPORT_TEST=true \
-t toxcore-"$WINDOWS_ARCH" \
.
}
ci_script() {
. ".github/scripts/flags-gcc.sh"
# Allows wine to display source code file names and line numbers on crash in
# its backtrace.
add_flag -gdwarf-2
# Fix invalid register for .seh_savexmm error
add_flag -fno-asynchronous-unwind-tables
docker run \
-e ALLOW_TEST_FAILURE=true \
-e ENABLE_ARCH_i686="$i686" \
-e ENABLE_ARCH_x86_64="$x86_64" \
-e ENABLE_TEST=true \
-e EXTRA_CMAKE_FLAGS="-DBOOTSTRAP_DAEMON=OFF -DMIN_LOGGER_LEVEL=DEBUG -DTEST_TIMEOUT_SECONDS=90 -DAUTOTEST=ON" \
-e CMAKE_C_FLAGS="$C_FLAGS" \
-e CMAKE_CXX_FLAGS="$CXX_FLAGS" \
-e CMAKE_EXE_LINKER_FLAGS="$LD_FLAGS" \
-e CMAKE_SHARED_LINKER_FLAGS="$LD_FLAGS" \
-v "$PWD:/toxcore" \
-v "$PWD/result:/prefix" \
--rm \
toxcore-"$WINDOWS_ARCH"
}
if [ "-z" "$ACTION" ]; then
"ci_script"
else
"ci_$ACTION"
fi