Skip to content

Commit 63d0f93

Browse files
committed
update wasm compilation conditions of gossipsub
Signed-off-by: ozkanonur <[email protected]>
1 parent b23a4a7 commit 63d0f93

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

libp2p/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ pub use libp2p_dns as dns;
6565
#[doc(inline)]
6666
pub use libp2p_floodsub as floodsub;
6767
#[cfg(feature = "gossipsub")]
68-
#[cfg(not(target_os = "unknown"))]
68+
#[cfg(any(not(target_os = "unknown"), target_arch = "wasm32"))]
6969
#[doc(inline)]
7070
pub use libp2p_gossipsub as gossipsub;
7171
#[cfg(feature = "identify")]

misc/metrics/src/identify.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ const ALLOWED_PROTOCOLS: &[StreamProtocol] = &[
6464
#[cfg(feature = "dcutr")]
6565
libp2p_dcutr::PROTOCOL_NAME,
6666
// #[cfg(feature = "gossipsub")]
67-
// #[cfg(not(target_os = "unknown"))]
67+
// #[cfg(any(not(target_os = "unknown"), target_arch = "wasm32"))]
6868
// TODO: Add Gossipsub protocol name
6969
libp2p_identify::PROTOCOL_NAME,
7070
libp2p_identify::PUSH_PROTOCOL_NAME,

misc/metrics/src/lib.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
#[cfg(feature = "dcutr")]
3131
mod dcutr;
3232
#[cfg(feature = "gossipsub")]
33-
#[cfg(not(target_os = "unknown"))]
33+
#[cfg(any(not(target_os = "unknown"), target_arch = "wasm32"))]
3434
mod gossipsub;
3535
#[cfg(feature = "identify")]
3636
mod identify;
@@ -50,7 +50,7 @@ pub struct Metrics {
5050
#[cfg(feature = "dcutr")]
5151
dcutr: dcutr::Metrics,
5252
#[cfg(feature = "gossipsub")]
53-
#[cfg(not(target_os = "unknown"))]
53+
#[cfg(any(not(target_os = "unknown"), target_arch = "wasm32"))]
5454
gossipsub: gossipsub::Metrics,
5555
#[cfg(feature = "identify")]
5656
identify: identify::Metrics,
@@ -78,7 +78,7 @@ impl Metrics {
7878
#[cfg(feature = "dcutr")]
7979
dcutr: dcutr::Metrics::new(sub_registry),
8080
#[cfg(feature = "gossipsub")]
81-
#[cfg(not(target_os = "unknown"))]
81+
#[cfg(any(not(target_os = "unknown"), target_arch = "wasm32"))]
8282
gossipsub: gossipsub::Metrics::new(sub_registry),
8383
#[cfg(feature = "identify")]
8484
identify: identify::Metrics::new(sub_registry),
@@ -107,7 +107,7 @@ impl Recorder<libp2p_dcutr::Event> for Metrics {
107107
}
108108

109109
#[cfg(feature = "gossipsub")]
110-
#[cfg(not(target_os = "unknown"))]
110+
#[cfg(any(not(target_os = "unknown"), target_arch = "wasm32"))]
111111
impl Recorder<libp2p_gossipsub::Event> for Metrics {
112112
fn record(&self, event: &libp2p_gossipsub::Event) {
113113
self.gossipsub.record(event)

0 commit comments

Comments
 (0)