File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -313,10 +313,11 @@ impl Project {
313313
314314 fn used_packages ( & self , profile : Profile ) -> Vec < & CargoPackage > {
315315 let main_package = self . package ( ) ;
316- let mut packages = self . project . used_packages (
316+ let mut packages = self . project . used_packages_with_rustflags (
317317 self . backend ( ) . triplet ( ) ,
318318 main_package,
319- profile
319+ profile,
320+ [ "--cfg" , "cargo_web" ] . iter ( ) . map ( |arg| * arg )
320321 ) ;
321322
322323 packages. sort_by ( |a, b| {
@@ -425,6 +426,9 @@ impl Project {
425426 let mut extra_environment = Vec :: new ( ) ;
426427 let mut extra_emmaken_cflags = Vec :: new ( ) ;
427428
429+ extra_rustflags. push ( "--cfg" . to_owned ( ) ) ;
430+ extra_rustflags. push ( "cargo_web" . to_owned ( ) ) ;
431+
428432 let vanilla_emscripten_build =
429433 env:: var ( "CARGO_WEB_VANILLA_EMSCRIPTEN_BUILD" ) . map ( |value| value == "1" ) . unwrap_or ( false ) &&
430434 self . backend ( ) . is_emscripten ( ) ;
You can’t perform that action at this time.
0 commit comments