···33593359 match current_target {
33603360 Target::Erlang => "Erlang",
33613361 Target::JavaScript => "JavaScript",
33623362+ Target::Cranelift => "Cranelift",
33623363 }
33633364 );
33643365 let hint = wrap("Did you mean to build for a different target?");
···33873388 let target = match target {
33883389 Target::Erlang => "Erlang",
33893390 Target::JavaScript => "JavaScript",
33913391+ Target::Cranelift => "Cranelift",
33903392 };
33913393 let text = wrap_format!(
33923394 "The `{name}` function is public but doesn't have an \
···43534355 "You can not set a runtime for Erlang. Did you mean to target JavaScript?"
43544356 .into(),
43554357 ),
43584358+ Target::Cranelift => Some(
43594359+ "You can not set a runtime for Cranelift. Did you mean to target JavaScript?"
43604360+ .into()
43614361+ )
43564362 };
4357436343584364 vec![Diagnostic {
···234234 /// - `uses_javascript_externals: true` the function is using JavaScript
235235 /// external code.
236236 uses_javascript_externals: bool,
237237+ /// Set to `true` if the const/function is defined using Cranelift external
238238+ /// code. That means that the function will use Cranelift code through FFI when
239239+ /// compiled for the Cranelift target.
240240+ uses_cranelift_externals: bool,
237241 /// Whether the function can be called on the Erlang target, either due to a
238242 /// pure Gleam implementation or an implementation that uses some Erlang
239243 /// externals.
···242246 /// to a pure Gleam implementation or an implementation that uses some
243247 /// JavaScript externals.
244248 can_run_on_javascript: bool,
249249+ /// Whether the function can be called on the Cranelift target, either due to a
250250+ /// pure Gleam implementation or an implementation that uses some Cranelift
251251+ /// externals.
252252+ can_run_on_cranelift: bool,
245253}
246254247255impl ImplementationsInterface {
···259267 gleam,
260268 uses_erlang_externals,
261269 uses_javascript_externals,
262262-270270+ uses_cranelift_externals,
263271 can_run_on_erlang,
264272 can_run_on_javascript,
273273+ can_run_on_cranelift,
265274 } = implementations;
266275267276 ImplementationsInterface {
268277 gleam: *gleam,
269278 uses_erlang_externals: *uses_erlang_externals,
270279 uses_javascript_externals: *uses_javascript_externals,
280280+ uses_cranelift_externals: *uses_cranelift_externals,
271281 can_run_on_erlang: *can_run_on_erlang,
272282 can_run_on_javascript: *can_run_on_javascript,
283283+ can_run_on_cranelift: *can_run_on_cranelift,
273284 }
274285 }
275286}