Merge remote-tracking branch 'origin/master' into hsh

This commit is contained in:
Luke Street 2021-04-19 01:10:28 -04:00
commit c675607d06
1495 changed files with 102495 additions and 4719 deletions

View File

@ -1,85 +0,0 @@
############################################################################
# URDE appveyor build configuration
############################################################################
clone_depth: 1
platform:
- x64
build_cloud: AXIODL-BUILDBOT
image: Windows
build:
verbosity: detailed
configuration:
- Release
cache:
- C:\projects\deps
install:
############################################################################
# All external dependencies are installed in C:\projects\deps
############################################################################
- if not exist C:\projects\deps mkdir C:\projects\deps
- cd C:\projects\deps
############################################################################
# Install Ninja
############################################################################
- set NINJA_URL=https://github.com/ninja-build/ninja/releases/download/v1.10.0/ninja-win.zip
- if not exist ninja.zip appveyor DownloadFile %NINJA_URL% -FileName ninja.zip
- if not exist ninja 7z x ninja.zip -oC:\projects\deps\ninja > nul
############################################################################
# Install a recent CMake
############################################################################
- set CMAKE_URL=https://github.com/Kitware/CMake/releases/download/v3.16.4/cmake-3.16.4-win64-x64.zip
- if not exist cmake.zip appveyor DownloadFile %CMAKE_URL% -FileName cmake.zip
- if not exist cmake 7z x cmake.zip -oC:\projects\deps\cmake > nul
############################################################################
# Install custom LLVM
############################################################################
- set LLVM_URL=https://axiodl.com/files/LLVM-10.0.1-win64.exe
- if not exist LLVM-10.0.1-win64.exe appveyor DownloadFile %LLVM_URL% -FileName LLVM-10.0.1-win64.exe
- if not exist llvm-10.0.1 LLVM-10.0.1-win64.exe /S /D=C:\projects\deps\llvm-10.0.1
before_build:
# Configure ninja
- set PATH=C:\projects\deps\ninja;%PATH%
- ninja --version
# Configure cmake
- set PATH=C:\projects\deps\cmake\cmake-3.16.4-win64-x64\bin;%PATH%
- cmake --version
# Configure LLVM
- set PATH=C:\projects\deps\llvm-10.0.1\bin;%PATH%
- llvm-config --version
- clang-cl -v
# Configure VS
- call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvars64.bat" amd64
# Fetch submodules
- cd %APPVEYOR_BUILD_FOLDER%
- git submodule update --init --recursive
build_script:
- mkdir build
- cd build
- cmake -DCMAKE_BUILD_TYPE=%CONFIGURATION% -DLLVM_ROOT_DIR=C:\projects\deps\llvm-10.0.1 -DCMAKE_C_COMPILER=clang-cl -DCMAKE_CXX_COMPILER=clang-cl -DCMAKE_LINKER=lld-link -DCMAKE_AR=llvm-ar -DCMAKE_RANLIB=llvm-ranlib -GNinja ..
- ninja urde
#notifications:
# - provider: Slack
# incoming_webhook:
# secure: uoO0I0PWyCx0KLjBOG6d17aSVuEEvYztB/UiF8J0LmTb2O735mAdWcuZHTImDFUGZxeI34/qzOB2JKqF+h8dZA5yiprSTkWIookqQjUokAM=
# - provider: Webhook
# url: https://skyhook.glitch.me/api/webhooks/345359672326356993/M8kBYpqr1JyVNhnAHBwNN5TnZmtWy9_msxAQoeOlaa73UhPn8gLU5uYZCjU1qsAi3sGN/appveyor
# method: POST
# on_build_success: true
# on_build_failure: true
# on_build_status_changed: false
# Uncomment this to debug AppVeyor failures.
#on_finish:
# - ps: $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))

201
.github/workflows/build.yml vendored Normal file
View File

