From 4e283aa257fec00eb9a8e994bf976cc03491fdc2 Mon Sep 17 00:00:00 2001 From: ruki Date: Fri, 30 Jun 2017 14:01:20 +0800 Subject: make headers to builddir for vs201x plugin --- xmake/plugins/project/vstudio/impl/vs201x.lua | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'xmake/plugins/project') diff --git a/xmake/plugins/project/vstudio/impl/vs201x.lua b/xmake/plugins/project/vstudio/impl/vs201x.lua index 1c5921ec8..adb9b00cf 100644 --- a/xmake/plugins/project/vstudio/impl/vs201x.lua +++ b/xmake/plugins/project/vstudio/impl/vs201x.lua @@ -69,6 +69,28 @@ function _make_targetinfo(mode, arch, target) return targetinfo end +-- make target headers +function _make_targetheaders(target) + + -- only for static and shared target + local kind = target:get("kind") + if kind == "static" or kind == "shared" then + + -- make headers + local srcheaders, dstheaders = target:headerfiles() + if srcheaders and dstheaders then + local i = 1 + for _, srcheader in ipairs(srcheaders) do + local dstheader = dstheaders[i] + if dstheader then + os.cp(srcheader, dstheader) + end + i = i + 1 + end + end + end +end + -- make vstudio project function make(outputdir, vsinfo) @@ -135,6 +157,9 @@ function make(outputdir, vsinfo) -- save all sourcefiles and headerfiles _target.sourcefiles = table.unique(table.join(_target.sourcefiles or {}, (target:sourcefiles()))) _target.headerfiles = table.unique(table.join(_target.headerfiles or {}, (target:headerfiles()))) + + -- make target headers + _make_targetheaders(target) end end end -- cgit v1.3.1