Skip to content

Commit

Permalink
Script: switch to make
Browse files Browse the repository at this point in the history
  • Loading branch information
Rosalie241 committed Feb 1, 2025
1 parent 45bcc6c commit 0924d7a
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 3 deletions.
20 changes: 18 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,12 @@ jobs:
- name: Build RMG (AppImage)
run: |
export src_dir="$(pwd)"
export threads=$(($(nproc) / 2))
if [[ "$threads" = "0" ]]
then
threads=1
fi
if [ "${{ matrix.cmake_args }}" == "-DDISCORD_RPC=ON -DDRAG_DROP=ON -DNETPLAY=ON -DVRU=ON -DUSE_ANGRYLION=ON" ]
then
Expand All @@ -37,6 +43,8 @@ jobs:
export build_dir="$(pwd)/Build/CI"
export bin_dir="$(pwd)/Bin/CI"
fi
echo "threads = $threads"
mkdir $build_dir Bin/ -p
cmake -S "$src_dir" -B "$build_dir" -DCMAKE_BUILD_TYPE="Release" \
Expand All @@ -46,7 +54,7 @@ jobs:
-DPORTABLE_INSTALL="OFF" \
-DUPDATER=ON -DAPPIMAGE_UPDATER=ON \
-G "Unix Makefiles"
cmake --build "$build_dir"
cmake --build "$build_dir" --parallel "$threads"
cmake --install "$build_dir" --strip --prefix="$bin_dir/usr"
shell: bash
- name: Create AppImage
Expand Down Expand Up @@ -103,6 +111,12 @@ jobs:
- name: Build RMG (Portable)
run: |
export src_dir="$(pwd)"
export threads=$(($(nproc) / 2))
if [[ "$threads" = "0" ]]
then
threads=1
fi
if [ "${{ matrix.cmake_args }}" == "-DDISCORD_RPC=ON -DDRAG_DROP=ON -DNETPLAY=ON -DVRU=ON -DUSE_ANGRYLION=ON" ]
then
Expand All @@ -111,11 +125,13 @@ jobs:
export build_dir="$(pwd)/Build/CI"
fi
echo "threads = $threads"
cmake -S "$src_dir" -B "$build_dir" -DCMAKE_BUILD_TYPE="Release" \
${{ matrix.cmake_args }} \
-DPORTABLE_INSTALL=ON -DUPDATER=ON -G "MSYS Makefiles"
cmake --build "$build_dir"
cmake --build "$build_dir" --parallel "$threads"
if [ "${{ matrix.cmake_args }}" == "-DDISCORD_RPC=ON -DDRAG_DROP=ON -DNETPLAY=ON -DVRU=ON -DUSE_ANGRYLION=ON" ]
then
Expand Down
11 changes: 10 additions & 1 deletion Source/Script/Build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ toplvl_dir="$(realpath "$script_dir/../../")"
build_config="${1:-Debug}"
build_dir="$toplvl_dir/Build/$build_config"
threads="${2:-$(nproc)}"
generator="Unix Makefiles"

if [[ "$1" = "--help" ]] ||
[[ "$1" = "-h" ]]
Expand All @@ -13,9 +14,17 @@ then
exit
fi

if [[ $(uname -s) = *MINGW64* ]]
then
generator="MSYS Makefiles"
fi

mkdir -p "$build_dir"

cmake -S "$toplvl_dir" -B "$build_dir" -DCMAKE_BUILD_TYPE="$build_config" -DPORTABLE_INSTALL=ON -DUSE_ANGRYLION=ON -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -G "Ninja"
cmake -S "$toplvl_dir" -B "$build_dir" \
-DCMAKE_BUILD_TYPE="$build_config" \
-DPORTABLE_INSTALL=ON -DUSE_ANGRYLION=ON \
-G "$generator"

cmake --build "$build_dir" --parallel "$threads"

Expand Down

0 comments on commit 0924d7a

Please sign in to comment.