Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow of way to toggle freestanding platform features #356

Merged
merged 2 commits into from
Mar 11, 2024
Merged
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
7 changes: 6 additions & 1 deletion mbedtls-sys/build/cmake.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,16 @@ impl super::BuildConfig {
cmk.define("CMAKE_C_COMPILER_FORCED", "TRUE");
}

println!("cargo:rerun-if-env-changed=RUST_MBED_C_COMPILER_BAREMETAL");
let c_compiler_baremetal = std::env::var("RUST_MBED_C_COMPILER_BAREMETAL")
.map(|val| val == "1")
.unwrap_or_default();

let target = std::env::var("TARGET").expect("TARGET environment variable should be set in build scripts");
// thumbv6m-none-eabi, thumbv7em-none-eabi, thumbv7em-none-eabihf,
// thumbv7m-none-eabi probably use arm-none-eabi-gcc which can cause the
// cmake compiler test to fail.
if target.starts_with("thumbv") && target.contains("none-eabi") {
if target.starts_with("thumbv") && target.contains("none-eabi") || c_compiler_baremetal {
// When building on Linux, -rdynamic flag is added automatically. Changing the
// CMAKE_SYSTEM_NAME to Generic avoids this.
cmk.define("CMAKE_SYSTEM_NAME", "Generic");
Expand Down
Loading