Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .github/workflows/build-packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,6 @@ jobs:
windows:
name: Windows
runs-on: windows-2022
continue-on-error: true # tim2tox C++ source requires POSIX porting for Windows

steps:
- name: Configure Git line endings
Expand Down
29 changes: 25 additions & 4 deletions tool/ci/build_tim2tox.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ source "$SCRIPT_DIR/common.sh"

TARGET=""
MODE="release"
WINDOWS_ARCH="${TIM2TOX_WINDOWS_ARCH:-x64}" # x64|arm64

while [[ $# -gt 0 ]]; do
case "$1" in
Expand Down Expand Up @@ -118,16 +119,36 @@ build_desktop_target() {
local source_dir_win build_dir_win
source_dir_win="$(ci_windows_path "$TIM2TOX_DIR")"
build_dir_win="$(ci_windows_path "$build_dir")"
local vs_arch vcpkg_triplet
# bash 3.x on macOS doesn't support ${var,,} lowercase expansion.
local windows_arch_lc
windows_arch_lc="$(printf "%s" "${WINDOWS_ARCH}" | tr '[:upper:]' '[:lower:]')"
case "${windows_arch_lc}" in
arm64)
vs_arch="arm64"
vcpkg_triplet="arm64-windows"
;;
x64|*)
vs_arch="x64"
vcpkg_triplet="x64-windows"
;;
esac
if [[ -n "${VCPKG_ROOT:-}" ]]; then
local vcpkg_root_win toolchain_file
vcpkg_root_win="$(ci_windows_path "$VCPKG_ROOT")"
toolchain_file="${vcpkg_root_win}/scripts/buildsystems/vcpkg.cmake"
# Ensure tools invoked by CMake/MSBuild are discoverable.
# 1) pkg-config: used by FindPkgConfig during configure.
export PATH="$VCPKG_ROOT/installed/$vcpkg_triplet/tools/pkgconf:$PATH"
# 2) powershell.exe: used by vcpkg's applocal.ps1 post-build step.
# Git Bash (MSYS) typically exposes it under /c/WINDOWS/...
export PATH="/c/WINDOWS/System32/WindowsPowerShell/v1.0:$PATH"
VCPKG_ROOT="$vcpkg_root_win" cmake -S "$source_dir_win" -B "$build_dir_win" \
-G "Visual Studio 17 2022" -A x64 \
-G "Visual Studio 17 2022" -A "$vs_arch" \
-DCMAKE_TOOLCHAIN_FILE="$toolchain_file" \
"${configure_args[@]}"
else
cmake -S "$source_dir_win" -B "$build_dir_win" -G "Visual Studio 17 2022" -A x64 "${configure_args[@]}"
cmake -S "$source_dir_win" -B "$build_dir_win" -G "Visual Studio 17 2022" -A "$vs_arch" "${configure_args[@]}"
fi
;;
*)
Expand All @@ -144,8 +165,8 @@ build_desktop_target() {
ci_log "Captured native library: $built_lib"

if [[ "$target" == "windows" && -n "${VCPKG_ROOT:-}" ]]; then
ci_copy_matching_file "$VCPKG_ROOT/installed/x64-windows" "libsodium.dll" "$OUTPUT_DIR" >/dev/null || \
ci_warn "libsodium.dll not found under $VCPKG_ROOT/installed/x64-windows"
ci_copy_matching_file "$VCPKG_ROOT/installed/$vcpkg_triplet" "libsodium.dll" "$OUTPUT_DIR" >/dev/null || \
ci_warn "libsodium.dll not found under $VCPKG_ROOT/installed/$vcpkg_triplet"
fi

if [[ "$target" == "linux" ]]; then
Expand Down
Loading