Skip to content

Commit 9cfa14c

Browse files
authored
Merge pull request #189 from LedgerHQ/y333/c_sdk_management
Temporary fix to manage API_LEVEL_21 branch (head vs tag in builder)
2 parents 711225d + 25998cb commit 9cfa14c

File tree

3 files changed

+13
-6
lines changed

3 files changed

+13
-6
lines changed

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ledger_secure_sdk_sys/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "ledger_secure_sdk_sys"
3-
version = "1.4.6"
3+
version = "1.4.7"
44
authors = ["yhql", "agrojean-ledger"]
55
edition = "2021"
66
license.workspace = true

ledger_secure_sdk_sys/build.rs

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,10 @@ const DEFINES_CCID: [(&str, Option<&str>); 2] =
1111

1212
const AUX_C_FILES: [&str; 2] = ["./src/c/src.c", "./src/c/sjlj.s"];
1313

14-
const SDK_C_FILES: [&str; 9] = [
14+
const SDK_C_FILES: [&str; 8] = [
1515
"src/os_io_usb.c",
1616
"src/pic.c",
1717
"src/checks.c",
18-
"lib_cxng/src/cx_exported_functions.c",
1918
"src/cx_stubs.S",
2019
"src/os.c",
2120
"src/svc_call.s",
@@ -212,8 +211,8 @@ fn retrieve_target_file_infos(
212211
fn clone_sdk(device: &Device) -> PathBuf {
213212
let (repo_url, sdk_branch) = match device {
214213
Device::NanoS => (
215-
Path::new("https://github.com/LedgerHQ/nanos-secure-sdk"),
216-
"master",
214+
Path::new("https://github.com/LedgerHQ/ledger-secure-sdk"),
215+
"API_LEVEL_LNS",
217216
),
218217
Device::NanoX => (
219218
Path::new("https://github.com/LedgerHQ/ledger-secure-sdk"),
@@ -408,6 +407,14 @@ impl SDKBuilder {
408407
} else {
409408
// Let cc::Build determine CC from the environment variable
410409
}
410+
411+
// Test if the file lib_cxng/src/cx_exported_functions.c exists
412+
// If it does, add it to the list of files to compile
413+
let cxng_src = self.bolos_sdk.join("lib_cxng/src/cx_exported_functions.c");
414+
if cxng_src.exists() {
415+
command.file(cxng_src);
416+
}
417+
411418
command
412419
.files(&AUX_C_FILES)
413420
.files(str2path(&self.bolos_sdk, &SDK_C_FILES))

0 commit comments

Comments
 (0)