chore: Update vcpkg.json and CI workflow for improved platform-specific configurations

- Updated the builtin-baseline in vcpkg.json to '01f602195983451bc83e72f4214af2cbc495aa94' for consistency with the latest vcpkg release.
- Enhanced the CI workflow by separating CMake configuration steps for Windows, macOS, and Linux, improving clarity and error handling.
- Improved error reporting for CMake configuration failures across different platforms, ensuring better diagnostics in CI logs.
This commit is contained in:
scawful
2025-10-09 12:24:27 -04:00
parent 6539f8fb42
commit 2d9a2d11f4
3 changed files with 72 additions and 39 deletions

View File

@@ -194,38 +194,66 @@ jobs:
brew install ninja cmake pkg-config
fi
- name: "Configure"
id: configure
- name: "Configure (Windows)"
if: runner.os == 'Windows'
id: configure_windows
shell: pwsh
run: |
Write-Host "::group::CMake Configuration (Windows)" -ForegroundColor Cyan
$vcpkgToolchain = "${{ github.workspace }}/vcpkg/scripts/buildsystems/vcpkg.cmake" -replace '\\', '/'
Write-Host "Using vcpkg toolchain: $vcpkgToolchain"
cmake -B build -G "Visual Studio 17 2022" -A x64 `
-DCMAKE_BUILD_TYPE=$env:BUILD_TYPE `
-DCMAKE_TOOLCHAIN_FILE="$vcpkgToolchain" `
-DYAZE_BUILD_TESTS=OFF `
-DYAZE_BUILD_EMU=OFF `
-DYAZE_BUILD_Z3ED=ON 2>&1 | Tee-Object -FilePath cmake_config.log
if ($LASTEXITCODE -ne 0) {
Write-Host "::error::CMake configuration failed with exit code $LASTEXITCODE"
exit $LASTEXITCODE
}
Write-Host "::endgroup::"
- name: "Configure (macOS)"
if: runner.os == 'macOS'
id: configure_macos
shell: bash
run: |
set -e
echo "::group::CMake Configuration"
if [[ "${{ runner.os }}" == "Windows" ]]; then
cmake -B build -G "Visual Studio 17 2022" -A x64 \
-DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} \
-DCMAKE_TOOLCHAIN_FILE=${{ github.workspace }}/vcpkg/scripts/buildsystems/vcpkg.cmake \
-DYAZE_BUILD_TESTS=OFF \
-DYAZE_BUILD_EMU=OFF \
-DYAZE_BUILD_Z3ED=ON 2>&1 | tee cmake_config.log
elif [[ "${{ runner.os }}" == "macOS" ]]; then
cmake -B build -G Ninja \
-DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} \
-DCMAKE_OSX_ARCHITECTURES=${{ matrix.mac_arch }} \
-DCMAKE_OSX_DEPLOYMENT_TARGET=11.0 \
-DYAZE_BUILD_TESTS=OFF \
-DYAZE_BUILD_EMU=OFF \
-DYAZE_BUILD_Z3ED=ON 2>&1 | tee cmake_config.log
else
cmake -B build -G Ninja \
-DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} \
-DYAZE_BUILD_TESTS=OFF \
-DYAZE_BUILD_EMU=OFF \
-DYAZE_BUILD_Z3ED=ON 2>&1 | tee cmake_config.log
fi
echo "::group::CMake Configuration (macOS)"
cmake -B build -G Ninja \
-DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} \
-DCMAKE_OSX_ARCHITECTURES=${{ matrix.mac_arch }} \
-DCMAKE_OSX_DEPLOYMENT_TARGET=11.0 \
-DYAZE_BUILD_TESTS=OFF \
-DYAZE_BUILD_EMU=OFF \
-DYAZE_BUILD_Z3ED=ON 2>&1 | tee cmake_config.log
echo "::endgroup::"
- name: "Configure (Linux)"
if: runner.os == 'Linux'
id: configure_linux
shell: bash
run: |
set -e
echo "::group::CMake Configuration (Linux)"
cmake -B build -G Ninja \
-DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} \
-DYAZE_BUILD_TESTS=OFF \
-DYAZE_BUILD_EMU=OFF \
-DYAZE_BUILD_Z3ED=ON 2>&1 | tee cmake_config.log
echo "::endgroup::"
- name: "Report Configure Failure"
if: failure() && steps.configure.outcome == 'failure'
if: |
failure() &&
(steps.configure_windows.outcome == 'failure' ||
steps.configure_macos.outcome == 'failure' ||
steps.configure_linux.outcome == 'failure')
shell: bash
run: |
echo "::error::CMake configuration failed for ${{ matrix.name }}"
@@ -343,7 +371,8 @@ jobs:
echo "" >> $GITHUB_STEP_SUMMARY
echo "### Build Status" >> $GITHUB_STEP_SUMMARY
if [[ "${{ steps.configure.outcome }}" == "success" ]]; then
CONFIGURE_OUTCOME="${{ steps.configure_windows.outcome || steps.configure_macos.outcome || steps.configure_linux.outcome }}"
if [[ "$CONFIGURE_OUTCOME" == "success" ]]; then
echo "- ✅ Configure: Success" >> $GITHUB_STEP_SUMMARY
else
echo "- ❌ Configure: Failed" >> $GITHUB_STEP_SUMMARY

View File

@@ -102,21 +102,21 @@ void PopulateCommonWarpFields(WarpEntry& entry, uint16_t raw_map_id,
absl::StatusOr<int> ParseNumeric(std::string_view value, int base) {
try {
size_t processed = 0;
int result = std::stoi(std::string(value), &processed, base);
if (processed != value.size()) {
return absl::InvalidArgumentError(
absl::StrCat("Invalid numeric value: ", value));
}
return result;
} catch (const std::exception&) {
size_t processed = 0;
int result = std::stoi(std::string(value), &processed, base);
if (processed != value.size()) {
return absl::InvalidArgumentError(
absl::StrCat("Invalid numeric value: ", value));
absl::StrCat("Invalid numeric value: ", std::string(value)));
}
return result;
} catch (const std::exception&) {
return absl::InvalidArgumentError(
absl::StrCat("Invalid numeric value: ", std::string(value)));
}
}
absl::StatusOr<int> ParseWorldSpecifier(std::string_view value) {
std::string lower = absl::AsciiStrToLower(value);
std::string lower = absl::AsciiStrToLower(std::string(value));
if (lower == "0" || lower == "light") {
return 0;
}
@@ -127,7 +127,7 @@ absl::StatusOr<int> ParseWorldSpecifier(std::string_view value) {
return 2;
}
return absl::InvalidArgumentError(
absl::StrCat("Unknown world value: ", value));
absl::StrCat("Unknown world value: ", std::string(value)));
}
absl::StatusOr<int> InferWorldFromMapId(int map_id) {

View File

@@ -3,7 +3,7 @@
"name": "yaze",
"version": "0.3.2",
"description": "Yet Another Zelda3 Editor",
"builtin-baseline": "a42af01b72c28a8e1d7b48107b33e4f286a55ef6",
"builtin-baseline": "01f602195983451bc83e72f4214af2cbc495aa94",
"dependencies": [
{
"name": "sdl2",
@@ -22,6 +22,10 @@
{
"name": "zlib",
"platform": "windows"
},
{
"name": "openssl",
"platform": "windows"
}
],
"overrides": [