@ -0,0 +1,201 @@
name: Build
on:
push:
branches-ignore:
- master
paths-ignore:
- '*.json'
- '*.md'
- '*LICENSE'
pull_request:
jobs:
build-linux:
name: Build Linux (${{matrix.name}} x86_64)
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
include:
- name: GCC
cc: gcc
cxx: g++
- name: Clang
cc: clang
cxx: clang++
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
submodules: recursive
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get -y install build-essential curl git cmake ninja-build llvm-dev libclang-dev clang lld \
zlib1g-dev libglu1-mesa-dev libdbus-1-dev libvulkan-dev libxi-dev libxrandr-dev libasound2-dev \
libpulse-dev libudev-dev libpng-dev libncurses5-dev libx11-xcb-dev python3 python-is-python3 qt5-default \
libcurl4-openssl-dev
# free up disk space
# https://github.com/actions/virtual-environments/issues/2840#issuecomment-790492173
echo Before
df -h .
sudo apt-get clean
sudo rm -rf /usr/share/dotnet
sudo rm -rf /opt/ghc
sudo rm -rf /usr/local/share/boost
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
echo After
df -h .
- name: Create build directory
run: cmake -E make_directory ${{github.workspace}}/build
- name: Configure CMake
working-directory: ${{github.workspace}}/build
run: |
cmake $GITHUB_WORKSPACE -GNinja -DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DCMAKE_C_COMPILER=${{matrix.cc}} -DCMAKE_CXX_COMPILER=${{matrix.cxx}}
- name: Build
working-directory: ${{github.workspace}}/build
run: cmake --build .
build-macos:
name: Build macOS (AppleClang x86_64)
runs-on: macos-10.15
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
submodules: recursive
- name: Install dependencies
run: |
brew update
brew install ninja qt@5 graphicsmagick imagemagick
brew link qt@5
yarn global add create-dmg
- name: Create build directory
run: cmake -E make_directory ${{github.workspace}}/build
- name: Configure CMake
working-directory: ${{github.workspace}}/build
run: |
export PATH="/usr/local/opt/qt@5/bin:$PATH" # FIXME remove
cmake $GITHUB_WORKSPACE -GNinja -DCMAKE_BUILD_TYPE=RelWithDebInfo
- name: Build
working-directory: ${{github.workspace}}/build
run: cmake --build .
build-windows-msvc:
name: Build Windows (MSVC x86_64)
if: 'false' # disabled due to memory constraints
runs-on: windows-2019
env:
LLVM_VERSION: 10.0.1
Qt_VERSION: 5.15.2
IPP_VERSION: 2021.2.0.210
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
submodules: recursive
- name: Install LLVM
run: |
$TempDir = "$env:RUNNER_WORKSPACE\temp"
$Filename = "LLVM-$env:LLVM_VERSION-win64.exe"
New-Item -Path "$TempDir" -ItemType Directory -ea 0
(New-Object Net.WebClient).DownloadFile("https://axiodl.com/files/$Filename", "$TempDir\$Filename")
Start-Process "$TempDir\$Filename" -ArgumentList "/S /D=$env:RUNNER_WORKSPACE\LLVM" -Wait
- name: Install vcpkg Qt
run: |
$TempDir = "$env:RUNNER_WORKSPACE\temp"
$Filename = "vcpkg-qt-$env:Qt_VERSION.7z"
New-Item -Path "$TempDir" -ItemType Directory -ea 0
(New-Object Net.WebClient).DownloadFile("https://axiodl.com/files/$Filename", "$TempDir\$Filename")
7z x "-o$env:RUNNER_WORKSPACE" -aos "$TempDir\$Filename"
- name: Install dependencies
run: choco install ninja vulkan-sdk
- name: Enable Visual Studio environment
uses: ilammy/msvc-dev-cmd@v1
- name: Create build directory
run: cmake -E make_directory ${{github.workspace}}/build
- name: Configure CMake
working-directory: ${{github.workspace}}/build
run: |
$workspace = $env:RUNNER_WORKSPACE -replace '\\', '/'
cmake $env:GITHUB_WORKSPACE -GNinja -DCMAKE_BUILD_TYPE=RelWithDebInfo `
-DCMAKE_TOOLCHAIN_FILE="$workspace/vcpkg-qt-$env:Qt_VERSION/scripts/buildsystems/vcpkg.cmake" `
-DVCPKG_TARGET_TRIPLET=x64-windows-static `
-DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded -DCMAKE_CXX_FLAGS= -DCMAKE_C_FLAGS= `
-DLLVM_ROOT_DIR="$workspace/LLVM"
- name: Build
working-directory: ${{github.workspace}}/build
run: cmake --build .
build-windows-clang:
name: Build Windows (Clang x86_64)
runs-on: windows-2019
env:
LLVM_VERSION: 10.0.1
Qt_VERSION: 5.15.2
IPP_VERSION: 2021.2.0.210
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
submodules: recursive
- name: Install LLVM
run: |
$TempDir = "$env:RUNNER_WORKSPACE\temp"
$Filename = "LLVM-$env:LLVM_VERSION-win64.exe"
New-Item -Path "$TempDir" -ItemType Directory -ea 0
(New-Object Net.WebClient).DownloadFile("https://axiodl.com/files/$Filename", "$TempDir\$Filename")
Start-Process "$TempDir\$Filename" -ArgumentList "/S /D=$env:RUNNER_WORKSPACE\LLVM" -Wait
- name: Install vcpkg Qt
run: |
$TempDir = "$env:RUNNER_WORKSPACE\temp"
$Filename = "vcpkg-qt-$env:Qt_VERSION.7z"
New-Item -Path "$TempDir" -ItemType Directory -ea 0
(New-Object Net.WebClient).DownloadFile("https://axiodl.com/files/$Filename", "$TempDir\$Filename")
7z x "-o$env:RUNNER_WORKSPACE" -aos "$TempDir\$Filename"
- name: Install dependencies
run: choco install ninja vulkan-sdk
- name: Enable Visual Studio environment
uses: ilammy/msvc-dev-cmd@v1
- name: Create build directory
run: cmake -E make_directory ${{github.workspace}}/build
- name: Configure CMake
working-directory: ${{github.workspace}}/build
run: |
$workspace = $env:RUNNER_WORKSPACE -replace '\\', '/'
cmake $env:GITHUB_WORKSPACE -GNinja -DCMAKE_BUILD_TYPE=RelWithDebInfo `
-DCMAKE_TOOLCHAIN_FILE="$workspace/vcpkg-qt-$env:Qt_VERSION/scripts/buildsystems/vcpkg.cmake" `
-DVCPKG_TARGET_TRIPLET=x64-windows-static `
-DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded `
-DCMAKE_C_COMPILER=clang-cl `
-DCMAKE_CXX_COMPILER=clang-cl `
-DCMAKE_LINKER=lld-link `
-DLLVM_ROOT_DIR="$workspace/LLVM"
- name: Build
working-directory: ${{github.workspace}}/build
run: cmake --build .

337
.github/workflows/release.yml vendored Normal file
View File

@ -0,0 +1,337 @@
name: Release
on:
push:
branches:
- master
paths-ignore:
- '*.json'
- '*.md'
- '*LICENSE'
jobs:
build-linux:
name: Build Linux (${{matrix.name}} x86_64)
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
include:
- name: GCC
cc: gcc
cxx: g++
- name: Clang
cc: clang
cxx: clang++
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
submodules: recursive
- name: Install dependencies
run: |
wget https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB
sudo apt-key add GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB
rm GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB
sudo add-apt-repository "deb https://apt.repos.intel.com/oneapi all main"
sudo apt-get -y install build-essential curl git cmake ninja-build llvm-dev libclang-dev clang lld \
zlib1g-dev libglu1-mesa-dev libdbus-1-dev libvulkan-dev libxi-dev libxrandr-dev libasound2-dev \
libpulse-dev libudev-dev libpng-dev libncurses5-dev libx11-xcb-dev python3 python-is-python3 qt5-default \
libcurl4-openssl-dev intel-oneapi-ipp-devel
yarn global add @sentry/cli
echo "$(yarn global bin)" >> $GITHUB_PATH
# free up disk space
# https://github.com/actions/virtual-environments/issues/2840#issuecomment-790492173
echo Before
df -h .
sudo apt-get clean
sudo rm -rf /usr/share/dotnet
sudo rm -rf /opt/ghc
sudo rm -rf /usr/local/share/boost
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
echo After
df -h .
- name: Create build directory
run: cmake -E make_directory ${{github.workspace}}/build
- name: Configure CMake
working-directory: ${{github.workspace}}/build
run: |
cmake $GITHUB_WORKSPACE -GNinja -DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DCMAKE_C_COMPILER=${{matrix.cc}} -DCMAKE_CXX_COMPILER=${{matrix.cxx}} \
-DSENTRY_DSN="${{secrets.SENTRY_DSN}}"
- name: Build
working-directory: ${{github.workspace}}/build
run: cmake --build .
- name: Split debug information
run: ci/split-debug-linux.sh
- name: Upload debug information
if: ${{matrix.name == 'Clang'}}
env:
SENTRY_AUTH_TOKEN: ${{secrets.SENTRY_AUTH_TOKEN}}
SENTRY_URL: ${{secrets.SENTRY_URL}}
run: ci/upload-debug-linux.sh
- name: Generate AppImage
run: ci/build-appimage.sh
- name: Upload artifacts
uses: actions/upload-artifact@v2
with:
name: metaforce-${{env.METAFORCE_VERSION}}-linux-${{matrix.cc}}-x86_64
path: |
Metaforce-*.AppImage
debug.tar.*
build-macos:
name: Build macOS (AppleClang x86_64)
runs-on: macos-10.15
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
submodules: recursive
- name: Install dependencies
run: |
brew update
brew install ninja qt@5 graphicsmagick imagemagick getsentry/tools/sentry-cli
brew link qt@5
yarn global add create-dmg
- name: Install Intel IPP
env:
IPP_VERSION: 2021.2.0.192
run: |
NAME="m_ipp_oneapi_p_${IPP_VERSION}_offline"
curl -LSfs https://registrationcenter-download.intel.com/akdlm/irc_nas/17606/$NAME.dmg -o /tmp/$NAME.dmg
sudo hdiutil attach /tmp/$NAME.dmg -quiet
sudo /Volumes/$NAME/bootstrapper.app/Contents/MacOS/install.sh -c --action install --eula accept
sudo hdiutil detach /Volumes/$NAME -quiet
rm /tmp/$NAME.dmg
- name: Create build directory
run: cmake -E make_directory ${{github.workspace}}/build
- name: Configure CMake
working-directory: ${{github.workspace}}/build
run: |
export PATH="/usr/local/opt/qt@5/bin:$PATH" # FIXME remove
cmake $GITHUB_WORKSPACE -GNinja -DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DSENTRY_DSN="${{secrets.SENTRY_DSN}}"
- name: Build
working-directory: ${{github.workspace}}/build
run: cmake --build .
- name: Upload debug information
env:
SENTRY_AUTH_TOKEN: ${{secrets.SENTRY_AUTH_TOKEN}}
SENTRY_URL: ${{secrets.SENTRY_URL}}
run: ci/upload-debug-macos.sh
- name: Import signing certificate
uses: devbotsxyz/xcode-import-certificate@master
with:
certificate-data: ${{ secrets.MACOS_CERTIFICATE_DATA }}
certificate-passphrase: ${{ secrets.MACOS_CERTIFICATE_PASSWORD }}
keychain-password: ${{ secrets.MACOS_KEYCHAIN_PASSWORD }}
- name: Deploy & codesign application
env:
ASC_USERNAME: ${{secrets.MACOS_ASC_USERNAME}}
ASC_PASSWORD: ${{secrets.MACOS_ASC_PASSWORD}}
ASC_TEAM_ID: ${{secrets.MACOS_ASC_TEAM_ID}}
CODESIGN_IDENT: ${{secrets.MACOS_CODESIGN_IDENT}}
run: ci/build-dmg.sh
- name: Upload artifacts
uses: actions/upload-artifact@v2
with:
name: metaforce-${{env.METAFORCE_VERSION}}-macos-appleclang-x86_64
path: |
Metaforce *.dmg
debug.tar.*
build-windows-msvc:
name: Build Windows (MSVC x86_64)
runs-on: [ self-hosted, windows, x64 ]
env:
LLVM_VERSION: 10.0.1
Qt_VERSION: 5.15.2
# IPP_VERSION: 2021.2.0.210
SENTRY_CLI_VERSION: 1.63.2
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
submodules: recursive
- name: Install LLVM
run: |
$TempDir = "$env:RUNNER_WORKSPACE\temp"
$Filename = "LLVM-$env:LLVM_VERSION-win64.exe"
New-Item -Path "$TempDir" -ItemType Directory -ea 0
(New-Object Net.WebClient).DownloadFile("https://axiodl.com/files/$Filename", "$TempDir\$Filename")
Start-Process "$TempDir\$Filename" -ArgumentList "/S /D=$env:RUNNER_WORKSPACE\LLVM" -Wait
- name: Install vcpkg Qt
run: |
$TempDir = "$env:RUNNER_WORKSPACE\temp"
$Filename = "vcpkg-qt-$env:Qt_VERSION.7z"
New-Item -Path "$TempDir" -ItemType Directory -ea 0
(New-Object Net.WebClient).DownloadFile("https://axiodl.com/files/$Filename", "$TempDir\$Filename")
7z x "-o$env:RUNNER_WORKSPACE" -aos "$TempDir\$Filename"
- name: Download sentry-cli
run: |
$TempDir = "$env:RUNNER_WORKSPACE\temp"
New-Item -Path "$TempDir" -ItemType Directory -ea 0
(New-Object Net.WebClient).DownloadFile("https://github.com/getsentry/sentry-cli/releases/download/$env:SENTRY_CLI_VERSION/sentry-cli-Windows-x86_64.exe", "$TempDir\sentry-cli.exe")
# - name: Install Intel IPP
# run: |
# $TempDir = "$env:RUNNER_WORKSPACE\temp"
# $Filename = "w_ipp_oneapi_p_${env:IPP_VERSION}_offline.exe"
# New-Item -Path "$TempDir" -ItemType Directory -ea 0
# (New-Object Net.WebClient).DownloadFile("https://registrationcenter-download.intel.com/akdlm/irc_nas/$Filename", "$TempDir\$Filename")
# Start-Process "$TempDir\$Filename" -ArgumentList "--x --s --f $TempDir\ipp" -Wait
# Start-Process "$TempDir\ipp\bootstrapper.exe" -ArgumentList "--eula accept -c --action install" -Wait
# - name: Install dependencies
# run: choco install ninja vulkan-sdk
- name: Enable Visual Studio environment
uses: ilammy/msvc-dev-cmd@v1
- name: Create build directory
run: cmake -E make_directory ${{github.workspace}}/build
- name: Configure CMake
working-directory: ${{github.workspace}}/build
run: |
$workspace = $env:RUNNER_WORKSPACE -replace '\\', '/'
cmake $env:GITHUB_WORKSPACE -GNinja -DCMAKE_BUILD_TYPE=RelWithDebInfo `
-DCMAKE_TOOLCHAIN_FILE="$workspace/vcpkg-qt-$env:Qt_VERSION/scripts/buildsystems/vcpkg.cmake" `
-DVCPKG_TARGET_TRIPLET=x64-windows-static `
-DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded -DCMAKE_CXX_FLAGS= -DCMAKE_C_FLAGS= `
-DLLVM_ROOT_DIR="$workspace/LLVM" `
-DSENTRY_DSN="${{secrets.SENTRY_DSN}}"
- name: Build
working-directory: ${{github.workspace}}/build
run: cmake --build .
- name: Upload debug information
working-directory: ${{github.workspace}}/build/Binaries
env:
SENTRY_AUTH_TOKEN: ${{secrets.SENTRY_AUTH_TOKEN}}
SENTRY_URL: ${{secrets.SENTRY_URL}}
run: |
& "$env:RUNNER_WORKSPACE\temp\sentry-cli.exe" upload-dif --org axiodl --project metaforce --include-sources `
metaforce.exe metaforce.pdb hecl.exe hecl.pdb metaforce-gui.exe metaforce-gui.pdb visigen.exe visigen.pdb
- name: Compress PDBs
working-directory: ${{github.workspace}}/build/Binaries
run: 7z a -t7z debug.7z metaforce.pdb hecl.pdb metaforce-gui.pdb visigen.pdb
- name: Upload artifacts
uses: actions/upload-artifact@v2
with:
name: metaforce-${{env.METAFORCE_VERSION}}-win32-msvc-x86_64
path: |
build/Binaries/metaforce.exe
build/Binaries/metaforce-gui.exe
build/Binaries/hecl.exe
build/Binaries/visigen.exe
build/Binaries/crashpad_handler.exe
build/Binaries/debug.7z
build-windows-clang:
name: Build Windows (Clang x86_64)
runs-on: windows-2019
env:
LLVM_VERSION: 10.0.1
Qt_VERSION: 5.15.2
IPP_VERSION: 2021.2.0.210
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
submodules: recursive
- name: Install LLVM
run: |
$TempDir = "$env:RUNNER_WORKSPACE\temp"
$Filename = "LLVM-$env:LLVM_VERSION-win64.exe"
New-Item -Path "$TempDir" -ItemType Directory -ea 0
(New-Object Net.WebClient).DownloadFile("https://axiodl.com/files/$Filename", "$TempDir\$Filename")
Start-Process "$TempDir\$Filename" -ArgumentList "/S /D=$env:RUNNER_WORKSPACE\LLVM" -Wait
- name: Install vcpkg Qt
run: |
$TempDir = "$env:RUNNER_WORKSPACE\temp"
$Filename = "vcpkg-qt-$env:Qt_VERSION.7z"
New-Item -Path "$TempDir" -ItemType Directory -ea 0
(New-Object Net.WebClient).DownloadFile("https://axiodl.com/files/$Filename", "$TempDir\$Filename")
7z x "-o$env:RUNNER_WORKSPACE" -aos "$TempDir\$Filename"
# - name: Install Intel IPP
# run: |
# $TempDir = "$env:RUNNER_WORKSPACE\temp"
# $Filename = "w_ipp_oneapi_p_${env:IPP_VERSION}_offline.exe"
# New-Item -Path "$TempDir" -ItemType Directory -ea 0
# (New-Object Net.WebClient).DownloadFile("https://registrationcenter-download.intel.com/akdlm/irc_nas/17739/$Filename", "$TempDir\$Filename")
# Start-Process "$TempDir\$Filename" -ArgumentList "--x --s --f $TempDir\ipp" -Wait
# Start-Process "$TempDir\ipp\bootstrapper.exe" -ArgumentList "--eula accept -c --action install" -Wait
- name: Install dependencies
run: choco install ninja vulkan-sdk
- name: Enable Visual Studio environment
uses: ilammy/msvc-dev-cmd@v1
- name: Create build directory
run: cmake -E make_directory ${{github.workspace}}/build
- name: Configure CMake
working-directory: ${{github.workspace}}/build
run: |
$workspace = $env:RUNNER_WORKSPACE -replace '\\', '/'
cmake $env:GITHUB_WORKSPACE -GNinja -DCMAKE_BUILD_TYPE=RelWithDebInfo `
-DCMAKE_TOOLCHAIN_FILE="$workspace/vcpkg-qt-$env:Qt_VERSION/scripts/buildsystems/vcpkg.cmake" `
-DVCPKG_TARGET_TRIPLET=x64-windows-static `
-DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded `
-DCMAKE_C_COMPILER=clang-cl `
-DCMAKE_CXX_COMPILER=clang-cl `
-DCMAKE_LINKER=lld-link `
-DLLVM_ROOT_DIR="$workspace/LLVM" `
-DSENTRY_DSN="${{secrets.SENTRY_DSN}}"
- name: Build
working-directory: ${{github.workspace}}/build
run: cmake --build .
- name: Compress PDBs
working-directory: ${{github.workspace}}/build/Binaries
run: 7z a -t7z debug.7z metaforce.pdb hecl.pdb metaforce-gui.pdb visigen.pdb
- name: Upload artifacts
uses: actions/upload-artifact@v2
with:
name: metaforce-${{env.METAFORCE_VERSION}}-win32-clang-x86_64
path: |
build/Binaries/metaforce.exe
build/Binaries/metaforce-gui.exe
build/Binaries/hecl.exe
build/Binaries/visigen.exe
build/Binaries/crashpad_handler.exe
build/Binaries/debug.7z

2
.gitignore vendored
View File

@ -5,7 +5,7 @@ version.h
*.autosave
docs/*
.idea/
Editor/platforms/win/urde.rc
Editor/platforms/win/metaforce.rc
.vs/
out/
cmake-build-*/

View File

@ -1,198 +0,0 @@
.build:variables:
variables: &build_variables
GIT_SUBMODULE_STRATEGY: recursive
.build:macos: &macos_definition
stage: build
tags:
- macos
script:
- mkdir build
- cd build
- >
cmake
-GNinja
-DCMAKE_BUILD_TYPE=RelWithDebInfo
-DURDE_DLPACKAGE=urde-$CI_PIPELINE_ID-macos-x86_64-$URDE_VECTOR_ISA
-DURDE_VECTOR_ISA=$URDE_VECTOR_ISA
..
- ninja urde hecl visigen
- cd Binaries
- cp -R urde.app $CI_PROJECT_DIR/URDE.app
- cd $CI_PROJECT_DIR
- strip -S -o URDE.app/Contents/MacOS/urde URDE.app/Contents/MacOS/urde
- strip -S -o URDE.app/Contents/MacOS/hecl URDE.app/Contents/MacOS/hecl
- strip -S -o URDE.app/Contents/MacOS/visigen URDE.app/Contents/MacOS/visigen
- (if [ "${URDE_MACOS_CODESIGN_UID}" != "" ]; then codesign -s $URDE_MACOS_CODESIGN_UID --deep URDE.app; else echo "Unable to sign app bundle :("; fi);
only:
- release
- dev
artifacts:
name: "urde-$CI_PIPELINE_ID-macos-x86_64-$URDE_VECTOR_ISA"
paths:
- URDE.app/
expire_in: 1 week
build:macos:sse3:
<<: *macos_definition
variables:
<<: *build_variables
URDE_VECTOR_ISA: sse3
build:macos:sse41:
<<: *macos_definition
variables:
<<: *build_variables
URDE_VECTOR_ISA: sse41
build:macos:avx:
<<: *macos_definition
variables:
<<: *build_variables
URDE_VECTOR_ISA: avx
build:macos:avx2:
<<: *macos_definition
variables:
<<: *build_variables
URDE_VECTOR_ISA: avx2
.build:linux: &linux_definition
stage: build
tags:
- linux
script:
- mkdir build
- cd build
- >
cmake
-GNinja
-DCMAKE_BUILD_TYPE=RelWithDebInfo
-DURDE_DLPACKAGE=urde-$CI_PIPELINE_ID-linux-x86_64-$URDE_VECTOR_ISA
-DURDE_VECTOR_ISA=$URDE_VECTOR_ISA
..
- nice -n19 ninja -j8 urde hecl visigen
- cp Binaries/urde $CI_PROJECT_DIR
- strip --strip-debug -o $CI_PROJECT_DIR/urde Binaries/urde
- rm -r $CI_PROJECT_DIR/hecl
- strip --strip-debug -o $CI_PROJECT_DIR/hecl Binaries/hecl
- rm -r $CI_PROJECT_DIR/visigen
- strip --strip-debug -o $CI_PROJECT_DIR/visigen Binaries/visigen
only:
- release
- dev
artifacts:
name: "urde-$CI_PIPELINE_ID-linux-x86_64-$URDE_VECTOR_ISA"
paths:
- urde
- hecl
- visigen
expire_in: 1 week
build:linux:sse3:
<<: *linux_definition
variables:
<<: *build_variables
URDE_VECTOR_ISA: sse3
build:linux:sse41:
<<: *linux_definition
variables:
<<: *build_variables
URDE_VECTOR_ISA: sse41
build:linux:avx:
<<: *linux_definition
variables:
<<: *build_variables
URDE_VECTOR_ISA: avx
build:linux:avx2:
<<: *linux_definition
variables:
<<: *build_variables
URDE_VECTOR_ISA: avx2
.build:win32: &win32_definition
stage: build
tags:
- win32
script:
- cmd.exe /c "call `"C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvars64.bat`" && set > %temp%\vcvars.txt"
- >
Get-Content "$env:temp\vcvars.txt" | Foreach-Object {
if ($_ -match "^(.*?)=(.*)$") {
Set-Content "env:\$($matches[1])" $matches[2]
}
}
- mkdir build
- cd build
- >
cmake
-GNinja
-DCMAKE_BUILD_TYPE=RelWithDebInfo
-DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded
-DURDE_DLPACKAGE="urde-$env:CI_PIPELINE_ID-win32-x86_64-$env:URDE_VECTOR_ISA"
-DURDE_VECTOR_ISA="$env:URDE_VECTOR_ISA"
-DLLVM_ROOT_DIR=C:\projects\deps\llvm
-DCMAKE_C_FLAGS=
-DCMAKE_CXX_FLAGS=
..
- ninja urde hecl visigen
- 'copy Binaries\urde.exe "$env:CI_PROJECT_DIR\urde.exe"'
- 'pdbcopy Binaries\urde.pdb "$env:CI_PROJECT_DIR\urde.pdb" -p'
- 'copy Binaries\hecl.exe "$env:CI_PROJECT_DIR\hecl.exe"'
- 'pdbcopy Binaries\hecl.pdb "$env:CI_PROJECT_DIR\hecl.pdb" -p'
- 'copy Binaries\visigen.exe "$env:CI_PROJECT_DIR\visigen.exe"'
- 'pdbcopy Binaries\visigen.pdb "$env:CI_PROJECT_DIR\visigen.pdb" -p'
only:
- release
- dev
artifacts:
name: "urde-$env:CI_PIPELINE_ID-win32-x86_64-$env:URDE_VECTOR_ISA"
paths:
- urde.exe
- urde.pdb
- hecl.exe
- hecl.pdb
- visigen.exe
- visigen.pdb
expire_in: 1 week
build:win32:sse2:
<<: *win32_definition
variables:
<<: *build_variables
URDE_VECTOR_ISA: sse2
build:win32:sse41:
<<: *win32_definition
variables:
<<: *build_variables
URDE_VECTOR_ISA: sse41
build:win32:avx:
<<: *win32_definition
variables:
<<: *build_variables
URDE_VECTOR_ISA: avx
build:win32:avx2:
<<: *win32_definition
variables:
<<: *build_variables
URDE_VECTOR_ISA: avx2
deploy:
stage: deploy
only:
- release
- dev
dependencies: []
tags:
- server
variables:
GIT_STRATEGY: none
script:
- python3 /var/lib/gitlab-runner/deploy_urde.py $CI_PIPELINE_ID $CI_COMMIT_REF_NAME

