From 5939238655a4e41507d85d0555c65c1dabd03d36 Mon Sep 17 00:00:00 2001 From: S-YOU Date: Mon, 5 Aug 2019 16:42:50 +0900 Subject: [PATCH] add @VMOD to resolve modules path --- compiler/comptime.v | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/compiler/comptime.v b/compiler/comptime.v index 5b362cd7dd..fc226f2c3d 100644 --- a/compiler/comptime.v +++ b/compiler/comptime.v @@ -149,9 +149,15 @@ fn (p mut Parser) chash() { if p.table.flags.contains(flag) { return } + // expand `@VMOD/pg/pg.o` to absolute path + has_vmod := flag.contains('@VMOD') + flag = flag.trim_space().replace('@VMOD', ModPath) + if p.table.flags.contains(flag) { + return + } p.log('adding flag "$flag"') // `@VROOT/thirdparty/glad/glad.o`, make sure it exists, otherwise build it - if has_vroot && flag.contains('.o') { + if (has_vroot || has_vmod) && flag.contains('.o') { if p.os == .msvc { build_thirdparty_obj_file_with_msvc(flag) }