Skip to content

Commit

Permalink
Use default value if QNX_TARGET is not set
Browse files Browse the repository at this point in the history
  • Loading branch information
flba-eb committed Nov 29, 2024
1 parent 14cb365 commit 5051c34
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ pub(crate) fn target() -> Target {
// More information:
// https://www.qnx.com/developers/docs/7.1/index.html#com.qnx.doc.neutrino.io_sock/topic/migrate_app.html
fn get_iosock_param() -> &'static str {
let target_dir = std::env::var("QNX_TARGET").expect("Environment variable QNX_TARGET is set");
let target_dir = std::env::var("QNX_TARGET").unwrap_or_else(|_| "PLEASE_SET_ENV_VAR_QNX_TARGET".into());
let linker_param = format!("-L{target_dir}/aarch64le/io-sock/lib");

linker_param.leak()
Expand Down
7 changes: 5 additions & 2 deletions tests/assembly/targets/targets-elf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@
//@ [aarch64_unknown_nto_qnx710] compile-flags: --target aarch64-unknown-nto-qnx710
//@ [aarch64_unknown_nto_qnx710] needs-llvm-components: aarch64
//@ revisions: aarch64_unknown_nto_qnx710_iosock
//@ [aarch64_unknown_nto_qnx710] compile-flags: --target aarch64-unknown-nto-qnx710_iosock
//@ [aarch64_unknown_nto_qnx710] needs-llvm-components: aarch64
//@ [aarch64_unknown_nto_qnx710_iosock] compile-flags: --target aarch64-unknown-nto-qnx710_iosock
//@ [aarch64_unknown_nto_qnx710_iosock] needs-llvm-components: aarch64
//@ revisions: aarch64_unknown_openbsd
//@ [aarch64_unknown_openbsd] compile-flags: --target aarch64-unknown-openbsd
//@ [aarch64_unknown_openbsd] needs-llvm-components: aarch64
Expand Down Expand Up @@ -549,6 +549,9 @@
//@ revisions: x86_64_pc_nto_qnx710
//@ [x86_64_pc_nto_qnx710] compile-flags: --target x86_64-pc-nto-qnx710
//@ [x86_64_pc_nto_qnx710] needs-llvm-components: x86
//@ revisions: x86_64_pc_nto_qnx710_iosock
//@ [x86_64_pc_nto_qnx710_iosock compile-flags: --target x86_64-pc-nto-qnx710_iosock
//@ [x86_64_pc_nto_qnx710_iosock needs-llvm-components: x86
//@ revisions: x86_64_pc_solaris
//@ [x86_64_pc_solaris] compile-flags: --target x86_64-pc-solaris
//@ [x86_64_pc_solaris] needs-llvm-components: x86
Expand Down

0 comments on commit 5051c34

Please sign in to comment.