56
.gitmodules vendored
View File

@ -1,42 +1,56 @@
[submodule "hecl"]
path = hecl
url = ../hecl.git
[submodule "nod"]
path = nod
path = extern/nod
url = ../nod.git
branch = master
[submodule "amuse"]
path = amuse
path = extern/amuse
url = ../amuse.git
branch = master
[submodule "kabufuda"]
path = kabufuda
path = extern/kabufuda
url = ../kabufuda.git
branch = master
[submodule "jbus"]
path = jbus
path = extern/jbus
url = ../jbus.git
branch = master
[submodule "assetnameparser/tinyxml2"]
path = assetnameparser/tinyxml2
path = extern/tinyxml2
url = ../tinyxml2.git
[submodule "hecl-gui"]
path = hecl-gui
url = ../hecl-gui.git
branch = master
[submodule "sanitizers-cmake"]
path = sanitizers-cmake
path = extern/sanitizers-cmake
url = https://github.com/arsenm/sanitizers-cmake.git
branch = master
[submodule "discord-rpc"]
path = discord-rpc
path = extern/discord-rpc
url = https://github.com/discordapp/discord-rpc.git
branch = master
[submodule "rapidjson"]
path = rapidjson
path = extern/rapidjson
url = https://github.com/Tencent/rapidjson.git
branch = master
[submodule "NESEmulator/fixNES"]
path = NESEmulator/fixNES
path = extern/fixNES
url = https://github.com/FIX94/fixNES.git
[submodule "Editor/locale"]
path = Editor/locale
url = ../urde-translations.git
[submodule "boo2"]
path = boo2
branch = master
[submodule "extern/libSquish"]
path = extern/libSquish
url = ../libSquish.git
branch = master
[submodule "extern/athena"]
path = extern/athena
url = ../../libAthena/athena.git
branch = master
[submodule "extern/boo2"]
path = extern/boo2
url = ../boo2.git
branch = master
[submodule "extern/libjpeg-turbo"]
path = extern/libjpeg-turbo
url = ../libjpeg-turbo.git
branch = thp
[submodule "zeus"]
path = zeus
path = extern/zeus
url = ../zeus.git
branch = master

