Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into qol_fs
Browse files Browse the repository at this point in the history
  • Loading branch information
Daggolin committed Apr 6, 2024
2 parents 4fabac9 + d2afcfe commit fda880e
Show file tree
Hide file tree
Showing 268 changed files with 5,862 additions and 5,016 deletions.
83 changes: 83 additions & 0 deletions .github/workflows/build-deprecated.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
name: build

# runs every 4 months
on:
workflow_dispatch:
schedule:
- cron: "0 0 1 */4 *"

jobs:
msvcxp:
name: WinXP ${{ matrix.arch }} ${{ matrix.build_type }} (${{ matrix.portable }})
runs-on: windows-2022
strategy:
matrix:
arch: [x86, x86_64]
build_type: [Release]
portable: [Non-Portable]
include:
- arch: x86
platform: Win32
- arch: x86_64
platform: x64

steps:
- uses: actions/checkout@v3

- name: Install v141_xp Toolchain
continue-on-error: true
shell: powershell
run: |
Set-Location "C:\Program Files (x86)\Microsoft Visual Studio\Installer\"
$InstallPath = "C:\Program Files\Microsoft Visual Studio\2022\Enterprise"
$WorkLoads = '--add Microsoft.VisualStudio.Component.WinXP'
$Arguments = ('/c', "vs_installer.exe", 'modify', '--installPath', "`"$InstallPath`"", $WorkLoads, '--quiet', '--norestart', '--nocache')
$process = Start-Process -FilePath cmd.exe -ArgumentList $Arguments -Wait -PassThru -WindowStyle Hidden
if ($process.ExitCode -eq 0) {
Write-Host "components have been successfully added"
} else {
Write-Host "components were not installed"
}
- name: Add msbuild to PATH
uses: microsoft/[email protected]

- name: Create Build Environment
run: cmake -E make_directory ${{ github.workspace }}/build

- name: Configure CMake
shell: bash
working-directory: ${{ github.workspace }}/build
run: |
OPTIONS="-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DCMAKE_INSTALL_PREFIX=bin"
if [ "${{ matrix.portable }}" == "Portable" ]; then
OPTIONS+=" -DBuildPortableVersion=ON"
else
OPTIONS+=" -DBuildPortableVersion=OFF"
fi
OPTIONS+=" -DBuildJK2SPEngine=ON -DBuildJK2SPGame=ON -DBuildJK2SPRdVanilla=ON"
cmake $GITHUB_WORKSPACE -T v141_xp -A ${{ matrix.platform }} $OPTIONS
- name: Build
working-directory: ${{ github.workspace }}/build
shell: bash
run: cmake --build . --config ${{ matrix.build_type }} -j $NUMBER_OF_PROCESSORS

- name: Install
if: ${{ matrix.build_type == 'Release' }}
working-directory: ${{ github.workspace }}/build
shell: bash
run: cmake --install . --config ${{ matrix.build_type }}

- uses: actions/upload-artifact@v3
if: ${{ matrix.build_type == 'Release' }}
with:
name: OpenJK-windowsxp-${{ matrix.arch }}-${{ matrix.build_type }}-${{ matrix.portable }}
path: ${{ github.workspace }}/build/bin/JediAcademy
if-no-files-found: error

- uses: actions/upload-artifact@v3
if: ${{ matrix.build_type == 'Release' }}
with:
name: OpenJO-windowsxp-${{ matrix.arch }}-${{ matrix.build_type }}-${{ matrix.portable }}
path: ${{ github.workspace }}/build/bin/JediOutcast
if-no-files-found: error
98 changes: 19 additions & 79 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,81 +82,6 @@ jobs:
path: ${{ github.workspace }}/build/bin/JediOutcast
if-no-files-found: error

msvcxp:
name: WinXP ${{ matrix.arch }} ${{ matrix.build_type }} (${{ matrix.portable }})
runs-on: windows-2022
strategy:
matrix:
arch: [x86, x86_64]
build_type: [Release]
portable: [Non-Portable]
include:
- arch: x86
platform: Win32
- arch: x86_64
platform: x64

steps:
- uses: actions/checkout@v3

- name: Install v141_xp Toolchain
continue-on-error: true
shell: powershell
run: |
Set-Location "C:\Program Files (x86)\Microsoft Visual Studio\Installer\"
$InstallPath = "C:\Program Files\Microsoft Visual Studio\2022\Enterprise"
$WorkLoads = '--add Microsoft.VisualStudio.Component.WinXP'
$Arguments = ('/c', "vs_installer.exe", 'modify', '--installPath', "`"$InstallPath`"", $WorkLoads, '--quiet', '--norestart', '--nocache')
$process = Start-Process -FilePath cmd.exe -ArgumentList $Arguments -Wait -PassThru -WindowStyle Hidden
if ($process.ExitCode -eq 0) {
Write-Host "components have been successfully added"
} else {
Write-Host "components were not installed"
}
- name: Add msbuild to PATH
uses: microsoft/[email protected]

- name: Create Build Environment
run: cmake -E make_directory ${{ github.workspace }}/build

- name: Configure CMake
shell: bash
working-directory: ${{ github.workspace }}/build
run: |
OPTIONS="-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DCMAKE_INSTALL_PREFIX=bin"
if [ "${{ matrix.portable }}" == "Portable" ]; then
OPTIONS+=" -DBuildPortableVersion=ON"
else
OPTIONS+=" -DBuildPortableVersion=OFF"
fi
OPTIONS+=" -DBuildJK2SPEngine=ON -DBuildJK2SPGame=ON -DBuildJK2SPRdVanilla=ON"
cmake $GITHUB_WORKSPACE -T v141_xp -A ${{ matrix.platform }} $OPTIONS
- name: Build
working-directory: ${{ github.workspace }}/build
shell: bash
run: cmake --build . --config ${{ matrix.build_type }} -j $NUMBER_OF_PROCESSORS

- name: Install
if: ${{ matrix.build_type == 'Release' }}
working-directory: ${{ github.workspace }}/build
shell: bash
run: cmake --install . --config ${{ matrix.build_type }}

- uses: actions/upload-artifact@v3
if: ${{ matrix.build_type == 'Release' }}
with:
name: OpenJK-windowsxp-${{ matrix.arch }}-${{ matrix.build_type }}-${{ matrix.portable }}
path: ${{ github.workspace }}/build/bin/JediAcademy
if-no-files-found: error

- uses: actions/upload-artifact@v3
if: ${{ matrix.build_type == 'Release' }}
with:
name: OpenJO-windowsxp-${{ matrix.arch }}-${{ matrix.build_type }}-${{ matrix.portable }}
path: ${{ github.workspace }}/build/bin/JediOutcast
if-no-files-found: error

ubuntu:
name: Ubuntu ${{ matrix.arch }} ${{ matrix.build_type }} (${{ matrix.portable }})
runs-on: ubuntu-22.04
Expand Down Expand Up @@ -240,13 +165,18 @@ jobs:

macos:
name: macOS ${{ matrix.arch }} ${{ matrix.build_type }} (${{ matrix.portable}})
runs-on: macos-12
runs-on: ${{ matrix.runner }}
strategy:
fail-fast: false
matrix:
arch: [x86_64]
runner: [macos-12, macos-14]
build_type: [Debug, Release]
portable: [Non-Portable]
include:
- runner: macos-12
arch: x86_64
- runner: macos-14
arch: arm64

steps:
- uses: actions/checkout@v3
Expand Down Expand Up @@ -285,15 +215,15 @@ jobs:
working-directory: ${{ github.workspace }}/install/JediAcademy
shell: bash
run: |
chmod +x openjk.x86_64.app/Contents/MacOS/openjk.x86_64
chmod +x openjk.${{ matrix.arch }}.app/Contents/MacOS/openjk.${{ matrix.arch }}
tar -czvf openjk-macos-${{ matrix.arch }}-${{ matrix.build_type }}-${{ matrix.portable }}.tar.gz *
- name: Create OpenJO binary archive
if: ${{ matrix.build_type == 'Release' }}
working-directory: ${{ github.workspace }}/install/JediOutcast
shell: bash
run: |
chmod +x openjo_sp.x86_64.app/Contents/MacOS/openjo_sp.x86_64
chmod +x openjo_sp.${{ matrix.arch }}.app/Contents/MacOS/openjo_sp.${{ matrix.arch }}
tar -czvf openjo_sp-macos-${{ matrix.arch }}-${{ matrix.build_type }}-${{ matrix.portable }}.tar.gz *
- uses: actions/upload-artifact@v3
Expand Down Expand Up @@ -329,12 +259,14 @@ jobs:
mv ./OpenJK-linux-x86-Release-Non-Portable/* OpenJK-linux-x86.tar.gz
mv ./OpenJK-linux-x86_64-Release-Non-Portable/* OpenJK-linux-x86_64.tar.gz
mv ./OpenJK-macos-x86_64-Release-Non-Portable/* OpenJK-macos-x86_64.tar.gz
mv ./OpenJK-macos-arm64-Release-Non-Portable/* OpenJK-macos-arm64.tar.gz
7z a -r OpenJO-windows-x86.zip ./OpenJO-windows-x86-Release-Non-Portable/* '-x!msvcp*.*' '-x!vcruntime*.*' '-x!concrt*.*'
7z a -r OpenJO-windows-x86_64.zip ./OpenJO-windows-x86_64-Release-Non-Portable/* '-x!msvcp*.*' '-x!vcruntime*.*' '-x!concrt*.*'
mv ./OpenJO-linux-x86-Release-Non-Portable/* OpenJO-linux-x86.tar.gz
mv ./OpenJO-linux-x86_64-Release-Non-Portable/* OpenJO-linux-x86_64.tar.gz
mv ./OpenJO-macos-x86_64-Release-Non-Portable/* OpenJO-macos-x86_64.tar.gz
mv ./OpenJO-macos-arm64-Release-Non-Portable/* OpenJO-macos-arm64.tar.gz
- name: Create latest build
uses: marvinpinto/action-automatic-releases@latest
Expand Down Expand Up @@ -375,6 +307,10 @@ jobs:
artifact_name: OpenJK-macos-x86_64.tar.gz
zip: false

- artifact_dir: OpenJK-macos-arm64-Release-Non-Portable
artifact_name: OpenJK-macos-arm64.tar.gz
zip: false

- artifact_dir: OpenJO-windows-x86-Release-Non-Portable/JediOutcast
artifact_name: OpenJO-windows-x86.zip
zip: true
Expand All @@ -395,6 +331,10 @@ jobs:
artifact_name: OpenJO-macos-x86_64.tar.gz
zip: false

- artifact_dir: OpenJO-macos-arm64-Release-Non-Portable
artifact_name: OpenJO-macos-arm64.tar.gz
zip: false

steps:
- uses: actions/checkout@v3
with:
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@ pip-log.txt
## clangd
#############
.clangd
compile_commands.json

#############
## CLion
Expand All @@ -192,4 +193,4 @@ pip-log.txt
## CMake Builds
#############
[Bb]uild*/
cmake-build-*
cmake-build-*
13 changes: 11 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ option(BuildMPGame "Whether to create projects for the MP server-side gamecode (
option(BuildMPCGame "Whether to create projects for the MP clientside gamecode (cgamex86.dll)" ON)
option(BuildMPUI "Whether to create projects for the MP UI code (uix86.dll)" ON)
option(BuildMPRend2 "Whether to create projects for the EXPERIMENTAL MP rend2 renderer (rd-rend2_x86.dll)" ON)

option(BuildSPEngine "Whether to create projects for the SP engine (openjk_sp.exe)" ON)
option(BuildSPGame "Whether to create projects for the SP gamecode (jagamex86.dll)" ON)
option(BuildSPRdVanilla "Whether to create projects for the SP default renderer (rdsp-vanilla_x86.dll)" ON)
Expand Down Expand Up @@ -95,6 +96,14 @@ endif()
#=============================================================================
list(INSERT CMAKE_MODULE_PATH 0 "${CMAKE_SOURCE_DIR}/cmake/Modules")

if(CMAKE_EXPORT_COMPILE_COMMANDS)
add_custom_target(
copy-compile-commands ALL
${CMAKE_COMMAND} -E copy_if_different
${CMAKE_BINARY_DIR}/compile_commands.json
${CMAKE_CURRENT_LIST_DIR})
endif()

#=============================================================================
#
# Architecture/OS defines
Expand Down Expand Up @@ -193,11 +202,11 @@ if(WIN64)
endif()

if (APPLE)
set(SharedDefines "MACOS_X")
set(SharedDefines ${SharedDefines} "MACOS_X")
endif()

if (NOT WIN32 AND NOT APPLE)
set(SharedDefines "ARCH_STRING=\"${Architecture}\"")
set(SharedDefines ${SharedDefines} "ARCH_STRING=\"${Architecture}\"")
endif()

if(CMAKE_SYSTEM_NAME MATCHES "BSD")
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ RUN mkdir /usr/src/openjk/build.i386 &&\
cmake -DCMAKE_TOOLCHAIN_FILE=/usr/src/openjk/cmake/Toolchains/linux-i686.cmake \
-DCMAKE_INSTALL_PREFIX=/opt \
-DBuildMPCGame=OFF -DBuildMPEngine=OFF -DBuildMPRdVanilla=OFF -DBuildMPUI=OFF \
-DBuildSPEngine=OFF -DBuildSPGame=OFF -DBuildSPRdVanilla=OFF \
-DBuildSPEngine=OFF -DBuildSPGame=OFF -DBuildSPRdVanilla=OFF -DBuildMPRend2=OFF \
.. &&\
make &&\
make install
Expand All @@ -26,7 +26,7 @@ RUN mkdir /usr/src/openjk/build.x86_64 &&\
cd /usr/src/openjk/build.x86_64 &&\
cmake -DCMAKE_INSTALL_PREFIX=/opt \
-DBuildMPCGame=OFF -DBuildMPEngine=OFF -DBuildMPRdVanilla=OFF -DBuildMPUI=OFF \
-DBuildSPEngine=OFF -DBuildSPGame=OFF -DBuildSPRdVanilla=OFF \
-DBuildSPEngine=OFF -DBuildSPGame=OFF -DBuildSPRdVanilla=OFF -DBuildMPRend2=OFF \
.. &&\
make &&\
make install
Expand Down
Loading

0 comments on commit fda880e

Please sign in to comment.