forked from CleverRaven/Cataclysm-DDA
-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathgha_compile_only.sh
executable file
·75 lines (61 loc) · 1.89 KB
/
gha_compile_only.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
#!/bin/bash
# Script made specifically for compiling without running tests on GitHub Actions
echo "Using bash version $BASH_VERSION"
set -exo pipefail
num_jobs=3
# We might need binaries installed via pip, so ensure that our personal bin dir is on the PATH
export PATH=$HOME/.local/bin:$PATH
if [ -n "$CROSS_COMPILATION" ]
then
"$CROSS_COMPILATION$COMPILER" --version
else
$COMPILER --version
fi
if [ -n "$TEST_STAGE" ]
then
build-scripts/validate_json.py
make style-all-json-parallel RELEASE=1
tools/dialogue_validator.py data/json/npcs/* data/json/npcs/*/* data/json/npcs/*/*/*
tools/json_tools/generic_guns_validator.py
# Also build chkjson (even though we're not using it), to catch any
# compile errors there
make -j "$num_jobs" chkjson
# Skip the rest of the run if this change is pure json and this job doesn't test any extra mods
elif [ -n "$JUST_JSON" -a -z "$MODS" ]
then
echo "Early exit on just-json change"
exit 0
fi
ccache --zero-stats
# Increase cache size because debug builds generate large object files
ccache -M 5G
ccache --show-stats --verbose
if [ "$CMAKE" = "1" ]
then
if [ "$RELEASE" = "1" ]
then
build_type=MinSizeRel
else
build_type=Debug
fi
mkdir build
cd build
cmake \
-DBACKTRACE=ON \
${COMPILER:+-DCMAKE_CXX_COMPILER=$COMPILER} \
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
-DCMAKE_BUILD_TYPE="$build_type" \
-DTILES=${TILES:-0} \
-DSOUND=${SOUND:-0} \
..
make -j$num_jobs
else
make -j "$num_jobs" RELEASE=1 CCACHE=1 CROSS="$CROSS_COMPILATION" LINTJSON=0 FRAMEWORK=1 UNIVERSAL_BINARY=1
# For CI on macOS, patch the test binary so it can find SDL2 libraries.
if [[ ! -z "$OS" && "$OS" = "macos-12" ]]
then
file tests/cata_test
install_name_tool -add_rpath $HOME/Library/Frameworks tests/cata_test
fi
fi
# vim:tw=0