Skip to content
This repository has been archived by the owner on Jun 19, 2024. It is now read-only.

refactor: link libpros through pros-sys #85

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ Before releasing:

### Changed

- Linked libpros through `pros_sys` rather than the vexos target spec. (#85)

### Removed

## [0.8.0]
Expand Down
5 changes: 2 additions & 3 deletions armv7a-vexos-eabi.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,11 @@
"gcc": [
"-nostartfiles",
"-nostdlib",
"-Wl,-Tv5.ld,-Tv5-common.ld,--gc-sections",
"-Wl,--start-group,-lgcc,-lpros,-lc,--end-group"
"-Wl,-Tv5.ld,-Tv5-common.ld",
"--gc-sections"
]
},
"relocation-model": "static",
"target-family": "unix",
"target-pointer-width": "32",
"os": "vexos",
"vendor": "vex"
Expand Down
6 changes: 0 additions & 6 deletions packages/pros-sys/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,3 @@ doctest = false
[features]
xapi = []
no-link = []

[build-dependencies]
cfg-if = "1.0"

[dependencies]
cfg-if = "1.0"
14 changes: 6 additions & 8 deletions packages/pros-sys/build.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
use cfg_if::cfg_if;

fn main() {
cfg_if! {
if #[cfg(not(feature = "no-link"))] {
let manifest_dir = std::env::var("CARGO_MANIFEST_DIR").unwrap();
if cfg!(not(feature = "no-link")) {
let manifest_dir = std::env::var("CARGO_MANIFEST_DIR").unwrap();

#[cfg(not(feature = "no-link"))]
println!("cargo:rustc-link-search=native={manifest_dir}/link");
}
println!("cargo:rustc-link-search=native={manifest_dir}/link");
println!("cargo:rustc-link-lib=static=pros");
println!("cargo:rustc-link-lib=static=c");
println!("cargo:rustc-link-lib=static=gcc");
}
}
2 changes: 1 addition & 1 deletion packages/pros/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,4 @@ devices = ["dep:pros-devices"]
math = ["dep:pros-math"]

panic = ["dep:pros-panic"]
display_panics = ["pros-panic/display_panics"]
display_panics = ["pros-panic/display_panics"]
Loading