From e217fdc3ea42c3514092d283cde3953ffefbd939 Mon Sep 17 00:00:00 2001 From: past-due <30942300+past-due@users.noreply.github.com> Date: Tue, 26 Mar 2024 12:28:22 -0400 Subject: [PATCH 01/24] Update quickjs-wz --- 3rdparty/quickjs-wz | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/3rdparty/quickjs-wz b/3rdparty/quickjs-wz index 6b630270b1f..d95a193a065 160000 --- a/3rdparty/quickjs-wz +++ b/3rdparty/quickjs-wz @@ -1 +1 @@ -Subproject commit 6b630270b1f430012ce0aa0a0079b9b618bbaa7d +Subproject commit d95a193a065f40f1c35da04fb57ca96627ff9d23 From aee57c49b0730576ca70869f2ef3673d5ba14202 Mon Sep 17 00:00:00 2001 From: past-due <30942300+past-due@users.noreply.github.com> Date: Tue, 26 Mar 2024 12:29:28 -0400 Subject: [PATCH 02/24] Update fmt to 10.2.1 --- 3rdparty/fmt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/3rdparty/fmt b/3rdparty/fmt index f5e54359df4..e69e5f977d4 160000 --- a/3rdparty/fmt +++ b/3rdparty/fmt @@ -1 +1 @@ -Subproject commit f5e54359df4c26b6230fc61d38aa294581393084 +Subproject commit e69e5f977d458f2650bb346dadf2ad30c5320281 From c17a8ff167bb9893351ff950c8c0a4d6f50551c6 Mon Sep 17 00:00:00 2001 From: past-due <30942300+past-due@users.noreply.github.com> Date: Tue, 26 Mar 2024 12:32:30 -0400 Subject: [PATCH 03/24] Upgrade GLM to 1.0.1+ (latest) --- 3rdparty/glm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/3rdparty/glm b/3rdparty/glm index cc98465e350..4137519418a 160000 --- a/3rdparty/glm +++ b/3rdparty/glm @@ -1 +1 @@ -Subproject commit cc98465e3508535ba8c7f6208df934c156a018dc +Subproject commit 4137519418a933e5863eea7c3ac53890ae7faf9d From 60aaa4b59112792243bbca91dbd4c6b0d3484575 Mon Sep 17 00:00:00 2001 From: past-due <30942300+past-due@users.noreply.github.com> Date: Tue, 26 Mar 2024 12:33:57 -0400 Subject: [PATCH 04/24] [GitHub Actions] Bump actions/cache to v4 --- .github/workflows/CI_windows.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/CI_windows.yml b/.github/workflows/CI_windows.yml index 541947ffe9b..854310ee68a 100644 --- a/.github/workflows/CI_windows.yml +++ b/.github/workflows/CI_windows.yml @@ -462,7 +462,7 @@ jobs: - name: Cache vcpkg dependencies id: vcpkg-cache if: success() && !(github.event_name == 'workflow_run' && github.event.workflow_run.name == 'Draft Tag Release') - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: ${{ steps.settings.outputs.VCPKG_BINARYCACHE_DIR }} key: ${{ runner.os }}-${{ matrix.compiler }}-${{ matrix.architecture }}-${{ steps.settings.outputs.WZ_VISUAL_STUDIO_INSTALL_VERSION }}-${{ hashFiles('**/get-dependencies_win.ps1') }}-${{ hashFiles('**/vcpkg.json') }}-${{ hashFiles('**/.ci/vcpkg/**') }} From 1fb3ed83c003456798a0bf2bfa18f039f28df963 Mon Sep 17 00:00:00 2001 From: past-due <30942300+past-due@users.noreply.github.com> Date: Tue, 26 Mar 2024 12:40:10 -0400 Subject: [PATCH 05/24] [GitHub Actions] macOS: Remove Xcode 11.7 job Relies on macos-11 image, which is deprecated --- .github/workflows/CI_macos.yml | 8 -------- 1 file changed, 8 deletions(-) diff --git a/.github/workflows/CI_macos.yml b/.github/workflows/CI_macos.yml index f9b74c2ef88..409138c98b0 100644 --- a/.github/workflows/CI_macos.yml +++ b/.github/workflows/CI_macos.yml @@ -27,14 +27,6 @@ jobs: strategy: matrix: include: - - name: "Xcode 11.7 (x64)" - image: "macos-11" - osx_target_arch: "x86_64" - vcpkg_triplet: "x64-osx" - xcode_dev_dir: "/Applications/Xcode_11.7.app" - include_videos: false - artifact_suffix: "x64" - publish_artifact: false - name: "Xcode 13.4 (x64)" image: "macos-12" osx_target_arch: "x86_64" From ce877cb08b10d61021de11c484b7316069d3ab24 Mon Sep 17 00:00:00 2001 From: past-due <30942300+past-due@users.noreply.github.com> Date: Tue, 26 Mar 2024 12:40:44 -0400 Subject: [PATCH 06/24] [GitHub Actions] macOS: Update to Xcode 14.3 on macos-13 image --- .github/workflows/CI_macos.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/CI_macos.yml b/.github/workflows/CI_macos.yml index 409138c98b0..69abcf98f59 100644 --- a/.github/workflows/CI_macos.yml +++ b/.github/workflows/CI_macos.yml @@ -27,19 +27,19 @@ jobs: strategy: matrix: include: - - name: "Xcode 13.4 (x64)" - image: "macos-12" + - name: "Xcode 14.3 (x64)" + image: "macos-13" osx_target_arch: "x86_64" vcpkg_triplet: "x64-osx" - xcode_dev_dir: "/Applications/Xcode_13.4.1.app" + xcode_dev_dir: "/Applications/Xcode_14.3.1.app" include_videos: true artifact_suffix: "x64" publish_artifact: true - - name: "Xcode 13.4 (ARM64)" - image: "macos-12" + - name: "Xcode 14.3 (ARM64)" + image: "macos-13" osx_target_arch: "arm64" vcpkg_triplet: "arm64-osx" - xcode_dev_dir: "/Applications/Xcode_13.4.1.app" + xcode_dev_dir: "/Applications/Xcode_14.3.1.app" include_videos: false artifact_suffix: "arm64" publish_artifact: true From d32fdfd13e7174a68cf1fbc49bb16ea854ce3945 Mon Sep 17 00:00:00 2001 From: past-due <30942300+past-due@users.noreply.github.com> Date: Tue, 26 Mar 2024 12:44:45 -0400 Subject: [PATCH 07/24] [GitHub Actions] macOS: Use arm64 as the "base" app bundle --- .github/workflows/CI_macos.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/CI_macos.yml b/.github/workflows/CI_macos.yml index 69abcf98f59..31e841c8570 100644 --- a/.github/workflows/CI_macos.yml +++ b/.github/workflows/CI_macos.yml @@ -32,7 +32,7 @@ jobs: osx_target_arch: "x86_64" vcpkg_triplet: "x64-osx" xcode_dev_dir: "/Applications/Xcode_14.3.1.app" - include_videos: true + include_videos: false artifact_suffix: "x64" publish_artifact: true - name: "Xcode 14.3 (ARM64)" @@ -40,7 +40,7 @@ jobs: osx_target_arch: "arm64" vcpkg_triplet: "arm64-osx" xcode_dev_dir: "/Applications/Xcode_14.3.1.app" - include_videos: false + include_videos: true artifact_suffix: "arm64" publish_artifact: true fail-fast: false @@ -244,16 +244,16 @@ jobs: - name: Create Universal Binary working-directory: ./dl-artifacts run: | - BASE_APP_BUNDLE="warzone2100_macOS_x64/Warzone 2100.app" + BASE_APP_BUNDLE="warzone2100_macOS_arm64/Warzone 2100.app" # extract entitlements plist from the "base" app bundle binary echo "Extract entitlements.plist" codesign -d --entitlements :- "${BASE_APP_BUNDLE}/Contents/MacOS/Warzone 2100" > "entitlements.plist" cat "entitlements.plist" echo "-----------------------------------" echo "Make universal binary + app package" - ../src/macosx/BuildBot/make_universal.sh "${BASE_APP_BUNDLE}" "warzone2100_macOS_arm64/Warzone 2100.app" + ../src/macosx/BuildBot/make_universal.sh "${BASE_APP_BUNDLE}" "warzone2100_macOS_x64/Warzone 2100.app" # Rename the "base" app package directory - mv "warzone2100_macOS_x64" "warzone2100_macOS_universal" + mv "warzone2100_macOS_arm64" "warzone2100_macOS_universal" echo "Re-code-sign" codesign --force --options runtime --entitlements "entitlements.plist" -s - "warzone2100_macOS_universal/Warzone 2100.app" # Zip and copy to build dir From 42922d4dff27a3ee059655a4a18792c24686784e Mon Sep 17 00:00:00 2001 From: past-due <30942300+past-due@users.noreply.github.com> Date: Tue, 26 Mar 2024 12:56:47 -0400 Subject: [PATCH 08/24] [macOS] Update vcpkg commit in configure_mac.cmake --- configure_mac.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure_mac.cmake b/configure_mac.cmake index 6480d4163fb..cea4e65a08e 100644 --- a/configure_mac.cmake +++ b/configure_mac.cmake @@ -11,7 +11,7 @@ cmake_minimum_required(VERSION 3.5) ######################################################## # To ensure reproducible builds, pin to a specific vcpkg commit -set(VCPKG_COMMIT_SHA "11e79b1072c7f12d84258b77948cda3b166aac59") +set(VCPKG_COMMIT_SHA "9de2e978bdfec6bb7852cc1d6ecf375c923c485c") # WZ minimum supported macOS deployment target (< 10.9 is untested) set(MIN_SUPPORTED_MACOSX_DEPLOYMENT_TARGET "10.9") From 211d1673b508acf5e36aaf34f2da795491374d02 Mon Sep 17 00:00:00 2001 From: past-due <30942300+past-due@users.noreply.github.com> Date: Tue, 26 Mar 2024 12:57:03 -0400 Subject: [PATCH 09/24] [Windows] Update vcpkg commit in get-dependencies_win.ps1 --- get-dependencies_win.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/get-dependencies_win.ps1 b/get-dependencies_win.ps1 index 4afd1171951..a624d94ebc9 100755 --- a/get-dependencies_win.ps1 +++ b/get-dependencies_win.ps1 @@ -5,7 +5,7 @@ param([string]$VCPKG_BUILD_TYPE = "") ############################ # To ensure reproducible builds, pin to a specific vcpkg commit -$VCPKG_COMMIT_SHA = "11e79b1072c7f12d84258b77948cda3b166aac59"; +$VCPKG_COMMIT_SHA = "9de2e978bdfec6bb7852cc1d6ecf375c923c485c"; # WZ Windows features (for vcpkg install) $VCPKG_INSTALL_FEATURES = @() From 9ef9e9672f9e95017fd61b53a2e1139603b66385 Mon Sep 17 00:00:00 2001 From: past-due <30942300+past-due@users.noreply.github.com> Date: Tue, 26 Mar 2024 12:57:19 -0400 Subject: [PATCH 10/24] vcpkg.json: Update builtin-baseline --- vcpkg.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vcpkg.json b/vcpkg.json index fc45fc6bcfa..805e8078d61 100644 --- a/vcpkg.json +++ b/vcpkg.json @@ -1,7 +1,7 @@ { "name": "warzone2100", "version-string": "master-branch", - "builtin-baseline": "11e79b1072c7f12d84258b77948cda3b166aac59", + "builtin-baseline": "9de2e978bdfec6bb7852cc1d6ecf375c923c485c", "dependencies": [ "physfs", "sdl2", From 0f26dfa0adecbb82551e7f9f46d9b9609631b122 Mon Sep 17 00:00:00 2001 From: past-due <30942300+past-due@users.noreply.github.com> Date: Tue, 26 Mar 2024 13:13:33 -0400 Subject: [PATCH 11/24] [GitHub Actions] macOS: Prevent Homebrew from auto-updating --- .github/workflows/CI_macos.yml | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/.github/workflows/CI_macos.yml b/.github/workflows/CI_macos.yml index 31e841c8570..3645285a8d8 100644 --- a/.github/workflows/CI_macos.yml +++ b/.github/workflows/CI_macos.yml @@ -77,13 +77,18 @@ jobs: working-directory: ./src run: git submodule update --init --recursive - name: Install Pre-reqs + env: + HOMEBREW_NO_AUTO_UPDATE: 1 run: | - brew install gettext + echo "::group::brew install" + brew install gettext pkg-config + echo "::endgroup::" + # NOTE: Specify an explicit Asciidoctor version to help ensure reproducible builds + echo "::group::gem install asciidoctor" gem install asciidoctor -v 2.0.16 --no-document + echo "::endgroup::" - #brew update - brew install pkg-config #if (brew outdated | grep cmake > /dev/null); then echo "upgrading CMake"; brew upgrade cmake; fi cmake --version - name: Prep Environment From ae28874d5323c2b34a8e678fd6721f9beca38c07 Mon Sep 17 00:00:00 2001 From: past-due <30942300+past-due@users.noreply.github.com> Date: Tue, 26 Mar 2024 13:15:30 -0400 Subject: [PATCH 12/24] [CI] Update to Asciidoctor 2.0.22 --- .cirrus.yml | 2 +- .github/workflows/CI_macos.yml | 2 +- .github/workflows/CI_windows.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.cirrus.yml b/.cirrus.yml index cb526ae9724..fb65af07990 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -44,7 +44,7 @@ freebsd_build_task: # - brew install cmake # - brew install gettext # # NOTE: Specify an explicit Asciidoctor version to help ensure reproducible builds -# - sudo gem install asciidoctor -v 2.0.16 --no-document +# - sudo gem install asciidoctor -v 2.0.22 --no-document # # gcc6+ is currently required to bootstrap vcpkg on macOS # - brew install gcc@7 # - sudo bundle install --gemfile="macosx/BuildBot/Gemfile" diff --git a/.github/workflows/CI_macos.yml b/.github/workflows/CI_macos.yml index 3645285a8d8..89e533dbb5b 100644 --- a/.github/workflows/CI_macos.yml +++ b/.github/workflows/CI_macos.yml @@ -86,7 +86,7 @@ jobs: # NOTE: Specify an explicit Asciidoctor version to help ensure reproducible builds echo "::group::gem install asciidoctor" - gem install asciidoctor -v 2.0.16 --no-document + gem install asciidoctor -v 2.0.22 --no-document echo "::endgroup::" #if (brew outdated | grep cmake > /dev/null); then echo "upgrading CMake"; brew upgrade cmake; fi diff --git a/.github/workflows/CI_windows.yml b/.github/workflows/CI_windows.yml index 854310ee68a..cf3b3b27db8 100644 --- a/.github/workflows/CI_windows.yml +++ b/.github/workflows/CI_windows.yml @@ -103,7 +103,7 @@ jobs: id: asciidoctor-dl run: | echo "Installing Asciidoctor" - gem install asciidoctor -v 2.0.16 --no-document | Out-Null + gem install asciidoctor -v 2.0.22 --no-document | Out-Null echo "Installing Asciidoctor... finished" $AsciidoctorBat = (Get-Command asciidoctor.bat).Path echo "Asciidoctor.bat: ${AsciidoctorBat}" From 0fea937d4ddc72dc2c12efaab4355779b10c5f32 Mon Sep 17 00:00:00 2001 From: past-due <30942300+past-due@users.noreply.github.com> Date: Tue, 26 Mar 2024 14:09:23 -0400 Subject: [PATCH 13/24] [CMake] Fix FindSodium.cmake for new vcpkg port setup --- cmake/FindSodium.cmake | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/cmake/FindSodium.cmake b/cmake/FindSodium.cmake index 79f12992266..bd35442441d 100644 --- a/cmake/FindSodium.cmake +++ b/cmake/FindSodium.cmake @@ -10,12 +10,26 @@ include(FindPackageHandleStandardArgs) +function(GetSodiumVersion sodium_INCLUDE_DIR) + if(sodium_INCLUDE_DIR AND EXISTS "${sodium_INCLUDE_DIR}/sodium/version.h") + file(STRINGS "${sodium_INCLUDE_DIR}/sodium/version.h" SODIUM_VERSION_STRING_LINE REGEX "^#define[ \t]+SODIUM_VERSION_STRING[ \t]+\"[.0-9]+\"$") + string(REGEX REPLACE "^#define[ \t]+SODIUM_VERSION_STRING[ \t]+\"([.0-9]+)\"$" "\\1" sodium_VERSION "${SODIUM_VERSION_STRING_LINE}") + unset(SODIUM_VERSION_STRING_LINE) + else() + if (sodium_INCLUDE_DIR) + message ( WARNING "Can't find ${sodium_INCLUDE_DIR}/sodium/version.h" ) + endif() + set(sodium_VERSION "") + endif() + set(sodium_VERSION "${sodium_VERSION}" PARENT_SCOPE) +endfunction() + if (VCPKG_TOOLCHAIN) find_package(unofficial-sodium CONFIG) # If we found the vcpkg unofficial-sodium configuration, return with that result if(unofficial-sodium_FOUND AND TARGET unofficial-sodium::sodium) - set(sodium_VERSION "${unofficial-sodium_VERSION}") get_target_property(sodium_INCLUDE_DIR unofficial-sodium::sodium INTERFACE_INCLUDE_DIRECTORIES) + GetSodiumVersion("${sodium_INCLUDE_DIR}") find_package_handle_standard_args(${CMAKE_FIND_PACKAGE_NAME} REQUIRED_VARS sodium_INCLUDE_DIR VERSION_VAR sodium_VERSION) message(STATUS "Using vcpkg unofficial-sodium configuration (${sodium_VERSION})") return() @@ -52,16 +66,7 @@ FIND_LIBRARY( HINTS ${PCFG_SODIUM_LIBRARY_DIRS} ${PCFG_SODIUM_LIBDIR} ) -if(sodium_INCLUDE_DIR AND EXISTS "${sodium_INCLUDE_DIR}/sodium/version.h") - file(STRINGS "${sodium_INCLUDE_DIR}/sodium/version.h" SODIUM_VERSION_STRING_LINE REGEX "^#define[ \t]+SODIUM_VERSION_STRING[ \t]+\"[.0-9]+\"$") - string(REGEX REPLACE "^#define[ \t]+SODIUM_VERSION_STRING[ \t]+\"([.0-9]+)\"$" "\\1" sodium_VERSION "${SODIUM_VERSION_STRING_LINE}") - unset(SODIUM_VERSION_STRING_LINE) -else() - if (sodium_INCLUDE_DIR) - message ( WARNING "Can't find ${sodium_INCLUDE_DIR}/sodium/version.h" ) - endif() - set(sodium_VERSION "") -endif() +GetSodiumVersion("${sodium_INCLUDE_DIR}") find_package_handle_standard_args(${CMAKE_FIND_PACKAGE_NAME} REQUIRED_VARS sodium_INCLUDE_DIR sodium_LIBRARIES VERSION_VAR sodium_VERSION) From eea3a57a488b032f5dcaa47677eab331636ff50a Mon Sep 17 00:00:00 2001 From: past-due <30942300+past-due@users.noreply.github.com> Date: Tue, 26 Mar 2024 14:11:59 -0400 Subject: [PATCH 14/24] [GitHub Actions] macOS: Prevent Homebrew from auto-upgrading on install --- .github/workflows/CI_macos.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/CI_macos.yml b/.github/workflows/CI_macos.yml index 89e533dbb5b..f33b266534e 100644 --- a/.github/workflows/CI_macos.yml +++ b/.github/workflows/CI_macos.yml @@ -79,6 +79,7 @@ jobs: - name: Install Pre-reqs env: HOMEBREW_NO_AUTO_UPDATE: 1 + HOMEBREW_NO_INSTALL_UPGRADE: 1 run: | echo "::group::brew install" brew install gettext pkg-config From 32eae57d2c60c388ce7dcaf04300f9e982c1ca3d Mon Sep 17 00:00:00 2001 From: past-due <30942300+past-due@users.noreply.github.com> Date: Tue, 26 Mar 2024 14:41:28 -0400 Subject: [PATCH 15/24] [GitHub Actions] macOS: brew install automake To get the full bits of autoconf, for use by certain vcpkg ports --- .github/workflows/CI_macos.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/CI_macos.yml b/.github/workflows/CI_macos.yml index f33b266534e..2d48b430c9e 100644 --- a/.github/workflows/CI_macos.yml +++ b/.github/workflows/CI_macos.yml @@ -82,7 +82,7 @@ jobs: HOMEBREW_NO_INSTALL_UPGRADE: 1 run: | echo "::group::brew install" - brew install gettext pkg-config + brew install automake gettext pkg-config echo "::endgroup::" # NOTE: Specify an explicit Asciidoctor version to help ensure reproducible builds From 7a40555fbdf838fdfbb2474ba2812e713066eaba Mon Sep 17 00:00:00 2001 From: past-due <30942300+past-due@users.noreply.github.com> Date: Tue, 26 Mar 2024 14:42:46 -0400 Subject: [PATCH 16/24] Update macosx/README.md --- macosx/README.md | 45 +++++++++++++++++++++++++-------------------- 1 file changed, 25 insertions(+), 20 deletions(-) diff --git a/macosx/README.md b/macosx/README.md index a82df7cf49a..544ccfcb576 100644 --- a/macosx/README.md +++ b/macosx/README.md @@ -4,24 +4,24 @@ > For convenience, you will probably want either [Homebrew](https://brew.sh) or [Macports](https://www.macports.org/install.php) installed for setting up certain prerequisites. If you don't have either yet, **Homebrew** is recommended. -| Building on macOS 10.12-10.14 | Building on macOS 10.15+ | -| -------------------------------| ------------------------- | -| Xcode 8 / 9 / 10 | Xcode 11+ | -| CMake 3.14.1+ | CMake 3.15+ | -| Gettext | Gettext | -| Asciidoctor | Asciidoctor | -| GCC 7+* | | +1. **macOS 13+** + - While building may work on prior versions of macOS, CI only tests on macOS 13+. -1. **macOS 10.12+** - - While building may work on prior versions of macOS, it is only tested on macOS 10.12+. +2. **Xcode 14+** (tested w/: Xcode 14.x) + - If you do not have Xcode 14.3.1+ you can get it for free at the [Mac App Store](https://itunes.apple.com/us/app/xcode/id497799835?mt=12) or [Apple's website](http://developer.apple.com/technology/xcode.html). + - Earlier versions of Xcode may work, but are not tested by CI. -2. **Xcode 8+** (tested w/: Xcode 8.3 - Xcode 11.x) - - If you do not have Xcode 8.3+ you can get it for free at the [Mac App Store](https://itunes.apple.com/us/app/xcode/id497799835?mt=12) or [Apple's website](http://developer.apple.com/technology/xcode.html). +3. **CMake 3.24+** (required to generate the Xcode project) + - If you do not have CMake 3.24+, you can [download the latest stable version for free at CMake.org](https://cmake.org/download/#latest). -3. **CMake 3.14.1+** (required to generate the Xcode project) - - If you do not have CMake 3.14+, you can [download the latest stable version for free at CMake.org](https://cmake.org/download/#latest). +4. **Autoconf** (required to compile some vcpkg ports) + - If you have [Homebrew](https://brew.sh) installed, you can use the following command in Terminal: + ```shell + brew install automake + ``` + > See https://github.com/Homebrew/homebrew-core/issues/21125 for why the `automake` package must be installed instead of `autoconf` -4. **Gettext** (required to compile the translations and language files) +5. **Gettext** (required to compile the translations and language files) - If you have [Homebrew](https://brew.sh) installed, you can use the following command in Terminal: ```shell brew install gettext @@ -32,7 +32,7 @@ sudo port install gettext ``` -5. **Asciidoctor** (required to build the documentation / help files) +6. **Asciidoctor** (required to build the documentation / help files) - If you have [Homebrew](https://brew.sh) installed, you can use the following command in Terminal: ```shell brew install asciidoctor @@ -47,11 +47,16 @@ ``` > Depending on system configuration, `sudo gem install` may be required. -6. **GCC** (\*currently required to build vcpkg on macOS < 10.15, and with Xcode < 11) - - If you have [Homebrew](https://brew.sh) installed, you can use the following command in Terminal: - ```shell - brew install gcc - ``` +## Tips for Compiling on earlier macOS / Xcode: + +> [!NOTE] +> Since Xcode supports targeting older versions of macOS as a minimum deployment target, we recommend building with versions of macOS + Xcode that match the recommendations above (or newer). + +While CI does not test these combinations, WZ's CMake buildsystem previously compiled with: +- Xcode 11+ on macOS 10.15 +- Xcode 8 / 9 / 10 on macOS 10.12-10.14 + +> However, this is not tested - just a guideline if you want to try something unsupported. ## Setup & Configuration: From 46abf59cf58ee029ebe6b88a686e7a5bd87a4532 Mon Sep 17 00:00:00 2001 From: past-due <30942300+past-due@users.noreply.github.com> Date: Tue, 26 Mar 2024 14:49:59 -0400 Subject: [PATCH 17/24] [GitHub Actions] Windows: Upload additional failure logs --- .github/workflows/CI_windows.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/CI_windows.yml b/.github/workflows/CI_windows.yml index cf3b3b27db8..e7bdd2357c9 100644 --- a/.github/workflows/CI_windows.yml +++ b/.github/workflows/CI_windows.yml @@ -554,7 +554,9 @@ jobs: if: failure() with: name: win_${{ matrix.architecture }}_vcpkg_logs - path: '${{ github.workspace }}\build\vcpkg\buildtrees\*\*-out.log' + path: | + ${{ github.workspace }}\build\vcpkg\buildtrees\*\*.log + ${{ github.workspace }}\build\vcpkg\buildtrees\*\*.txt if-no-files-found: 'warn' retention-days: 1 - name: CMake Build (MSVC) From 01372903337d0096cd331e4f99b3d359ac8b9ba6 Mon Sep 17 00:00:00 2001 From: past-due <30942300+past-due@users.noreply.github.com> Date: Tue, 26 Mar 2024 15:27:14 -0400 Subject: [PATCH 18/24] Add libsodium vcpkg overlay-port - Fixes Emscripten - Update to latest 1.0.19-stable commit to fix ARM64 and other compilation issues --- .../overlay-ports/libsodium/portfile.cmake | 78 +++++++++++++++++++ .../libsodium/sodiumConfig.cmake.in | 32 ++++++++ .ci/vcpkg/overlay-ports/libsodium/vcpkg.json | 14 ++++ 3 files changed, 124 insertions(+) create mode 100644 .ci/vcpkg/overlay-ports/libsodium/portfile.cmake create mode 100644 .ci/vcpkg/overlay-ports/libsodium/sodiumConfig.cmake.in create mode 100644 .ci/vcpkg/overlay-ports/libsodium/vcpkg.json diff --git a/.ci/vcpkg/overlay-ports/libsodium/portfile.cmake b/.ci/vcpkg/overlay-ports/libsodium/portfile.cmake new file mode 100644 index 00000000000..fc1b3367432 --- /dev/null +++ b/.ci/vcpkg/overlay-ports/libsodium/portfile.cmake @@ -0,0 +1,78 @@ +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO jedisct1/libsodium + REF 73248a4972336f411f688864eb6b086d215122fc # latest commit on: 1.0.19-stable branch as of 2024-03-24 + SHA512 b9bf37017e4a1deb0f5cbf9955c2bee6925fed57ed173be9bb58e7a00439038772559f4cbe36d1fb40107b9afd9a9b5a4302ab83630b4740f2ffeab4f03ed671 + HEAD_REF master +) + +if(VCPKG_TARGET_IS_WINDOWS AND NOT VCPKG_TARGET_IS_MINGW) + set(lib_linkage "LIB") + if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic") + set(lib_linkage "DLL") + endif() + + set(LIBSODIUM_PROJECT_SUBPATH "builds/msvc/vs2022/libsodium/libsodium.vcxproj" CACHE STRING "Triplet variable") + + vcpkg_msbuild_install( + SOURCE_PATH "${SOURCE_PATH}" + PROJECT_SUBPATH "${LIBSODIUM_PROJECT_SUBPATH}" + RELEASE_CONFIGURATION "Release${lib_linkage}" + DEBUG_CONFIGURATION "Debug${lib_linkage}" + ) + + file(INSTALL "${SOURCE_PATH}/src/libsodium/include/sodium.h" "${SOURCE_PATH}/src/libsodium/include/sodium" DESTINATION "${CURRENT_PACKAGES_DIR}/include") + file(INSTALL "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/src/libsodium/include/sodium/version.h" DESTINATION "${CURRENT_PACKAGES_DIR}/include/sodium") + file(REMOVE "${CURRENT_PACKAGES_DIR}/include/Makefile.am" "${CURRENT_PACKAGES_DIR}/include/sodium/version.h.in") + + block(SCOPE_FOR VARIABLES) + set(PACKAGE_NAME "libsodium") + set(PACKAGE_VERSION "${VERSION}") + set(prefix [[unused]]) + set(exec_prefix [[${prefix}]]) + set(includedir [[${prefix}/include]]) + set(libdir [[${prefix}/lib]]) + set(PKGCONFIG_LIBS_PRIVATE "") + configure_file("${SOURCE_PATH}/libsodium.pc.in" "${CURRENT_PACKAGES_DIR}/lib/pkgconfig/libsodium.pc" @ONLY) + vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/lib/pkgconfig/libsodium.pc" " -lsodium" " -llibsodium") + if(NOT VCPKG_BUILD_TYPE) + set(includedir [[${prefix}/../include]]) + configure_file("${SOURCE_PATH}/libsodium.pc.in" "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/libsodium.pc" @ONLY) + vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/libsodium.pc" " -lsodium" " -llibsodium") + endif() + endblock() +else() + + vcpkg_list(SET options) + if(VCPKG_TARGET_IS_EMSCRIPTEN) + vcpkg_list(APPEND options "--disable-ssp" "--disable-asm") + endif() + + vcpkg_configure_make( + AUTOCONFIG + SOURCE_PATH "${SOURCE_PATH}" + OPTIONS + ${options} + ) + vcpkg_install_make() + + file(REMOVE_RECURSE + "${CURRENT_PACKAGES_DIR}/debug/include" + "${CURRENT_PACKAGES_DIR}/debug/share" + ) +endif() + +vcpkg_fixup_pkgconfig() + +if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") + vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/sodium/export.h" "#ifdef SODIUM_STATIC" "#if 1") +endif() + +# vcpkg legacy +configure_file( + "${CMAKE_CURRENT_LIST_DIR}/sodiumConfig.cmake.in" + "${CURRENT_PACKAGES_DIR}/share/unofficial-sodium/unofficial-sodiumConfig.cmake" + @ONLY +) + +vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE") diff --git a/.ci/vcpkg/overlay-ports/libsodium/sodiumConfig.cmake.in b/.ci/vcpkg/overlay-ports/libsodium/sodiumConfig.cmake.in new file mode 100644 index 00000000000..f6d21a2d05e --- /dev/null +++ b/.ci/vcpkg/overlay-ports/libsodium/sodiumConfig.cmake.in @@ -0,0 +1,32 @@ + +if("@VCPKG_LIBRARY_LINKAGE@" STREQUAL "static" AND NOT WIN32) + include(CMakeFindDependencyMacro) + find_dependency(Threads) +endif() + +if(NOT TARGET unofficial-sodium::sodium) + add_library(unofficial-sodium::sodium UNKNOWN IMPORTED) + + set_target_properties(unofficial-sodium::sodium PROPERTIES + INTERFACE_INCLUDE_DIRECTORIES "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/include" + IMPORTED_LINK_INTERFACE_LANGUAGES "C" + ) + + if("@VCPKG_LIBRARY_LINKAGE@" STREQUAL "static" AND NOT WIN32) + set_target_properties(unofficial-sodium::sodium PROPERTIES + INTERFACE_LINK_LIBRARIES Threads::Threads + ) + endif() + + find_library(VCPKG_SODIUM_LIBRARY_RELEASE NAMES sodium libsodium PATHS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/lib" NO_DEFAULT_PATH) + if(EXISTS "${VCPKG_SODIUM_LIBRARY_RELEASE}") + set_property(TARGET unofficial-sodium::sodium APPEND PROPERTY IMPORTED_CONFIGURATIONS "Release") + set_target_properties(unofficial-sodium::sodium PROPERTIES IMPORTED_LOCATION_RELEASE "${VCPKG_SODIUM_LIBRARY_RELEASE}") + endif() + + find_library(VCPKG_SODIUM_LIBRARY_DEBUG NAMES sodium libsodium PATHS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/debug/lib" NO_DEFAULT_PATH) + if(EXISTS "${VCPKG_SODIUM_LIBRARY_DEBUG}") + set_property(TARGET unofficial-sodium::sodium APPEND PROPERTY IMPORTED_CONFIGURATIONS "Debug") + set_target_properties(unofficial-sodium::sodium PROPERTIES IMPORTED_LOCATION_DEBUG "${VCPKG_SODIUM_LIBRARY_DEBUG}") + endif() +endif() diff --git a/.ci/vcpkg/overlay-ports/libsodium/vcpkg.json b/.ci/vcpkg/overlay-ports/libsodium/vcpkg.json new file mode 100644 index 00000000000..ff1b6ecc8fc --- /dev/null +++ b/.ci/vcpkg/overlay-ports/libsodium/vcpkg.json @@ -0,0 +1,14 @@ +{ + "name": "libsodium", + "version": "1.0.19-stable", + "description": "A modern and easy-to-use crypto library", + "homepage": "https://libsodium.org/", + "license": "ISC", + "dependencies": [ + { + "name": "vcpkg-msbuild", + "host": true, + "platform": "windows & !mingw" + } + ] +} From 8b9701fb9ed19796f7d45482c6d4220d16af90a9 Mon Sep 17 00:00:00 2001 From: past-due <30942300+past-due@users.noreply.github.com> Date: Tue, 26 Mar 2024 15:36:46 -0400 Subject: [PATCH 19/24] [CMake] Log additional libzip details --- lib/wzmaplib/CMakeLists.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/wzmaplib/CMakeLists.txt b/lib/wzmaplib/CMakeLists.txt index 838dfbe8844..2189e561e42 100644 --- a/lib/wzmaplib/CMakeLists.txt +++ b/lib/wzmaplib/CMakeLists.txt @@ -158,6 +158,8 @@ if (libzip_FOUND) cmake_pop_check_state() if(libzip_LINK_TEST) message( STATUS "Found libzip... (link test successful)" ) + get_target_property(_libzip_INCLUDE_DIR libzip::zip INTERFACE_INCLUDE_DIRECTORIES) + message( STATUS "- libzip include dir: ${_libzip_INCLUDE_DIR}" ) else() message( STATUS "Found libzip, but link test NOT successful" ) endif() From 3af0641e9462eb27a1eaf92bad9945aa1ab95c64 Mon Sep 17 00:00:00 2001 From: past-due <30942300+past-due@users.noreply.github.com> Date: Tue, 26 Mar 2024 15:38:46 -0400 Subject: [PATCH 20/24] [GitHub Actions] macOS: Update minimum deployment target Only 10.13+ is supported by Xcode 14 --- .github/workflows/CI_macos.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/CI_macos.yml b/.github/workflows/CI_macos.yml index 2d48b430c9e..37f07963f0a 100644 --- a/.github/workflows/CI_macos.yml +++ b/.github/workflows/CI_macos.yml @@ -50,7 +50,7 @@ jobs: runs-on: '${{ matrix.image }}' if: "!contains(github.event.head_commit.message, '[ci skip]')" env: - MACOSX_DEPLOYMENT_TARGET: '10.9' + MACOSX_DEPLOYMENT_TARGET: '10.13' VSCMD_SKIP_SENDTELEMETRY: 1 DESIRED_XCODE_DEV_DIR: '${{ matrix.xcode_dev_dir }}' WZ_INCLUDE_VIDEOS: '${{ matrix.include_videos }}' From 5ed15648025ac265bd42490aa4e3f6915f4d2a21 Mon Sep 17 00:00:00 2001 From: past-due <30942300+past-due@users.noreply.github.com> Date: Tue, 26 Mar 2024 16:27:21 -0400 Subject: [PATCH 21/24] [GitHub Actions] Windows: Update to llvm-mingw 20231128 with LLVM 17.0.6 --- .github/workflows/CI_windows.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/CI_windows.yml b/.github/workflows/CI_windows.yml index e7bdd2357c9..fb246b933c2 100644 --- a/.github/workflows/CI_windows.yml +++ b/.github/workflows/CI_windows.yml @@ -399,10 +399,10 @@ jobs: $VerbosePreference = "Continue" . "${env:WZ_REPO_PATH}\.ci\powershell\request.ps1" - $LLVM_MINGW_RELEASE = "20231031"; + $LLVM_MINGW_RELEASE = "20231128"; $LLVM_MINGW_PKG = "llvm-mingw-${LLVM_MINGW_RELEASE}-ucrt-x86_64" $LLVM_MINGW_DL_URL = "https://github.com/mstorsjo/llvm-mingw/releases/download/${LLVM_MINGW_RELEASE}/${LLVM_MINGW_PKG}.zip" - $LLVM_MINGW_DL_SHA512 = "3173b7a9b7836adce0fa5a59b13a01fa7707d1fc5be27606e779cca853b4452571ab37a1d5d6b3fd2ca067f58aa6011b121ba4f29b9b0eaaa1de2679d6b55af9" + $LLVM_MINGW_DL_SHA512 = "86e99cce855bf01d75032fe282986976b53e5a71f52a80b00e92906db462426515fbe2764465afa4f5a67b6abc4325c7a21d0eb59845be615890ef2560f1ec37" $LLVM_MINGW_DL_BASEDIR = "${{ github.workspace }}\dl" $LLVM_MINGW_DL_PATH = "${LLVM_MINGW_DL_BASEDIR}\llvm-mingw.zip" From 9c8850778ad7b33f760b158292404cded6e3a078 Mon Sep 17 00:00:00 2001 From: past-due <30942300+past-due@users.noreply.github.com> Date: Tue, 26 Mar 2024 16:37:59 -0400 Subject: [PATCH 22/24] [macOS] configure_mac.cmake: Prevent finding libraries in certain paths --- configure_mac.cmake | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/configure_mac.cmake b/configure_mac.cmake index cea4e65a08e..f37dd0880b1 100644 --- a/configure_mac.cmake +++ b/configure_mac.cmake @@ -347,22 +347,26 @@ execute_process(COMMAND ${CMAKE_COMMAND} -E echo "++ vcpkg install finished") # 3.) CMake configure (generate Xcode project) set(_additional_configure_arguments "") -if(DEFINED WZ_DISTRIBUTOR) - set(_additional_configure_arguments "\"-DWZ_DISTRIBUTOR:STRING=${WZ_DISTRIBUTOR}\"") +if(NOT DEFINED WZ_DISTRIBUTOR) + set(WZ_DISTRIBUTOR "UNKNOWN") endif() +list(APPEND _additional_configure_arguments "-DCMAKE_FIND_USE_CMAKE_SYSTEM_PATH=FALSE" "-DCMAKE_FIND_USE_INSTALL_PREFIX=FALSE" "-DCMAKE_FIND_USE_PACKAGE_REGISTRY=FALSE" "-DCMAKE_FIND_USE_SYSTEM_PACKAGE_REGISTRY=FALSE") if(DEFINED ADDITIONAL_CMAKE_ARGUMENTS) list(APPEND _additional_configure_arguments ${ADDITIONAL_CMAKE_ARGUMENTS}) endif() execute_process(COMMAND ${CMAKE_COMMAND} -E echo "+++++++++++++++++++++++++++++++++++++++++++++++++++++++++") execute_process(COMMAND ${CMAKE_COMMAND} -E echo "++ Running CMake configure (to generate Xcode project)...") +string(REPLACE ";" " " _debug_output_args "${_additional_configure_arguments}") +execute_process(COMMAND ${CMAKE_COMMAND} -E echo "++ ${CMAKE_COMMAND} \"-DCMAKE_TOOLCHAIN_FILE=${CMAKE_CURRENT_SOURCE_DIR}/vcpkg/scripts/buildsystems/vcpkg.cmake\" \"-DWZ_DISTRIBUTOR:STRING=${WZ_DISTRIBUTOR}\" ${_debug_output_args} -G Xcode -B . -S \"${_repoBase}\"") execute_process( COMMAND ${CMAKE_COMMAND} "-DCMAKE_TOOLCHAIN_FILE=${CMAKE_CURRENT_SOURCE_DIR}/vcpkg/scripts/buildsystems/vcpkg.cmake" - -DGLEW_USE_STATIC_LIBS=ON + "-DWZ_DISTRIBUTOR:STRING=${WZ_DISTRIBUTOR}" ${_additional_configure_arguments} -G Xcode - "${_repoBase}" + -B . + -S "${_repoBase}" RESULT_VARIABLE _exstatus ) From 4b77c6cd467b1784417391b2aad80c22829f24d0 Mon Sep 17 00:00:00 2001 From: past-due <30942300+past-due@users.noreply.github.com> Date: Tue, 26 Mar 2024 17:03:05 -0400 Subject: [PATCH 23/24] wzmaplib: Adjust CMake find_package(libzip) params --- lib/wzmaplib/CMakeLists.txt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/wzmaplib/CMakeLists.txt b/lib/wzmaplib/CMakeLists.txt index 2189e561e42..d244ea90969 100644 --- a/lib/wzmaplib/CMakeLists.txt +++ b/lib/wzmaplib/CMakeLists.txt @@ -130,7 +130,11 @@ target_link_libraries(wzmaplib PRIVATE quickjs) ################################## # ZipIOProvider (requires libzip) -find_package(libzip QUIET) +set(LIBZIP_FIND_ADDITIONAL_PARAMS) +if (APPLE OR WIN32) + list(APPEND LIBZIP_FIND_ADDITIONAL_PARAMS NO_SYSTEM_ENVIRONMENT_PATH) +endif() +find_package(libzip QUIET ${LIBZIP_FIND_ADDITIONAL_PARAMS}) if (libzip_FOUND) # Test linking libzip include(CheckCXXSourceCompiles) From 3d9251799af114a4ec00828b445fe95b6c40b023 Mon Sep 17 00:00:00 2001 From: past-due <30942300+past-due@users.noreply.github.com> Date: Tue, 26 Mar 2024 18:31:28 -0400 Subject: [PATCH 24/24] wzmaplib: Silence Wunused-but-set-variable --- lib/wzmaplib/plugins/ZipIOProvider/src/ZipIOProvider.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/lib/wzmaplib/plugins/ZipIOProvider/src/ZipIOProvider.cpp b/lib/wzmaplib/plugins/ZipIOProvider/src/ZipIOProvider.cpp index 172f14c963f..1f138b50c2d 100644 --- a/lib/wzmaplib/plugins/ZipIOProvider/src/ZipIOProvider.cpp +++ b/lib/wzmaplib/plugins/ZipIOProvider/src/ZipIOProvider.cpp @@ -687,7 +687,6 @@ bool WzMapZipIO::enumerateFoldersInternal(const std::string& basePath, bool recu // entries that end with "/" are dedicated directory entries - size_t directoryDepth = 0; while (!nameStr.empty()) { if (nameStr.back() != '/') @@ -708,7 +707,6 @@ bool WzMapZipIO::enumerateFoldersInternal(const std::string& basePath, bool recu { m_cachedDirectoriesList.push_back(nameStr); } - directoryDepth++; // remove any trailing "/" size_t numTrailingSlash = 0;