-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
initial compiling amnezia lib exchanged for wireguard-go
basic structs and feature for amnezia configuration - libs still build
- Loading branch information
Showing
26 changed files
with
1,814 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
// Copyright 2024 - Nym Technologies SA <[email protected]> | ||
// SPDX-License-Identifier: GPL-3.0-only | ||
|
||
use std::{env, path::PathBuf}; | ||
use vergen::EmitBuilder; | ||
|
||
fn main() -> Result<(), Box<dyn std::error::Error>> { | ||
|
@@ -11,5 +12,39 @@ fn main() -> Result<(), Box<dyn std::error::Error>> { | |
.all_cargo() | ||
.emit() | ||
.expect("failed to extract build metadata"); | ||
|
||
let manifest_path = env::var_os("CARGO_MANIFEST_DIR").expect("manifest dir is not set"); | ||
let target = env::var("TARGET").expect("target is not set"); | ||
let target_os = env::var("CARGO_CFG_TARGET_OS").expect("target os is not set"); | ||
|
||
let mut build_dir = PathBuf::from(manifest_path) | ||
.join("../../../build/lib") | ||
.canonicalize() | ||
.expect("failed to canonicalize build dir path"); | ||
|
||
build_dir.push(target); | ||
|
||
// CI may only provide universal builds | ||
if target_os == "macos" { | ||
let target_dir_exists = build_dir | ||
.try_exists() | ||
.expect("failed to check existence of target dir"); | ||
|
||
if !target_dir_exists { | ||
build_dir.pop(); | ||
build_dir.push("universal-apple-darwin"); | ||
} | ||
} | ||
|
||
println!("cargo::rustc-link-search={}", build_dir.display()); | ||
|
||
let link_type = match target_os.as_str() { | ||
"android" => "", | ||
"linux" | "macos" | "ios" => "=static", | ||
"windows" => "dylib", | ||
_ => panic!("Unsupported platform: {}", target_os), | ||
}; | ||
println!("cargo:rustc-link-lib{}=wg", link_type); | ||
|
||
Ok(()) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
// Copyright 2024 - Nym Technologies SA <[email protected]> | ||
// SPDX-License-Identifier: GPL-3.0-only | ||
|
||
use std::{env, path::PathBuf}; | ||
use vergen::EmitBuilder; | ||
|
||
fn main() -> Result<(), Box<dyn std::error::Error>> { | ||
|
@@ -11,5 +12,39 @@ fn main() -> Result<(), Box<dyn std::error::Error>> { | |
.all_cargo() | ||
.emit() | ||
.expect("failed to extract build metadata"); | ||
|
||
let manifest_path = env::var_os("CARGO_MANIFEST_DIR").expect("manifest dir is not set"); | ||
let target = env::var("TARGET").expect("target is not set"); | ||
let target_os = env::var("CARGO_CFG_TARGET_OS").expect("target os is not set"); | ||
|
||
let mut build_dir = PathBuf::from(manifest_path) | ||
.join("../../../build/lib") | ||
.canonicalize() | ||
.expect("failed to canonicalize build dir path"); | ||
|
||
build_dir.push(target); | ||
|
||
// CI may only provide universal builds | ||
if target_os == "macos" { | ||
let target_dir_exists = build_dir | ||
.try_exists() | ||
.expect("failed to check existence of target dir"); | ||
|
||
if !target_dir_exists { | ||
build_dir.pop(); | ||
build_dir.push("universal-apple-darwin"); | ||
} | ||
} | ||
|
||
println!("cargo::rustc-link-search={}", build_dir.display()); | ||
|
||
let link_type = match target_os.as_str() { | ||
"android" => "", | ||
"linux" | "macos" | "ios" => "=static", | ||
"windows" => "dylib", | ||
_ => panic!("Unsupported platform: {}", target_os), | ||
}; | ||
println!("cargo:rustc-link-lib{}=wg", link_type); | ||
|
||
Ok(()) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.