Codegen: указать --llvm-path для ffigen (LLVM на S:)
ffigen внутри flutter_rust_bridge_codegen не находил libclang.dll (дефолтные пути вроде C:/Program Files/llvm), LLVM у нас на S:\dev\LLVM. Передаём --llvm-path <корень LLVM> из LIBCLANG_PATH. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
+2
-1
@@ -49,7 +49,8 @@ cargo +stable install cargo-expand --version 1.0.95 --locked
|
||||
cargo +stable install flutter_rust_bridge_codegen --version 1.80.1 --features uuid --locked
|
||||
pushd flutter && flutter pub get && popd
|
||||
RUSTC_BOOTSTRAP=1 flutter_rust_bridge_codegen --rust-input ./src/flutter_ffi.rs \
|
||||
--dart-output ./flutter/lib/generated_bridge.dart --c-output ./flutter/macos/Runner/bridge_generated.h
|
||||
--dart-output ./flutter/lib/generated_bridge.dart --c-output ./flutter/macos/Runner/bridge_generated.h \
|
||||
--llvm-path S:/dev/LLVM # ffigen ищет libclang.dll в дефолтных путях, LLVM у нас на S:
|
||||
```
|
||||
Пины FRB_VERSION/CARGO_EXPAND_VERSION — в `upstream.txt`. Шаг встроен в `build-windows.ps1` перед build.py.
|
||||
RUSTC_BOOTSTRAP=1 нужен, т.к. cargo-expand требует nightly-фич, а тулчейн 1.75 stable.
|
||||
|
||||
@@ -110,7 +110,9 @@ if (-not (Test-Path $frb)) {
|
||||
cargo +stable install flutter_rust_bridge_codegen --version $pins['FRB_VERSION'] --features uuid --locked
|
||||
}
|
||||
Push-Location flutter; flutter pub get; Pop-Location
|
||||
& $frb --rust-input ./src/flutter_ffi.rs --dart-output ./flutter/lib/generated_bridge.dart --c-output ./flutter/macos/Runner/bridge_generated.h
|
||||
# ffigen (внутри codegen) ищет libclang.dll в дефолтных путях -> явно указываем корень LLVM (S:\dev\LLVM).
|
||||
$llvmRoot = (Split-Path $env:LIBCLANG_PATH) -replace '\\','/'
|
||||
& $frb --rust-input ./src/flutter_ffi.rs --dart-output ./flutter/lib/generated_bridge.dart --c-output ./flutter/macos/Runner/bridge_generated.h --llvm-path $llvmRoot
|
||||
$frbRc = $LASTEXITCODE
|
||||
# Проверяем ОБЕ стороны: rust + dart (+ freezed). rust-файл создаётся до dart, поэтому одного его мало.
|
||||
$genOk = ($frbRc -eq 0) -and (Test-Path 'src/bridge_generated.rs') -and (Test-Path 'flutter/lib/generated_bridge.dart') -and (Test-Path 'flutter/lib/generated_bridge.freezed.dart')
|
||||
|
||||
Reference in New Issue
Block a user