File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ fn main ( ) {
2+ if let Ok ( dir) = std:: env:: var ( "DEP_SWIFTSYNTAXFFI_LIBDIR" ) {
3+ println ! ( "cargo:rustc-link-search=native={dir}" ) ;
4+ println ! ( "cargo:rustc-link-lib=dylib=SwiftSyntaxFFI" ) ;
5+ println ! ( "cargo:rustc-link-arg=-Wl,-rpath,{dir}" ) ;
6+ }
7+ if let Ok ( dir) = std:: env:: var ( "DEP_SWIFTSYNTAXFFI_RUNTIMEDIR" ) {
8+ println ! ( "cargo:rustc-link-arg=-Wl,-rpath,{dir}" ) ;
9+ }
10+ }
Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ description = "Rust wrapper around the swift-syntax package for parsing Swift so
44version = " 0.1.0"
55authors = [" GitHub" ]
66edition = " 2024"
7+ links = " SwiftSyntaxFFI"
78
89[lib ]
910name = " swift_syntax_rs"
Original file line number Diff line number Diff line change @@ -56,11 +56,13 @@ fn main() {
5656 println ! ( "cargo:rustc-link-search=native={}" , build_dir. display( ) ) ;
5757 println ! ( "cargo:rustc-link-lib=dylib=SwiftSyntaxFFI" ) ;
5858 println ! ( "cargo:rustc-link-arg=-Wl,-rpath,{}" , build_dir. display( ) ) ;
59+ println ! ( "cargo:libdir={}" , build_dir. display( ) ) ;
5960
6061 // The executable also needs to find the Swift runtime libraries at run time.
6162 if let Some ( runtime) = swift_runtime_dir ( ) {
6263 println ! ( "cargo:rustc-link-search=native={}" , runtime. display( ) ) ;
6364 println ! ( "cargo:rustc-link-arg=-Wl,-rpath,{}" , runtime. display( ) ) ;
65+ println ! ( "cargo:runtimedir={}" , runtime. display( ) ) ;
6466 }
6567}
6668
You can’t perform that action at this time.
0 commit comments