File tree Expand file tree Collapse file tree 3 files changed +5
-0
lines changed Expand file tree Collapse file tree 3 files changed +5
-0
lines changed Original file line number Diff line number Diff line change 11use std:: env;
22
33fn main ( ) {
4+ let is_custom_os = || env:: var ( "CARGO_CFG_TARGET_OS" ) . as_deref ( ) == Ok ( "custom" ) ;
5+
46 println ! ( "cargo:rerun-if-changed=build.rs" ) ;
57 let target = env:: var ( "TARGET" ) . expect ( "TARGET was not set" ) ;
68 if target. contains ( "freebsd" ) {
@@ -40,6 +42,7 @@ fn main() {
4042 || target. contains ( "xous" )
4143 || target. contains ( "hurd" )
4244 || target. contains ( "uefi" )
45+ || is_custom_os ( )
4346 // See src/bootstrap/synthetic_targets.rs
4447 || env:: var ( "RUSTC_BOOTSTRAP_SYNTHETIC_TARGET" ) . is_ok ( )
4548 {
Original file line number Diff line number Diff line change @@ -926,6 +926,7 @@ pub mod consts {
926926 /// - dragonfly
927927 /// - netbsd
928928 /// - openbsd
929+ /// - custom
929930 /// - solaris
930931 /// - android
931932 /// - windows
Original file line number Diff line number Diff line change @@ -45,6 +45,7 @@ cfg_if::cfg_if! {
4545cfg_if:: cfg_if! {
4646 if #[ cfg( any( target_os = "l4re" ,
4747 target_os = "uefi" ,
48+ target_os = "custom" ,
4849 feature = "restricted-std" ,
4950 all( target_family = "wasm" , not( target_os = "emscripten" ) ) ,
5051 target_os = "xous" ,
You can’t perform that action at this time.
0 commit comments