summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2019-08-31 21:47:39 +0800
committerruki <[email protected]>2019-08-31 21:48:20 +0800
commitbb1cd08b49ce18a63d08287b81f5b50b57395702 (patch)
tree15768e94d99c663cede1eabf45d8180cc17264b8
parentf4f94d8e5bbbe2d5acf2bac99bdb12d80f3b9f47 (diff)
fix vs tips and vsfile
-rw-r--r--xmake/plugins/project/vstudio/impl/vsfile.lua40
-rw-r--r--xmake/plugins/project/vstudio/vs.lua3
-rw-r--r--xmake/plugins/project/vsxmake/vsxmake.lua14
3 files changed, 30 insertions, 27 deletions
diff --git a/xmake/plugins/project/vstudio/impl/vsfile.lua b/xmake/plugins/project/vstudio/impl/vsfile.lua
index 83c1176bc..51b755530 100644
--- a/xmake/plugins/project/vstudio/impl/vsfile.lua
+++ b/xmake/plugins/project/vstudio/impl/vsfile.lua
@@ -22,51 +22,51 @@
_g.indentchar = '\t'
-- print file
-function _print(self, ...)
+function _print_impl(self, ...)
-- print indent
for i = 1, self._indent do
- self:_write(_g.indentchar)
+ self:_write_impl(_g.indentchar)
end
-- print it
- self:_print(...)
+ self:_print_impl(...)
end
-- printf file
-function _printf(self, ...)
+function _printf_impl(self, ...)
-- print indent
for i = 1, self._indent do
- self:_write(_g.indentchar)
+ self:_write_impl(_g.indentchar)
end
-- printf it
- self:_printf(...)
+ self:_printf_impl(...)
end
-- write file
-function _write(self, ...)
+function _write_impl(self, ...)
-- print indent
for i = 1, self._indent do
- self:_write(_g.indentchar)
+ self:_write_impl(_g.indentchar)
end
-- write it
- self:_write(...)
+ self:_write_impl(...)
end
-- writef file
-function _writef(self, ...)
+function _writef_impl(self, ...)
-- print indent
for i = 1, self._indent do
- self:_write(_g.indentchar)
+ self:_write_impl(_g.indentchar)
end
-- writef it
- self:_writef(...)
+ self:_writef_impl(...)
end
-- enter and print file
@@ -100,14 +100,14 @@ function open(filepath, mode)
local file = io.open(filepath, mode)
-- hook print, printf and write
- file._print = file.print
- file._printf = file.printf
- file._write = file.write
- file._writef = file.writef
- file.print = _print
- file.printf = _printf
- file.write = _write
- file.writef = _writef
+ file._print_impl = file.print
+ file._printf_impl = file.printf
+ file._write_impl = file.write
+ file._writef_impl = file.writef
+ file.print = _print_impl
+ file.printf = _printf_impl
+ file.write = _write_impl
+ file.writef = _writef_impl
-- add enter and leave interfaces
file.enter = _enter
diff --git a/xmake/plugins/project/vstudio/vs.lua b/xmake/plugins/project/vstudio/vs.lua
index a36d0a80e..060ca01f2 100644
--- a/xmake/plugins/project/vstudio/vs.lua
+++ b/xmake/plugins/project/vstudio/vs.lua
@@ -34,17 +34,18 @@ function make(version)
raise("invalid vs version, run `xmake f --vs=201x`")
end
end
- vprint("using project kind vs%d", version)
end
-- get vs version info
local info = vsinfo(version)
if version < 2010 then
return function(outputdir)
+ vprint("using project kind vs%d", version)
vs200x.make(outputdir, info)
end
else
return function(outputdir)
+ vprint("using project kind vs%d", version)
vs201x.make(outputdir, info)
end
end
diff --git a/xmake/plugins/project/vsxmake/vsxmake.lua b/xmake/plugins/project/vsxmake/vsxmake.lua
index 015ecbab5..26eeb23fe 100644
--- a/xmake/plugins/project/vsxmake/vsxmake.lua
+++ b/xmake/plugins/project/vsxmake/vsxmake.lua
@@ -141,15 +141,17 @@ function make(version)
raise("invalid vs version, run `xmake f --vs=201x`")
end
end
- vprint("using project kind vs%d", version)
- end
-
- -- check
- if version < 2010 then
- raise("vsxmake does not support vs version lower than 2010")
end
return function(outputdir)
+
+ -- trace
+ vprint("using project kind vs%d", version)
+
+ -- check
+ assert(version >= 2010, "vsxmake does not support vs version lower than 2010")
+
+ -- get info and params
local info = getinfo(outputdir, vsinfo(version))
local paramsprovidersln = _buildparams(info)