From 06324e005eee59562a2e883ff0d8cd6f61952f02 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bogdan-=C8=98tefan=20Neac=C5=9Fu?= Date: Wed, 3 Apr 2024 16:54:50 +0200 Subject: [PATCH] Use the default Binding Generator The swift binding generator doesn't seem to take into consideration the uniffi.toml file when generating the configuration. Use the default generator instead, while explicitly specifying swift as targeted language. --- src/bindings.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/bindings.rs b/src/bindings.rs index 174ff07..2d5d6c9 100644 --- a/src/bindings.rs +++ b/src/bindings.rs @@ -2,7 +2,7 @@ use std::fs::{self, create_dir}; use crate::Result; use camino::Utf8Path; -use uniffi_bindgen::bindings::swift::gen_swift::SwiftBindingGenerator; +use uniffi_bindgen::{bindings::TargetLanguage, BindingGeneratorDefault}; use crate::recreate_dir; @@ -19,7 +19,10 @@ pub fn generate_bindings(lib_path: &Utf8Path, crate_name: &str) -> Result<()> { uniffi_bindgen::library_mode::generate_bindings( lib_path, Some(crate_name.to_owned()), - &SwiftBindingGenerator {}, + &BindingGeneratorDefault { + target_languages: vec![TargetLanguage::Swift], + try_format_code: false, + }, None, out_dir, false,