From f56dad80fa125f9421fd58f20fa863eb6744db5a Mon Sep 17 00:00:00 2001 From: Steffen Fritz Date: Thu, 24 Oct 2024 10:25:15 +0200 Subject: [PATCH] Adding Windows build --- .github/workflows/build_windows.yml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build_windows.yml b/.github/workflows/build_windows.yml index 8bbdc15c..fc839ac1 100644 --- a/.github/workflows/build_windows.yml +++ b/.github/workflows/build_windows.yml @@ -50,9 +50,9 @@ jobs: - name: Build YARA-X C API and locate .pc file run: | cd yara-x - cargo cinstall -p yara-x-capi --release --destdir=$env:USERPROFILE\\yara_install - # Suche die .pc Datei - $PC_FILE = Get-ChildItem -Path $env:USERPROFILE\\yara_install -Recurse -Filter yara_x_capi.pc + cargo cinstall -p yara-x-capi --release --target=x86_64-pc-windows-msvc --destdir=$env:USERPROFILE\\yara_install + # Suche die .pc Datei und setze den Pfad + $PC_FILE = Get-ChildItem -Recurse -Filter "yara_x_capi.pc" $env:USERPROFILE\\yara_install if (-not $PC_FILE) { Write-Error "Error: yara_x_capi.pc not found" exit 1 @@ -60,6 +60,7 @@ jobs: $PC_DIR = Split-Path $PC_FILE.FullName Write-Host "Found yara_x_capi.pc in $PC_DIR" $env:PKG_CONFIG_PATH = $PC_DIR + Write-Host "Setting PKG_CONFIG_PATH to $PC_DIR" # Debug Ausgabe Get-ChildItem $PC_DIR @@ -73,6 +74,9 @@ jobs: $env:PKG_CONFIG_PATH = "$env:USERPROFILE\\yara_install\\usr\\local\\lib\\pkgconfig" $env:CGO_CFLAGS = "-I$env:USERPROFILE\\yara_install\\usr\\local\\include" $env:CGO_LDFLAGS = "-L$env:USERPROFILE\\yara_install\\usr\\local\\lib" + # Debug: Zeige den Inhalt des pkg-config-Pfads + Get-ChildItem $env:PKG_CONFIG_PATH + # Verifiziere pkg-config und CFLAGS pkg-config --cflags --libs yara_x_capi # Baue das Go-Binary mit der Rust-Bibliothek