From 449a2ebc70d12a7f5c01d6833100435af152ee6c Mon Sep 17 00:00:00 2001 From: Archez Date: Sat, 9 Nov 2024 21:15:10 -0500 Subject: Archive version checking and regeneration (#822) * Add archive version checking and regeneration * update building docs and copy assets for visual studio --- docs/BUILDING.md | 81 ++++++++++++++++++++++++++++++++++---------------------- 1 file changed, 49 insertions(+), 32 deletions(-) (limited to 'docs') diff --git a/docs/BUILDING.md b/docs/BUILDING.md index 8f6c7ec2e..34775cdd2 100644 --- a/docs/BUILDING.md +++ b/docs/BUILDING.md @@ -22,7 +22,7 @@ It is recommended that you install Python and Git standalone, the install proces _Note: Be sure to either clone with the ``--recursive`` flag or do ``git submodule update --init`` after cloning to pull in the libultraship submodule!_ -2. Place one or more [compatible](#compatible-roms) roms in the `OTRExporter` directory with namings of your choice +2. After setup and initial build, use the built-in O2R extraction to make your mm.o2r file. _Note: Instructions assume using powershell_ ```powershell @@ -30,22 +30,17 @@ _Note: Instructions assume using powershell_ cd 2ship2harkinian # Setup cmake project -& 'C:\Program Files\CMake\bin\cmake' -S . -B "build/x64" -G "Visual Studio 17 2022" -T v143 -A x64 # -DCMAKE_BUILD_TYPE:STRING=Release (if you're packaging) -# Extract assets & generate OTR (run this anytime you need to regenerate OTR) -& 'C:\Program Files\CMake\bin\cmake.exe' --build .\build\x64 --target ExtractAssets # --config Release (if you're packaging) -# Compile project -& 'C:\Program Files\CMake\bin\cmake.exe' --build .\build\x64 # --config Release (if you're packaging) - -# Now you can run the executable in .\build\x64 +# Add `-DCMAKE_BUILD_TYPE:STRING=Release` if you're packaging +& 'C:\Program Files\CMake\bin\cmake' -S . -B "build/x64" -G "Visual Studio 17 2022" -T v143 -A x64 -# If you need to clean the project you can run -& 'C:\Program Files\CMake\bin\cmake.exe' --build .\build\x64 --target clean +# Generate 2ship.o2r +& 'C:\Program Files\CMake\bin\cmake.exe' --build .\build\x64 --target Generate2ShipOtr -# If you need to regenerate the asset headers to check them into source -& 'C:\Program Files\CMake\bin\cmake.exe' --build .\build\x64 --target ExtractAssetHeaders +# Compile project +# Add `--config Release` if you're packaging +& 'C:\Program Files\CMake\bin\cmake.exe' --build .\build\x64 -# If you need a newer 2ship.o2r only -& 'C:\Program Files\CMake\bin\cmake.exe' --build .\build\x64 --target Generate2ShipOtr +# Now you can run the executable in .\build\x64 or run in Visual Studio ``` ### Developing 2S2H @@ -76,6 +71,19 @@ cd "build/x64" & 'C:\Program Files\CMake\bin\cpack.exe' -G ZIP ``` +### Additional CMake Targets +#### Clean +```powershell +# If you need to clean the project you can run +C:\Program Files\CMake\bin\cmake.exe --build build-cmake --target clean +``` + +#### Regenerate Asset Headers +```powershell +# If you need to regenerate the asset headers to check them into source +C:\Program Files\CMake\bin\cmake.exe --build build-cmake --target ExtractAssetHeaders +``` + ## Linux ### Install dependencies #### Debian/Ubuntu @@ -124,13 +132,16 @@ cd 2ship2harkinian git submodule update --init # Generate Ninja project -cmake -H. -Bbuild-cmake -GNinja # -DCMAKE_BUILD_TYPE:STRING=Release (if you're packaging) -DPython3_EXECUTABLE=$(which python3) (if you are using non-standard Python installations such as PyEnv) +# Add `-DCMAKE_BUILD_TYPE:STRING=Release` if you're packaging +# Add `-DPython3_EXECUTABLE=$(which python3)` if you are using non-standard Python installations such as PyEnv +cmake -H. -Bbuild-cmake -GNinja # Generate 2ship.o2r cmake --build build-cmake --target Generate2ShipOtr # Compile the project -cmake --build build-cmake # --config Release (if you're packaging) +# Add `--config Release` if you're packaging +cmake --build build-cmake # Now you can run the executable in ./build-cmake/mm/2s2h.elf # To develop the project open the repository in VSCode (or your preferred editor) @@ -157,7 +168,6 @@ cmake --build build-cmake --target clean #### Regenerate Asset Headers ```bash # If you need to regenerate the asset headers to check them into source -cp OTRExporter cmake --build build-cmake --target ExtractAssetHeaders ``` @@ -174,27 +184,21 @@ git clone https://github.com/HarbourMasters/2ship2harkinian.git cd 2ship2harkinian # Clone the submodule libultraship git submodule update --init -# Copy the baserom to the OTRExporter folder -cp OTRExporter + # Generate Ninja project -cmake -H. -Bbuild-cmake -GNinja # -DCMAKE_BUILD_TYPE:STRING=Release (if you're packaging) -# Extract assets & generate OTR (run this anytime you need to regenerate OTR) -cmake --build build-cmake --target ExtractAssets +# Add `-DCMAKE_BUILD_TYPE:STRING=Release` if you're packaging +cmake -H. -Bbuild-cmake -GNinja + +# Generate 2ship.o2r +cmake --build build-cmake --target Generate2ShipOtr + # Compile the project -cmake --build build-cmake # --config Release (if you're packaging) +# Add `--config Release` if you're packaging +cmake --build build-cmake # Now you can run the executable file: ./build-cmake/mm/2s2h-macos # To develop the project open the repository in VSCode (or your preferred editor) - -# If you need to clean the project you can run -cmake --build build-cmake --target clean - -# If you need to regenerate the asset headers to check them into source -cmake --build build-cmake --target ExtractAssetHeaders - -# If you need a newer 2ship.o2r only -cmake --build build-cmake --target Generate2ShipOtr ``` ### Generating a distributable @@ -206,6 +210,19 @@ cd build-cmake cpack ``` +### Additional CMake Targets +#### Clean +```bash +# If you need to clean the project you can run +cmake --build build-cmake --target clean +``` + +#### Regenerate Asset Headers +```bash +# If you need to regenerate the asset headers to check them into source +cmake --build build-cmake --target ExtractAssetHeaders +``` + # Compatible Roms See [`supportedHashes.json`](supportedHashes.json) -- cgit v1.2.3