From 365e1a98063e024a347a934fcb227287f388028e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Laurent=20Saint-F=C3=A9lix?= Date: Mon, 23 Oct 2023 18:06:26 +0200 Subject: [PATCH] [WASM lib] Add compiler error with instructions to build the webassembly (#2316) --- compiler-rs/compiler-wasm-lib/src/lib.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/compiler-rs/compiler-wasm-lib/src/lib.rs b/compiler-rs/compiler-wasm-lib/src/lib.rs index e90090c977..e37a13ba03 100644 --- a/compiler-rs/compiler-wasm-lib/src/lib.rs +++ b/compiler-rs/compiler-wasm-lib/src/lib.rs @@ -19,6 +19,10 @@ use anyhow::bail; use wasm_bindgen::prelude::*; use clients_schema::{Availabilities, Visibility}; + +#[cfg(not(target_arch="wasm32"))] +compile_error!("To build this crate use `make compiler-wasm-lib`"); + #[wasm_bindgen] pub fn convert_schema_to_openapi(json: &str, flavor: &str) -> Result { set_panic_hook();