diff --git a/Cargo.toml b/Cargo.toml index 3bff270..b86b111 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -6,6 +6,9 @@ edition = "2021" [profile.dev] opt-level = 3 +[profile.release] +strip = true + [lib] crate-type = [ "staticlib", # Ensure it gets compiled as a (static) C library diff --git a/codex_storage_proofs.nim b/codex_storage_proofs.nim index cdfec86..1205956 100644 --- a/codex_storage_proofs.nim +++ b/codex_storage_proofs.nim @@ -1,11 +1,22 @@ import std/os +const + currentDir = currentSourcePath().parentDir() + lib_path* = currentDir/"target"/"release"/"libcodex_storage_proofs.a" + static: - let pth = currentSourcePath().parentDir() - echo "\n====" - echo "CODEX:STORAGE:PROOFS: ", pth + echo "\n==== CODEX:STORAGE:PROOFS: " + echo "cwd: ", currentDir + echo "lib_path: ", lib_path # echo "pwd: ", projectDir() # echo "cwd: ", getCurrentDir() + let cmd = "pwd && cargo build --release" + echo "\nBuilding codex-storage-proofs: " & cmd + let (output, exitCode) = gorgeEx cmd + echo output + if exitCode != 0: + # discard gorge "rm -rf " & buildDir + raise (ref Defect)(msg: "Failed to build codex-storage-proofs") echo "\n===="