mirror of
https://github.com/HarbourMasters/SpaghettiKart
synced 2026-06-24 01:41:42 -04:00
321 lines
20 KiB
HTML
321 lines
20 KiB
HTML
<!-- HTML header for doxygen 1.10.0-->
|
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
|
|
<head>
|
|
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
|
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
|
|
<meta name="generator" content="Doxygen 1.13.2"/>
|
|
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
|
<title>Mario Kart 64: Building SpagettiKart</title>
|
|
<link href="tabs.css" rel="stylesheet" type="text/css"/>
|
|
<script type="text/javascript" src="jquery.js"></script>
|
|
<script type="text/javascript" src="dynsections.js"></script>
|
|
<script type="text/javascript" src="clipboard.js"></script>
|
|
<link href="navtree.css" rel="stylesheet" type="text/css"/>
|
|
<script type="text/javascript" src="navtreedata.js"></script>
|
|
<script type="text/javascript" src="navtree.js"></script>
|
|
<script type="text/javascript" src="resize.js"></script>
|
|
<script type="text/javascript" src="cookie.js"></script>
|
|
<link href="search/search.css" rel="stylesheet" type="text/css"/>
|
|
<script type="text/javascript" src="search/searchdata.js"></script>
|
|
<script type="text/javascript" src="search/search.js"></script>
|
|
<link href="doxygen.css" rel="stylesheet" type="text/css" />
|
|
<link href="doxygen-awesome.css" rel="stylesheet" type="text/css"/>
|
|
<link href="doxygen-awesome-sidebar-only.css" rel="stylesheet" type="text/css"/>
|
|
<link href="doxygen-awesome-sidebar-only-darkmode-toggle.css" rel="stylesheet" type="text/css"/>
|
|
<link href="docs.css" rel="stylesheet" type="text/css"/>
|
|
<script type="text/javascript" src="doxygen-awesome-darkmode-toggle.js"></script>
|
|
<script type="text/javascript">
|
|
DoxygenAwesomeDarkModeToggle.init()
|
|
</script>
|
|
</head>
|
|
<body>
|
|
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
|
|
<div id="titlearea">
|
|
<table cellspacing="0" cellpadding="0">
|
|
<tbody>
|
|
<tr id="projectrow">
|
|
<td id="projectalign">
|
|
<div id="projectname">Mario Kart 64
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
<!-- end header part -->
|
|
<!-- Generated by Doxygen 1.13.2 -->
|
|
<script type="text/javascript">
|
|
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
|
var searchBox = new SearchBox("searchBox", "search/",'.html');
|
|
/* @license-end */
|
|
</script>
|
|
<script type="text/javascript">
|
|
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
|
$(function() { codefold.init(0); });
|
|
/* @license-end */
|
|
</script>
|
|
<script type="text/javascript" src="menudata.js"></script>
|
|
<script type="text/javascript" src="menu.js"></script>
|
|
<script type="text/javascript">
|
|
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
|
$(function() {
|
|
initMenu('',true,false,'search.php','Search',true);
|
|
$(function() { init_search(); });
|
|
});
|
|
/* @license-end */
|
|
</script>
|
|
<div id="main-nav"></div>
|
|
</div><!-- top -->
|
|
<div id="side-nav" class="ui-resizable side-nav-resizable">
|
|
<div id="nav-tree">
|
|
<div id="nav-tree-contents">
|
|
<div id="nav-sync" class="sync"></div>
|
|
</div>
|
|
</div>
|
|
<div id="splitbar" style="-moz-user-select:none;"
|
|
class="ui-resizable-handle">
|
|
</div>
|
|
</div>
|
|
<script type="text/javascript">
|
|
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
|
$(function(){initNavTree('md_docs_2BUILDING.html',''); initResizable(true); });
|
|
/* @license-end */
|
|
</script>
|
|
<div id="doc-content">
|
|
<!-- window showing the filter options -->
|
|
<div id="MSearchSelectWindow"
|
|
onmouseover="return searchBox.OnSearchSelectShow()"
|
|
onmouseout="return searchBox.OnSearchSelectHide()"
|
|
onkeydown="return searchBox.OnSearchSelectKey(event)">
|
|
</div>
|
|
|
|
<!-- iframe showing the search results (closed by default) -->
|
|
<div id="MSearchResultsWindow">
|
|
<div id="MSearchResults">
|
|
<div class="SRPage">
|
|
<div id="SRIndex">
|
|
<div id="SRResults"></div>
|
|
<div class="SRStatus" id="Loading">Loading...</div>
|
|
<div class="SRStatus" id="Searching">Searching...</div>
|
|
<div class="SRStatus" id="NoMatches">No Matches</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div><div class="header">
|
|
<div class="headertitle"><div class="title">Building SpagettiKart</div></div>
|
|
</div><!--header-->
|
|
<div class="contents">
|
|
<div class="textblock"><p><a class="anchor" id="building-spagettikart"></a></p>
|
|
<h1><a class="anchor" id="windows-1"></a>
|
|
Windows</h1>
|
|
<p>Requires:</p><ul>
|
|
<li>At least 8GB of RAM (machines with 4GB have seen complier failures)</li>
|
|
<li>Visual Studio 2022 Community Edition with the C++ feature set</li>
|
|
<li>One of the Windows SDKs that comes with Visual Studio, for example the current Windows 10 version 10.0.19041.0</li>
|
|
<li>The <code>MSVC v143 - VS 2022 C++ build tools</code> component of Visual Studio</li>
|
|
<li>Python 3 (can be installed manually or as part of Visual Studio)</li>
|
|
<li>Git (can be installed manually or as part of Visual Studio)</li>
|
|
<li>Cmake (can be installed via chocolatey or manually)</li>
|
|
</ul>
|
|
<p>During installation, check the "Desktop development with C++" feature set:</p>
|
|
<p><img src="https://user-images.githubusercontent.com/30329717/183511274-d11aceea-7900-46ec-acb6-3f2cc110021a.png" alt="image" class="inline"/> Doing so should also check one of the Windows SDKs by default. Then, in the installation details in the right-hand column, make sure you also check the v143 toolset. This is often done by default.</p>
|
|
<p>It is recommended that you install Python and Git standalone, the install process in VS Installer has given some issues in the past.</p>
|
|
<ol type="1">
|
|
<li>Clone the Starship repository</li>
|
|
</ol>
|
|
<p><em><a class="el" href="structNote.html">Note</a>: Be sure to either clone with the <code>--recursive</code> flag or do <code>git submodule update --init</code> after cloning to pull in the libultraship submodule!</em></p>
|
|
<ol type="1">
|
|
<li>After setup and initial build, use the built-in OTR extraction to make your mk64.o2r file.</li>
|
|
</ol>
|
|
<p><em><a class="el" href="structNote.html">Note</a>: Instructions assume using powershell</em> </p><div class="fragment"><div class="line"># Navigate to the spaghetti repo within powershell. ie: cd "C:\yourpath\spaghetti"</div>
|
|
<div class="line">cd spaghetti</div>
|
|
<div class="line"> </div>
|
|
<div class="line"># Setup cmake project</div>
|
|
<div class="line"># Add `-DCMAKE_BUILD_TYPE:STRING=Release` if you're packaging</div>
|
|
<div class="line">& 'C:\Program Files\CMake\bin\cmake' -S . -B "build/x64" -G "Visual Studio 17 2022" -T v143 -A x64</div>
|
|
<div class="line"> </div>
|
|
<div class="line"># Generate mk64.o2r and spaghetti.o2r</div>
|
|
<div class="line">& 'C:\Program Files\CMake\bin\cmake.exe' --build .\build\x64 --target ExtractAssets</div>
|
|
<div class="line"># or if you want to generate the spaghetti.o2r file only</div>
|
|
<div class="line">& 'C:\Program Files\CMake\bin\cmake.exe' --build .\build\x64 --target GenerateO2R</div>
|
|
<div class="line"> </div>
|
|
<div class="line"># Compile project</div>
|
|
<div class="line"># Add `--config Release` if you're packaging</div>
|
|
<div class="line">& 'C:\Program Files\CMake\bin\cmake.exe' --build .\build\x64</div>
|
|
<div class="line"> </div>
|
|
<div class="line"># Now you can run the executable in .\build\x64 or run in Visual Studio</div>
|
|
</div><!-- fragment --><h2><a class="anchor" id="developing-spaghettikart"></a>
|
|
Developing SpaghettiKart</h2>
|
|
<p>With the cmake build system you have two options for working on the project:</p>
|
|
<h3><a class="anchor" id="visual-studio"></a>
|
|
Visual Studio</h3>
|
|
<p>To develop using Visual Studio you only need to use cmake to generate the solution file: </p><div class="fragment"><div class="line"># Generates spaghetti.sln at `build/x64` for Visual Studio 2022</div>
|
|
<div class="line">& 'C:\Program Files\CMake\bin\cmake' -S . -B "build/x64" -G "Visual Studio 17 2022" -T v143 -A x64</div>
|
|
</div><!-- fragment --><h3><a class="anchor" id="visual-studio-code-or-another-editor"></a>
|
|
Visual Studio Code or another editor</h3>
|
|
<p>To develop using Visual Studio Code or another editor you only need to open the repository in it. To build you'll need to follow the instructions from the building section.</p>
|
|
<p><em><a class="el" href="structNote.html">Note</a>: If you're using Visual Studio Code, the <a href="https://marketplace.visualstudio.com/items?itemName=ms-vscode.cmake-tools">cpack plugin</a> makes it very easy to just press run and debug.</em></p>
|
|
<p><em>Experimental: You can also use another build system entirely rather than MSVC like <a href="https://ninja-build.org/">Ninja</a> for possibly better performance.</em></p>
|
|
<h2><a class="anchor" id="generating-the-distributable"></a>
|
|
Generating the distributable</h2>
|
|
<p>After compiling the project you can generate the distributable by running: </p><div class="fragment"><div class="line"># Go to build folder</div>
|
|
<div class="line">cd "build/x64"</div>
|
|
<div class="line"># Generate</div>
|
|
<div class="line">& 'C:\Program Files\CMake\bin\cpack.exe' -G ZIP</div>
|
|
</div><!-- fragment --><h2><a class="anchor" id="additional-cmake-targets"></a>
|
|
Additional CMake Targets</h2>
|
|
<h3><a class="anchor" id="clean"></a>
|
|
Clean</h3>
|
|
<div class="fragment"><div class="line"># If you need to clean the project you can run</div>
|
|
<div class="line">C:\Program Files\CMake\bin\cmake.exe --build build-cmake --target clean</div>
|
|
</div><!-- fragment --><h1><a class="anchor" id="linux-1"></a>
|
|
Linux</h1>
|
|
<h2><a class="anchor" id="clone-the-repo-and-enter-the-directory"></a>
|
|
Clone the repo and enter the directory</h2>
|
|
<div class="fragment"><div class="line">git clone https://github.com/HarbourMasters/SpaghettiKart.git</div>
|
|
<div class="line">cd SpaghettiKart</div>
|
|
</div><!-- fragment --><h2><a class="anchor" id="manual"></a>
|
|
Manual</h2>
|
|
<h3><a class="anchor" id="install-dependencies"></a>
|
|
Install dependencies</h3>
|
|
<h4><a class="anchor" id="debianubuntu"></a>
|
|
Debian/Ubuntu</h4>
|
|
<div class="fragment"><div class="line"># using gcc</div>
|
|
<div class="line">apt-get install gcc g++ git cmake ninja-build lsb-release libsdl2-dev libpng-dev libsdl2-net-dev libzip-dev zipcmp zipmerge ziptool nlohmann-json3-dev libtinyxml2-dev libspdlog-dev libboost-dev libopengl-dev libogg-dev libvorbis-dev</div>
|
|
<div class="line"> </div>
|
|
<div class="line"># or using clang</div>
|
|
<div class="line">apt-get install clang git cmake ninja-build lsb-release libsdl2-dev libpng-dev libsdl2-net-dev libzip-dev zipcmp zipmerge ziptool nlohmann-json3-dev libtinyxml2-dev libspdlog-dev libboost-dev libopengl-dev libogg-dev libvorbis-dev</div>
|
|
</div><!-- fragment --> <h4><a class="anchor" id="arch-1"></a>
|
|
Arch</h4>
|
|
<div class="fragment"><div class="line"># using gcc</div>
|
|
<div class="line">pacman -S gcc git cmake ninja lsb-release sdl2 libpng libzip nlohmann-json tinyxml2 spdlog sdl2_net boost libogg libvorbis</div>
|
|
<div class="line"> </div>
|
|
<div class="line"># or using clang</div>
|
|
<div class="line">pacman -S clang git cmake ninja lsb-release sdl2 libpng libzip nlohmann-json tinyxml2 spdlog sdl2_net boost libogg libvorbis</div>
|
|
</div><!-- fragment --> <h4><a class="anchor" id="fedora-1"></a>
|
|
Fedora</h4>
|
|
<div class="fragment"><div class="line"># using gcc</div>
|
|
<div class="line">dnf install gcc gcc-c++ git cmake ninja-build lsb_release SDL2-devel SDL2_net-devel libpng-devel libzip-devel libzip-tools nlohmann-json-devel tinyxml2-devel spdlog-devel boost-devel libogg-devel libvorbis-devel</div>
|
|
<div class="line"> </div>
|
|
<div class="line"># or using clang</div>
|
|
<div class="line">dnf install clang git cmake ninja-build lsb_release SDL2-devel SDL2_net-devel libpng-devel libzip-devel libzip-tools nlohmann-json-devel tinyxml2-devel spdlog-devel boost-devel libogg-devel libvorbis-devel</div>
|
|
</div><!-- fragment --> <h4><a class="anchor" id="opensuse"></a>
|
|
openSUSE</h4>
|
|
<div class="fragment"><div class="line"># using gcc</div>
|
|
<div class="line">zypper in gcc gcc-c++ git cmake ninja SDL2-devel libpng16-devel libzip-devel libzip-tools nlohmann_json-devel tinyxml2-devel spdlog-devel libogg-devel libvorbis-devel</div>
|
|
<div class="line"> </div>
|
|
<div class="line"># or using clang</div>
|
|
<div class="line">zypper in clang libstdc++-devel git cmake ninja SDL2-devel libpng16-devel libzip-devel libzip-tools nlohmann_json-devel tinyxml2-devel spdlog-devel libogg-devel libvorbis-devel</div>
|
|
</div><!-- fragment --><h3><a class="anchor" id="build"></a>
|
|
Build</h3>
|
|
<p><em><a class="el" href="structNote.html">Note</a>: If you're using Visual Studio Code, the <a href="https://marketplace.visualstudio.com/items?itemName=ms-vscode.cmake-tools">CMake Tools plugin</a> makes it very easy to just press run and debug.</em></p>
|
|
<div class="fragment"><div class="line"># Clone the submodules</div>
|
|
<div class="line">git submodule update --init</div>
|
|
<div class="line"> </div>
|
|
<div class="line"># Generate Ninja project</div>
|
|
<div class="line"># Add `-DCMAKE_BUILD_TYPE:STRING=Release` if you're packaging</div>
|
|
<div class="line"># Add `-DPython3_EXECUTABLE=$(which python3)` if you are using non-standard Python installations such as PyEnv</div>
|
|
<div class="line">cmake -H. -Bbuild-cmake -GNinja</div>
|
|
<div class="line"> </div>
|
|
<div class="line"># Generate mk64.o2r and spaghetti.o2r</div>
|
|
<div class="line">cmake --build build-cmake --target ExtractAssets</div>
|
|
<div class="line"># or if you want to generate the spaghetti.o2r file only</div>
|
|
<div class="line">cmake --build build-cmake --target GenerateO2R</div>
|
|
<div class="line"> </div>
|
|
<div class="line"># Compile the project</div>
|
|
<div class="line"># Add `--config Release` if you're packaging</div>
|
|
<div class="line">cmake --build build-cmake</div>
|
|
<div class="line"> </div>
|
|
<div class="line"># Now you can run the executable in ./build-cmake/Spaghettify</div>
|
|
<div class="line"># To develop the project open the repository in VSCode (or your preferred editor)</div>
|
|
<div class="line"> </div>
|
|
<div class="line"># System wide freezes may be due to low memory, add "-j4" to the end of the build command to use four cores.</div>
|
|
</div><!-- fragment --><h2><a class="anchor" id="docker-1"></a>
|
|
Docker</h2>
|
|
<h3><a class="anchor" id="create-the-docker-container"></a>
|
|
Create the docker container</h3>
|
|
<div class="fragment"><div class="line">docker build . -t spaghetti</div>
|
|
</div><!-- fragment --><h3><a class="anchor" id="configure-the-project"></a>
|
|
Configure the project</h3>
|
|
<div class="fragment"><div class="line">docker run --rm -v ${PWD}:/project spaghetti cmake -H. -Bbuild-cmake -GNinja -DCMAKE_BUILD_TYPE=Release</div>
|
|
</div><!-- fragment --><h3><a class="anchor" id="compile-the-project"></a>
|
|
Compile the project</h3>
|
|
<div class="fragment"><div class="line">docker run --rm -v ${PWD}:/project spaghetti cmake --build build-cmake --config Release -j$(nproc)</div>
|
|
</div><!-- fragment --><h2><a class="anchor" id="generate-a-distributable"></a>
|
|
Generate a distributable</h2>
|
|
<p>After compiling the project you can generate a distributable by running of the following: </p><div class="fragment"><div class="line"># Go to build folder</div>
|
|
<div class="line">cd build-cmake</div>
|
|
<div class="line"># Generate</div>
|
|
<div class="line">cpack -G DEB</div>
|
|
<div class="line">cpack -G ZIP</div>
|
|
<div class="line">cpack -G External (creates appimage)</div>
|
|
</div><!-- fragment --><h2><a class="anchor" id="additional-cmake-targets-1"></a>
|
|
Additional CMake Targets</h2>
|
|
<h3><a class="anchor" id="clean-1"></a>
|
|
Clean</h3>
|
|
<div class="fragment"><div class="line"># If you need to clean the project you can run</div>
|
|
<div class="line">cmake --build build-cmake --target clean</div>
|
|
</div><!-- fragment --><h1><a class="anchor" id="macos-1"></a>
|
|
macOS</h1>
|
|
<p>Requires Xcode (or xcode-tools) && <code>sdl2, libpng, glew, ninja, cmake, nlohmann-json, libzip, vorbis-tools, sdl2_net, tinyxml2</code> (can be installed via homebrew, macports, etc)</p>
|
|
<p><b>Important: For maximum performance make sure you have ninja build tools installed!</b></p>
|
|
<p><em><a class="el" href="structNote.html">Note</a>: If you're using Visual Studio Code, the <a href="https://marketplace.visualstudio.com/items?itemName=ms-vscode.cmake-tools">cpack plugin</a> makes it very easy to just press run and debug.</em></p>
|
|
<div class="fragment"><div class="line"># Clone the repo</div>
|
|
<div class="line">git clone https://github.com/HarbourMasters/SpaghettiKart.git</div>
|
|
<div class="line">cd SpaghettiKart</div>
|
|
<div class="line"># Clone the submodule libultraship</div>
|
|
<div class="line">git submodule update --init</div>
|
|
<div class="line"> </div>
|
|
<div class="line"># Generate Ninja project</div>
|
|
<div class="line"># Add `-DCMAKE_BUILD_TYPE:STRING=Release` if you're packaging</div>
|
|
<div class="line">cmake -H. -Bbuild-cmake -GNinja</div>
|
|
<div class="line"> </div>
|
|
<div class="line"># Generate mk64.o2r and spaghetti.o2r</div>
|
|
<div class="line">cmake --build build-cmake --target ExtractAssets</div>
|
|
<div class="line"># or if you want to generate the spaghetti.o2r file only</div>
|
|
<div class="line">cmake --build build-cmake --target GenerateO2R</div>
|
|
<div class="line"> </div>
|
|
<div class="line"># Compile the project</div>
|
|
<div class="line"># Add `--config Release` if you're packaging</div>
|
|
<div class="line">cmake --build build-cmake</div>
|
|
<div class="line"> </div>
|
|
<div class="line"># Now you can run the executable file:</div>
|
|
<div class="line">./build/Spaghettify</div>
|
|
<div class="line"># To develop the project open the repository in VSCode (or your preferred editor)</div>
|
|
</div><!-- fragment --><h2><a class="anchor" id="generating-a-distributable"></a>
|
|
Generating a distributable</h2>
|
|
<p>After compiling the project you can generate a distributable by running of the following: </p><div class="fragment"><div class="line"># Go to build folder</div>
|
|
<div class="line">cd build-cmake</div>
|
|
<div class="line"># Generate</div>
|
|
<div class="line">cpack</div>
|
|
</div><!-- fragment --><h2><a class="anchor" id="additional-cmake-targets-2"></a>
|
|
Additional CMake Targets</h2>
|
|
<h3><a class="anchor" id="clean-2"></a>
|
|
Clean</h3>
|
|
<div class="fragment"><div class="line"># If you need to clean the project you can run</div>
|
|
<div class="line">cmake --build build-cmake --target clean</div>
|
|
</div><!-- fragment --><h1><a class="anchor" id="getting-ci-to-work-on-your-fork"></a>
|
|
Getting CI to work on your fork</h1>
|
|
<p>The CI works via <a href="https://github.com/features/actions">Github Actions</a> where we mostly make use of machines hosted by Github; except for the very first step of the CI process called "Extract assets". This steps extracts assets from the game file and generates an "assets" folder in <code>mm/</code>.</p>
|
|
<p>To get this step working on your fork, you'll need to add a machine to your own repository as a self-hosted runner via "Settings > Actions > Runners" in your repository settings. Make sure to add the 'asset-builder' tag to your newly added runner to assign it to run this step. To setup your runner as a service read the docs <a href="https://docs.github.com/en/actions/hosting-your-own-runners/configuring-the-self-hosted-runner-application-as-a-service?platform=linux">here</a>.</p>
|
|
<h2><a class="anchor" id="runner-on-windows"></a>
|
|
Runner on Windows</h2>
|
|
<p>You'll have to enable the ability to run unsigned scripts through PowerShell. To do this, open Powershell as administrator and run <code>set-executionpolicy remotesigned</code>. Most dependencies get installed as part of the CI process. You will also need to separately install 7z and add it to the PATH so <code>7z</code> can be run as a command. <a href="https://chocolatey.org/">Chocolatey</a> or other package managers can be used to install it easily.</p>
|
|
<h2><a class="anchor" id="runner-on-unix-systems"></a>
|
|
Runner on UNIX systems</h2>
|
|
<p>If you're on macOS or Linux take a look at <code>macports-deps.txt</code> or <code>apt-deps.txt</code> to see the dependencies expected to be on your machine. </p>
|
|
</div></div><!-- contents -->
|
|
</div><!-- PageDoc -->
|
|
</div><!-- doc-content -->
|
|
<!-- start footer part -->
|
|
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
|
<ul>
|
|
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.13.2 </li>
|
|
</ul>
|
|
</div>
|
|
</body>
|
|
</html>
|