View File

@ -1,26 +1,80 @@
cmake_minimum_required(VERSION 3.15 FATAL_ERROR)
# Allow target_link_libraries with targets in other directories
cmake_policy(SET CMP0079 NEW)
# Set MSVC runtime library flags from CMAKE_MSVC_RUNTIME_LIBRARY
cmake_policy(SET CMP0091 NEW)
cmake_policy(VERSION 3.15...3.20)
if (NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE "RelWithDebInfo" CACHE STRING
"Build type options: Debug Release RelWithDebInfo MinSizeRel" FORCE)
endif ()
# obtain revision info from git
find_package(Git)
if (GIT_FOUND)
# make sure version information gets re-run when the current Git HEAD changes
execute_process(WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} COMMAND ${GIT_EXECUTABLE} rev-parse --git-path HEAD
OUTPUT_VARIABLE metaforce_git_head_filename
OUTPUT_STRIP_TRAILING_WHITESPACE)
set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS "${metaforce_git_head_filename}")
execute_process(WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} COMMAND ${GIT_EXECUTABLE} rev-parse --symbolic-full-name HEAD
OUTPUT_VARIABLE metaforce_git_head_symbolic
OUTPUT_STRIP_TRAILING_WHITESPACE)
execute_process(WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
COMMAND ${GIT_EXECUTABLE} rev-parse --git-path ${metaforce_git_head_symbolic}
OUTPUT_VARIABLE metaforce_git_head_symbolic_filename
OUTPUT_STRIP_TRAILING_WHITESPACE)
set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS "${metaforce_git_head_symbolic_filename}")
# defines METAFORCE_WC_REVISION
execute_process(WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} COMMAND ${GIT_EXECUTABLE} rev-parse HEAD
OUTPUT_VARIABLE METAFORCE_WC_REVISION
OUTPUT_STRIP_TRAILING_WHITESPACE)
# defines METAFORCE_WC_DESCRIBE
execute_process(WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} COMMAND ${GIT_EXECUTABLE} describe --tag --long --dirty
OUTPUT_VARIABLE METAFORCE_WC_DESCRIBE
OUTPUT_STRIP_TRAILING_WHITESPACE)
# remove hash (and trailing "-0" if needed) from description
string(REGEX REPLACE "(-0)?-[^-]+((-dirty)?)$" "\\2" METAFORCE_WC_DESCRIBE "${METAFORCE_WC_DESCRIBE}")
# defines METAFORCE_WC_BRANCH
execute_process(WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} COMMAND ${GIT_EXECUTABLE} rev-parse --abbrev-ref HEAD
OUTPUT_VARIABLE METAFORCE_WC_BRANCH
OUTPUT_STRIP_TRAILING_WHITESPACE)
# defines METAFORCE_WC_DATE
execute_process(WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} COMMAND ${GIT_EXECUTABLE} log -1 --format=%ad
OUTPUT_VARIABLE METAFORCE_WC_DATE
OUTPUT_STRIP_TRAILING_WHITESPACE)
else ()
message(STATUS "Unable to find git, commit information will not be available")
endif ()
if (METAFORCE_WC_DESCRIBE)
string(REGEX REPLACE "v([0-9]+)\.([0-9]+)\.([0-9]+)\-([0-9]+).*" "\\1.\\2.\\3.\\4" METAFORCE_VERSION_STRING "${METAFORCE_WC_DESCRIBE}")
string(REGEX REPLACE "v([0-9]+)\.([0-9]+)\.([0-9]+).*" "\\1.\\2.\\3" METAFORCE_VERSION_STRING "${METAFORCE_VERSION_STRING}")
else ()
set(METAFORCE_WC_DESCRIBE "UNKNOWN-VERSION")
set(METAFORCE_VERSION_STRING "0.0.0")
endif ()
string(TIMESTAMP CURRENT_YEAR "%Y")
# Add version information to CI environment variables
if(DEFINED ENV{GITHUB_ENV})
file(APPEND "$ENV{GITHUB_ENV}" "METAFORCE_VERSION=${METAFORCE_WC_DESCRIBE}")
endif()
message(STATUS "Metaforce version set to ${METAFORCE_WC_DESCRIBE}")
project(metaforce LANGUAGES C CXX ASM VERSION ${METAFORCE_VERSION_STRING})
if (APPLE)
set(PLATFORM_NAME macos)
elseif (WIN32)
set(PLATFORM_NAME win32)
elseif (CMAKE_SYSTEM_NAME STREQUAL "Linux")
set(PLATFORM_NAME linux)
endif ()
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/Binaries)
if(APPLE)
# Shaddup Xcode
function(add_executable TARGET)
_add_executable(${TARGET} ${ARGN})
set_target_properties(${TARGET} PROPERTIES XCODE_ATTRIBUTE_WARNING_CFLAGS "")
endfunction()
function(add_library TARGET)
_add_library(${TARGET} ${ARGN})
list(GET ARGV 1 ARG1)
if(NOT ${ARG1} STREQUAL INTERFACE AND NOT ${ARG1} STREQUAL ALIAS)
set_target_properties(${TARGET} PROPERTIES XCODE_ATTRIBUTE_WARNING_CFLAGS "")
endif()
endfunction()
endif()
if(APPLE AND NOT CMAKE_OSX_SYSROOT)
# If the Xcode SDK is lagging behind system version, CMake needs this done first
execute_process(COMMAND xcrun --sdk macosx --show-sdk-path
@ -28,8 +82,8 @@ if(APPLE AND NOT CMAKE_OSX_SYSROOT)
OUTPUT_STRIP_TRAILING_WHITESPACE)
endif()
option(URDE_CROSSCOMPILING "Don't build tools; attempt package import" OFF)
if (URDE_CROSSCOMPILING)
option(METAFORCE_CROSSCOMPILING "Don't build tools; attempt package import" OFF)
if (METAFORCE_CROSSCOMPILING)
set(CMAKE_CROSSCOMPILING On)
endif()
@ -37,8 +91,6 @@ if(CMAKE_CROSSCOMPILING)
set(HAVE_WORDS_BIGENDIAN_EXITCODE 0 CACHE INTEGER "Makes soxr happy" FORCE)
endif()
project(urde VERSION 0.1.0)
# MSVC has a "latest" flag, which always uses the newest standard
# when available. GCC and Clang posess no such flag, and must be
# manually enforced. CMake, curiously, also doesn't have a "latest"
@ -51,26 +103,28 @@ endif()
set(BUILD_SHARED_LIBS OFF CACHE BOOL "Force shared libs off" FORCE)
set(BUILD_STATIC_LIBS ON CACHE BOOL "Force static libs on" FORCE)
list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/sanitizers-cmake/cmake")
list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/extern/sanitizers-cmake/cmake")
find_package(Sanitizers)
if (NX)
set(URDE_VECTOR_ISA "neon")
else()
set(URDE_VECTOR_ISA "sse2" CACHE STRING "Vector ISA to build for (sse2, sse3, sse41, avx, avx2)")
endif()
if (CMAKE_SYSTEM_PROCESSOR STREQUAL x86_64 OR CMAKE_SYSTEM_PROCESSOR STREQUAL AMD64)
set(METAFORCE_VECTOR_ISA "sse41" CACHE STRING "Vector ISA to build for (sse2, sse3, sse41, avx, avx2)")
endif ()
if(MSVC)
if(${URDE_VECTOR_ISA} STREQUAL "avx2")
if(${METAFORCE_VECTOR_ISA} STREQUAL "avx2")
add_compile_options(/arch:AVX2)
add_compile_definitions(__SSE4_1__=1)
message(STATUS "Building with AVX2 Vector ISA")
elseif(${URDE_VECTOR_ISA} STREQUAL "avx")
elseif(${METAFORCE_VECTOR_ISA} STREQUAL "avx")
add_compile_options(/arch:AVX)
add_compile_definitions(__SSE4_1__=1)
message(STATUS "Building with AVX Vector ISA")
elseif(${URDE_VECTOR_ISA} STREQUAL "sse41")
elseif(${METAFORCE_VECTOR_ISA} STREQUAL "sse41")
add_compile_definitions(__SSE4_1__=1)
# clang-cl 10 requires -msse4.1, may be fixed in newer versions?
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL Clang)
add_compile_options($<$<OR:$<COMPILE_LANGUAGE:C>,$<COMPILE_LANGUAGE:CXX>>:-msse4.1>)
endif()
message(STATUS "Building with SSE4.1 Vector ISA")
else()
message(STATUS "Building with SSE2 Vector ISA")
@ -78,7 +132,7 @@ if(MSVC)
if(${CMAKE_GENERATOR} MATCHES "Visual Studio*")
set(VS_OPTIONS "/MP")
set_property(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECT urde)
set_property(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECT metaforce)
endif()
# Shaddup MSVC
@ -86,9 +140,24 @@ if(MSVC)
_CRT_SECURE_NO_WARNINGS=1 D_SCL_SECURE_NO_WARNINGS=1
_SCL_SECURE_NO_DEPRECATE=1 _CRT_NONSTDC_NO_WARNINGS=1
_ENABLE_EXTENDED_ALIGNED_STORAGE=1 NOMINMAX=1)
add_compile_options(/IGNORE:4221 /wd4018 /wd4800 /wd4005 /wd4311 /wd4068
/wd4267 /wd4244 /wd4200 /wd4305 /wd4067 /wd4146 /wd4309 /wd4805 ${VS_OPTIONS})
add_compile_options(/IGNORE:4221
$<$<OR:$<COMPILE_LANGUAGE:C>,$<COMPILE_LANGUAGE:CXX>>:/wd4018>
$<$<OR:$<COMPILE_LANGUAGE:C>,$<COMPILE_LANGUAGE:CXX>>:/wd4800>
$<$<OR:$<COMPILE_LANGUAGE:C>,$<COMPILE_LANGUAGE:CXX>>:/wd4005>
$<$<OR:$<COMPILE_LANGUAGE:C>,$<COMPILE_LANGUAGE:CXX>>:/wd4311>
$<$<OR:$<COMPILE_LANGUAGE:C>,$<COMPILE_LANGUAGE:CXX>>:/wd4068>
$<$<OR:$<COMPILE_LANGUAGE:C>,$<COMPILE_LANGUAGE:CXX>>:/wd4267>
$<$<OR:$<COMPILE_LANGUAGE:C>,$<COMPILE_LANGUAGE:CXX>>:/wd4244>
$<$<OR:$<COMPILE_LANGUAGE:C>,$<COMPILE_LANGUAGE:CXX>>:/wd4200>
$<$<OR:$<COMPILE_LANGUAGE:C>,$<COMPILE_LANGUAGE:CXX>>:/wd4305>
$<$<OR:$<COMPILE_LANGUAGE:C>,$<COMPILE_LANGUAGE:CXX>>:/wd4067>
$<$<OR:$<COMPILE_LANGUAGE:C>,$<COMPILE_LANGUAGE:CXX>>:/wd4146>
$<$<OR:$<COMPILE_LANGUAGE:C>,$<COMPILE_LANGUAGE:CXX>>:/wd4309>
$<$<OR:$<COMPILE_LANGUAGE:C>,$<COMPILE_LANGUAGE:CXX>>:/wd4805>
${VS_OPTIONS})
string(REPLACE "/GR " "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
string(REPLACE " /EHsc" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
add_compile_options(
# Disable exceptions
$<$<COMPILE_LANGUAGE:CXX>:/EHsc->
@ -108,7 +177,6 @@ if(MSVC)
# Use latest C++ standard.
$<$<COMPILE_LANGUAGE:CXX>:/std:c++latest>
)
add_compile_definitions(FMT_EXCEPTIONS=0 _HAS_EXCEPTIONS=0)
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
# Flags for MSVC (not clang-cl)
@ -120,40 +188,39 @@ if(MSVC)
$<$<COMPILE_LANGUAGE:CXX>:/Zc:throwingNew>
# Link-time Code Generation for Release builds
$<$<OR:$<CONFIG:Release>,$<CONFIG:RelWithDebInfo>>:/GL>
$<$<CONFIG:Release>:/GL>
)
# Link-time Code Generation for Release builds
set(CMAKE_STATIC_LINKER_FLAGS_RELEASE "/LTCG")
set(CMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO "/LTCG")
set(CMAKE_EXE_LINKER_FLAGS_RELEASE "/RELEASE /LTCG /OPT:REF /OPT:ICF /INCREMENTAL:NO")
set(CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO "/DEBUG /RELEASE /LTCG /OPT:REF /OPT:ICF /INCREMENTAL:NO /DEBUGTYPE:cv,fixup")
set(CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO "/DEBUG /RELEASE /OPT:REF /OPT:ICF /INCREMENTAL:NO /DEBUGTYPE:cv,fixup")
endif()
else()
if(${URDE_VECTOR_ISA} STREQUAL "native")
if(${CMAKE_SYSTEM_PROCESSOR} STREQUAL x86_64)
if(${METAFORCE_VECTOR_ISA} STREQUAL "native")
add_compile_options(-march=native)
message(STATUS "Building with native ISA")
elseif(${URDE_VECTOR_ISA} STREQUAL "avx2")
elseif(${METAFORCE_VECTOR_ISA} STREQUAL "avx2")
add_compile_options(-mavx2)
message(STATUS "Building with AVX2 Vector ISA")
elseif(${URDE_VECTOR_ISA} STREQUAL "avx")
elseif(${METAFORCE_VECTOR_ISA} STREQUAL "avx")
add_compile_options(-mavx)
message(STATUS "Building with AVX Vector ISA")
elseif(${URDE_VECTOR_ISA} STREQUAL "sse41")
elseif(${METAFORCE_VECTOR_ISA} STREQUAL "sse41")
add_compile_options(-msse4.1)
message(STATUS "Building with SSE4.1 Vector ISA")
elseif(${URDE_VECTOR_ISA} STREQUAL "sse3")
elseif(${METAFORCE_VECTOR_ISA} STREQUAL "sse3")
add_compile_options(-msse3)
message(STATUS "Building with SSE3 Vector ISA")
elseif(${URDE_VECTOR_ISA} STREQUAL "sse2")
elseif(${METAFORCE_VECTOR_ISA} STREQUAL "sse2")
add_compile_options(-msse2)
message(STATUS "Building with SSE2 Vector ISA")
elseif(${URDE_VECTOR_ISA} STREQUAL "neon")
message(STATUS "Building with NEON Vector ISA")
else()
message(STATUS "Building with x87 Vector ISA")
endif()
endif()
include(CheckCXXCompilerFlag)
check_cxx_compiler_flag(-fno-plt HAS_NO_PLT)
@ -161,12 +228,12 @@ else()
add_compile_options(-fno-plt)
endif()
check_cxx_compiler_flag(-fno-asynchronous-unwind-tables HAS_NO_ASYNC_UNWIND_TABLES)
if (HAS_NO_ASYNC_UNWIND_TABLES)
if (HAS_NO_ASYNC_UNWIND_TABLES AND ${CMAKE_BUILD_TYPE} STREQUAL Release)
# Binary size reduction
add_compile_options(-fno-asynchronous-unwind-tables)
endif()
if(URDE_MSAN)
if(METAFORCE_MSAN)
add_compile_options($<$<COMPILE_LANGUAGE:CXX>:-stdlib=libc++> -fsanitize=memory
-fsanitize-memory-track-origins -fsanitize-recover=all)
endif()
@ -179,13 +246,16 @@ else()
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "AppleClang")
add_compile_options(-Wno-unknown-warning-option -Wno-unused-private-field)
elseif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
add_compile_options(-Wno-lto-type-mismatch)
add_compile_options(-Wno-lto-type-mismatch -Wno-maybe-uninitialized)
endif()
add_compile_definitions(FMT_EXCEPTIONS=0)
if(APPLE)
add_compile_options(-Wno-error=deprecated-declarations
$<$<OR:$<CONFIG:Release>,$<CONFIG:RelWithDebInfo>>:-flto=thin>)
$<$<CONFIG:Release>:-flto=thin>)
if (METAFORCE_ASAN)
add_compile_options(-fsanitize=address -fsanitize-address-use-after-scope)
add_link_options(-fsanitize=address -fsanitize-address-use-after-scope)
endif ()
endif()
endif()
@ -197,9 +267,9 @@ endif()
if("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux")
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
if(${CMAKE_BUILD_TYPE} STREQUAL Debug)
if(${CMAKE_BUILD_TYPE} STREQUAL Debug OR ${CMAKE_BUILD_TYPE} STREQUAL RelWithDebInfo)
# This is required to summarize std::string
add_compile_options(-fno-limit-debug-info)
add_compile_options(-fno-limit-debug-info -fno-omit-frame-pointer)
endif()
option(USE_LD_LLD "Link with LLD" ON)
elseif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
@ -241,7 +311,11 @@ if(USE_LD_GOLD)
if("${LD_VERSION}" MATCHES "GNU gold")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fuse-ld=gold -Wl,--disable-new-dtags")
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -fuse-ld=gold -Wl,--disable-new-dtags")
if(USE_LTO)
if (USE_SPLIT_DWARF)
add_compile_options(-gsplit-dwarf -Wl,--gdb-index)
add_link_options(-gsplit-dwarf -Wl,--gdb-index)
message(STATUS "GNU gold linker enabled with split DWARF.")
elseif (USE_LTO)
add_compile_options(-flto)
add_link_options(-flto)
message(STATUS "GNU gold linker enabled with LTO.")
@ -257,17 +331,15 @@ endif()
# Add discord-rpc here
if(NOT GEKKO AND NOT NX)
set(PROJECT_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/discord-rpc)
set(PROJECT_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/extern/discord-rpc)
if (NOT CMAKE_INSTALL_LIBDIR)
set(CMAKE_INSTALL_LIBDIR ${CMAKE_BINARY_DIR}/fake-prefix)
endif()
add_subdirectory(discord-rpc/src)
target_include_directories(discord-rpc PRIVATE rapidjson/include PUBLIC discord-rpc/include)
add_subdirectory(extern/discord-rpc/src)
target_include_directories(discord-rpc PRIVATE extern/rapidjson/include PUBLIC extern/discord-rpc/include)
endif()
add_subdirectory(nod)
set(HECL_DLPACKAGE ${URDE_DLPACKAGE})
add_subdirectory(extern/nod)
set(DATA_SPEC_LIBS RetroDataSpec AssetNameMap)
set(HECL_DATASPEC_DECLS
@ -300,7 +372,9 @@ set(HECL_DATASPEC_PUSHES
# TODO: Fix weirdness
find_package(hsh REQUIRED)
add_subdirectory(boo2)
add_subdirectory(extern/xxhash)
add_subdirectory(hecl)
add_subdirectory(extern/zeus)
target_include_directories(hecl-full PRIVATE ${CMAKE_SOURCE_DIR})
target_include_directories(hecl-light PRIVATE ${CMAKE_SOURCE_DIR})
target_link_libraries(hecl-full PRIVATE zeus nod)
@ -315,19 +389,18 @@ if(NOT TARGET atdna)
# Import native atdna if cross-compiling
find_package(atdna REQUIRED)
if(NOT TARGET atdna)
message(FATAL_ERROR "atdna required for building URDE; please verify LLVM installation")
message(FATAL_ERROR "atdna required for building Metaforce; please verify LLVM installation")
endif()
endif()
add_subdirectory(amuse)
add_subdirectory(zeus)
add_subdirectory(extern/amuse)
add_subdirectory(assetnameparser)
add_compile_definitions(URDE_ZIP_INPUT_STREAM=1) # Enable CZipInputStream now that zlib header is known
add_subdirectory(DataSpec)
add_subdirectory(kabufuda)
add_subdirectory(extern/kabufuda)
add_subdirectory(jbus)
set(JBUS_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/jbus/include)
add_subdirectory(extern/jbus)
set(JBUS_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/extern/jbus/include)
set(CLIENT_SOURCES
${CMAKE_SOURCE_DIR}/Editor/ProjectResourceFactoryBase.hpp
@ -343,35 +416,25 @@ add_subdirectory(visigen)
add_dependencies(hecl visigen)
if (NOT WINDOWS_STORE AND NOT NX)
find_package(Qt5Widgets PATHS /usr/local/opt/qt)
if (Qt5Widgets_FOUND)
message(STATUS "Qt5 found, hecl-gui will be built")
add_subdirectory(hecl-gui)
if(APPLE AND CMAKE_SYSTEM_PROCESSOR STREQUAL x86_64)
set(QT_HOMEBREW_PATH /usr/local/opt/qt)
elseif(APPLE AND CMAKE_SYSTEM_PROCESSOR STREQUAL arm64)
set(QT_HOMEBREW_PATH /opt/homebrew/opt/qt)
else()
message(STATUS "Qt5 not found, hecl-gui will not be built")
set(QT_HOMEBREW_PATH "")
endif()
find_package(Qt6Widgets QUIET PATHS ${QT_HOMEBREW_PATH})
find_package(Qt5Widgets QUIET PATHS ${QT_HOMEBREW_PATH})
if (Qt6Widgets_FOUND)
message(STATUS "Qt6 found, metaforce-gui will be built")
add_subdirectory(metaforce-gui)
elseif(Qt5Widgets_FOUND)
message(STATUS "Qt5 found, metaforce-gui will be built")
add_subdirectory(metaforce-gui)
else()
message(STATUS "Qt5-6 not found, metaforce-gui will not be built")
endif()
endif()
unset(GIT_EXECUTABLE CACHE)
find_package(Git)
if(GIT_FOUND)
# Get the current working branch
execute_process(COMMAND "${GIT_EXECUTABLE}" rev-parse --abbrev-ref HEAD WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
OUTPUT_VARIABLE GIT_BRANCH OUTPUT_STRIP_TRAILING_WHITESPACE )
# Get the latest abbreviated commit hash of the working branch
execute_process(COMMAND ${GIT_EXECUTABLE} log -1 --format=%h WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} OUTPUT_VARIABLE
GIT_COMMIT_HASH OUTPUT_STRIP_TRAILING_WHITESPACE)
execute_process(COMMAND ${GIT_EXECUTABLE} rev-parse HEAD WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} OUTPUT_VARIABLE
GIT_COMMIT_HASH_FULL OUTPUT_STRIP_TRAILING_WHITESPACE)
execute_process(COMMAND ${GIT_EXECUTABLE} log -1 --format=%ad WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} OUTPUT_VARIABLE
GIT_COMMIT_DATE OUTPUT_STRIP_TRAILING_WHITESPACE)
else()
message(STATUS "Unable to find GIT, commit information will not be available")
set(GIT_BRANCH "")
set(GIT_COMMIT_HASH "")
set(GIT_COMMIT_HASH_FULL "")
set(GIT_COMMIT_DATE "")
endif()
configure_file(${CMAKE_SOURCE_DIR}/version.h.in ${CMAKE_BINARY_DIR}/version.h)

