File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change 11#[ cfg( feature = "build_cc" ) ]
22fn main ( ) {
3+ let ( debug, optim) = if cfg ! ( feature = "debug" ) {
4+ ( true , "-O0" )
5+ } else {
6+ ( false , "-O3" )
7+ } ;
38 let mut build = cc:: Build :: new ( ) ;
49 build. include ( "snmalloc/src" ) ;
510 build. file ( "snmalloc/src/override/rust.cc" . to_string ( ) ) ;
@@ -22,7 +27,7 @@ fn main() {
2227 build. flag_if_supported ( "/Zc:wchar_t" ) ;
2328 build. flag_if_supported ( "/Zc:forScope" ) ;
2429 build. flag_if_supported ( "/Zc:inline" ) ;
25- build. flag_if_supported ( "-O3" ) ;
30+ build. flag_if_supported ( optim ) ;
2631 build. flag_if_supported ( "-mcx16" ) ;
2732 build. flag_if_supported ( "-fno-exceptions" ) ;
2833 build. flag_if_supported ( "-fno-rtti" ) ;
@@ -31,7 +36,7 @@ fn main() {
3136 build. flag_if_supported ( "-fpermissive" ) ;
3237 build. static_crt ( true ) ;
3338 build. cpp ( true ) ;
34- build. debug ( false ) ;
39+ build. debug ( debug ) ;
3540 if cfg ! ( feature = "usecxx20" ) {
3641 build. flag_if_supported ( "-std=c++17" ) ; //original required if cxx20 not supported
3742 build. flag_if_supported ( "/std:c++17" ) ;
You can’t perform that action at this time.
0 commit comments