From 35df792c055216621a38bdc214e9597d3f9c68ed Mon Sep 17 00:00:00 2001 From: Delyan Angelov Date: Tue, 21 Jul 2020 14:26:49 +0300 Subject: [PATCH] vfmt: fix `#include "@VROOT/path/x.h"` --- vlib/v/fmt/tests/include_vroot_keep.vv | 3 +++ vlib/v/parser/comptime.v | 3 +++ 2 files changed, 6 insertions(+) create mode 100644 vlib/v/fmt/tests/include_vroot_keep.vv diff --git a/vlib/v/fmt/tests/include_vroot_keep.vv b/vlib/v/fmt/tests/include_vroot_keep.vv new file mode 100644 index 0000000000..7c25f4cfd0 --- /dev/null +++ b/vlib/v/fmt/tests/include_vroot_keep.vv @@ -0,0 +1,3 @@ +#flag -I @VROOT/c +#flag @VROOT/c/implementation.o +#include "@VROOT/c/implementation.h" diff --git a/vlib/v/parser/comptime.v b/vlib/v/parser/comptime.v index 4b3c97bdc9..c7151e8e1c 100644 --- a/vlib/v/parser/comptime.v +++ b/vlib/v/parser/comptime.v @@ -26,6 +26,9 @@ fn (mut p Parser) resolve_vroot(flag string) string { ' or in one of its parent folders.') } vmod_path := vmod_file_location.vmod_folder + if p.pref.is_fmt { + return flag + } return flag.replace('@VROOT', os.real_path(vmod_path)) }