View File

@ -13,7 +13,7 @@
"variables": [
{
"name": "CMAKE_MSVC_RUNTIME_LIBRARY",
"value": "MultiThreadedDebug",
"value": "MultiThreadedDebugDLL",
"type": "STRING"
},
{
@ -30,16 +30,6 @@
"name": "CMAKE_LINKER",
"value": "C:\\Program Files\\LLVM\\bin\\lld-link.exe",
"type": "FILEPATH"
},
{
"name": "CMAKE_AR",
"value": "C:\\Program Files\\LLVM\\bin\\llvm-ar.exe",
"type": "FILEPATH"
},
{
"name": "CMAKE_RANLIB",
"value": "C:\\Program Files\\LLVM\\bin\\llvm-ranlib.exe",
"type": "FILEPATH"
}
]
},
@ -56,7 +46,7 @@
"variables": [
{
"name": "CMAKE_MSVC_RUNTIME_LIBRARY",
"value": "MultiThreaded",
"value": "MultiThreadedDLL",
"type": "STRING"
},
{
@ -73,16 +63,6 @@
"name": "CMAKE_LINKER",
"value": "C:\\Program Files\\LLVM\\bin\\lld-link.exe",
"type": "FILEPATH"
},
{
"name": "CMAKE_AR",
"value": "C:\\Program Files\\LLVM\\bin\\llvm-ar.exe",
"type": "FILEPATH"
},
{
"name": "CMAKE_RANLIB",
"value": "C:\\Program Files\\LLVM\\bin\\llvm-ranlib.exe",
"type": "FILEPATH"
}
]
},
@ -126,16 +106,6 @@
"name": "CMAKE_LINKER",
"value": "C:\\Program Files\\LLVM\\bin\\lld-link.exe",
"type": "FILEPATH"
},
{
"name": "CMAKE_AR",
"value": "C:\\Program Files\\LLVM\\bin\\llvm-ar.exe",
"type": "FILEPATH"
},
{
"name": "CMAKE_RANLIB",
"value": "C:\\Program Files\\LLVM\\bin\\llvm-ranlib.exe",
"type": "FILEPATH"
}
]
},
@ -152,7 +122,7 @@
"variables": [
{
"name": "CMAKE_MSVC_RUNTIME_LIBRARY",
"value": "MultiThreadedDebug",
"value": "MultiThreadedDebugDLL",
"type": "STRING"