Skip to content

Commit 1fb6fcc

Browse files
committed
v.gen.native: skip warning for darwin flag in time_nix.c.v:6, when compiling on linux (reduce noise)
1 parent 98abeb1 commit 1fb6fcc

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

‎vlib/v/gen/native/stmt.c.v‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -411,6 +411,10 @@ fn (mut g Gen) gen_flag_hash_stmt(node ast.HashStmt) {
411411
} else if node.main.contains('-L') {
412412
g.linker_include_paths << node.main.all_after('-L').trim_space()
413413
} else if node.main.contains('-D') || node.main.contains('-I') {
414+
if g.pref.os == .linux && node.main.starts_with('darwin ') {
415+
// TODO: skip all mismatching flags. Extract the logic from cgen in a common method on HashStmt, and call it both here and in cgen.
416+
return
417+
}
414418
// g.v_error('`-D` and `-I` flags are not supported with the native backend', node.pos)
415419
println(util.formatted_error('warn', '`-D` and `-I` flags are not supported with the native backend',
416420
g.current_file.path, node.pos))

0 commit comments

Comments
 (0)