11use std:: { collections:: BTreeMap , env, path:: PathBuf , sync:: atomic:: Ordering } ;
22
33mod configure;
4+ #[ path = "libm/configure.rs" ]
5+ mod libm_configure;
46
57use configure:: { configure_f16_f128, Target } ;
68
@@ -14,12 +16,9 @@ fn main() {
1416 configure_check_cfg ( ) ;
1517 configure_f16_f128 ( & target) ;
1618
17- println ! ( "cargo:compiler-rt={}" , cwd . join ( "compiler-rt" ) . display ( ) ) ;
19+ configure_libm ( ) ;
1820
19- // Activate libm's unstable features to make full use of Nightly.
20- println ! ( "cargo::rustc-check-cfg=cfg(feature, values(\" unstable\" , \" force-soft-floats\" ))" ) ;
21- println ! ( "cargo:rustc-cfg=feature=\" unstable\" " ) ;
22- println ! ( "cargo:rustc-cfg=feature=\" force-soft-floats\" " ) ;
21+ println ! ( "cargo:compiler-rt={}" , cwd. join( "compiler-rt" ) . display( ) ) ;
2322
2423 // Emscripten's runtime includes all the builtins
2524 if target. os == "emscripten" {
@@ -104,6 +103,18 @@ fn main() {
104103 }
105104}
106105
106+ /// Run configuration for `libm` since it is included directly.
107+ fn configure_libm ( ) {
108+ let cfg = libm_configure:: Config :: from_env ( ) ;
109+ libm_configure:: emit_libm_config ( & cfg) ;
110+
111+ // Activate libm's unstable features to make full use of Nightly.
112+ println ! ( "cargo:rustc-cfg=feature=\" force-soft-floats\" " ) ;
113+ println ! ( "cargo:rustc-cfg=feature=\" unstable-float\" " ) ;
114+ println ! ( "cargo:rustc-cfg=feature=\" unstable-intrinsics\" " ) ;
115+ println ! ( "cargo:rustc-cfg=feature=\" unstable\" " ) ;
116+ }
117+
107118fn aarch64_symbol ( ordering : Ordering ) -> & ' static str {
108119 match ordering {
109120 Ordering :: Relaxed => "relax" ,
0 commit comments