diff --git a/vlib/v/ast/cflags.v b/vlib/v/ast/cflags.v index fac0a771a0..79c86b91e5 100644 --- a/vlib/v/ast/cflags.v +++ b/vlib/v/ast/cflags.v @@ -4,6 +4,7 @@ module ast import v.cflag +import v.checker.constants // check if cflag is in table pub fn (t &Table) has_cflag(flag cflag.CFlag) bool { @@ -25,8 +26,8 @@ pub fn (mut t Table) parse_cflag(cflg string, mod string, ctimedefines []string) return error('flag is empty') } mut fos := '' - mut allowed_os_overrides := ['linux', 'darwin', 'freebsd', 'openbsd', 'windows', 'mingw', - 'solaris', 'android', 'termux'] + mut allowed_os_overrides := []string{} + allowed_os_overrides << constants.valid_comptime_not_user_defined allowed_os_overrides << ctimedefines for os_override in allowed_os_overrides { if !flag.starts_with(os_override) { diff --git a/vlib/v/checker/constants/constants.v b/vlib/v/checker/constants/constants.v index 6a248231c4..b50c1158d4 100644 --- a/vlib/v/checker/constants/constants.v +++ b/vlib/v/checker/constants/constants.v @@ -10,7 +10,7 @@ pub const ( valid_comptime_if_cpu_features = ['x64', 'x32', 'little_endian', 'big_endian'] valid_comptime_if_other = ['apk', 'js', 'debug', 'prod', 'test', 'glibc', 'prealloc', 'no_bounds_checking', 'freestanding', 'threads', 'js_node', 'js_browser', 'js_freestanding', - 'interpreter', 'es5', 'profile', 'wasm32_emscripten'] + 'interpreter', 'es5', 'profile', 'wasm32', 'wasm32_emscripten', 'wasm32_wasi'] valid_comptime_not_user_defined = all_valid_comptime_idents() )