diff --git a/.vscode/c_cpp_properties.json b/.vscode/c_cpp_properties.json new file mode 100644 index 0000000..dabbbe0 --- /dev/null +++ b/.vscode/c_cpp_properties.json @@ -0,0 +1,14 @@ +{ + "configurations": [ + { + "name": "Mac", + "includePath": ["/opt/homebrew/include"], + "macFrameworkPath": ["/System/Library/Frameworks", "/Library/Frameworks"], + "intelliSenseMode": "macos-clang-x64", + "compilerPath": "/usr/bin/clang", + "cStandard": "c17", + "cppStandard": "c++17" + } + ], + "version": 4 +} diff --git a/.vscode/settings.json b/.vscode/settings.json index ce40d5c..de5d7ee 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -60,4 +60,10 @@ "yuezk" ], "rust-analyzer.cargo.features": "all", + "files.associations": { + "unistd.h": "c", + "utsname.h": "c", + "vpn.h": "c", + "openconnect.h": "c" + }, } diff --git a/crates/openconnect/build.rs b/crates/openconnect/build.rs index 0220ce0..bfba3a0 100644 --- a/crates/openconnect/build.rs +++ b/crates/openconnect/build.rs @@ -1,9 +1,14 @@ fn main() { // Link to the native openconnect library println!("cargo:rustc-link-lib=openconnect"); + println!("cargo:rustc-link-search=/opt/homebrew/lib"); // Homebrew path println!("cargo:rerun-if-changed=src/ffi/vpn.c"); println!("cargo:rerun-if-changed=src/ffi/vpn.h"); // Compile the vpn.c file - cc::Build::new().file("src/ffi/vpn.c").include("src/ffi").compile("vpn"); + cc::Build::new() + .file("src/ffi/vpn.c") + .include("src/ffi") + .include("/opt/homebrew/include") // Homebrew path + .compile("vpn"); }