Skip to content

Commit ffc6eaf

Browse files
authored
wasm: only compile .wasm.v, and platform independent .v files (#26386)
1 parent 3a435fa commit ffc6eaf

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

‎vlib/v/pref/should_compile.v‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,9 @@ pub fn (prefs &Preferences) should_compile_filtered_files(dir string, files_ []s
6969
if !prefs.backend.is_js() && !prefs.should_compile_asm(file) {
7070
continue
7171
}
72+
if prefs.backend == .wasm && !prefs.should_compile_wasm(file) {
73+
continue
74+
}
7275
if file.starts_with('.#') {
7376
continue
7477
}
@@ -287,6 +290,14 @@ pub fn (prefs &Preferences) should_compile_js(file string) bool {
287290
return true
288291
}
289292

293+
pub fn (prefs &Preferences) should_compile_wasm(file string) bool {
294+
if !file.ends_with('.wasm.v') && file.count('.') >= 2 {
295+
// not .wasm.v not just .v something else like .c.v
296+
return false
297+
}
298+
return true
299+
}
300+
290301
// is_target_of returns true if this_os is included in the target specified
291302
// for example, 'nix' is true for Linux and FreeBSD but not Windows
292303
pub fn (this_os OS) is_target_of(target string) bool {

0 commit comments

Comments
 (0)