diff options
| author | ruki <[email protected]> | 2017-07-03 21:34:10 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2017-07-03 21:34:10 +0800 |
| commit | fd8e051b5920bc73354b12d90088591b72e40ee9 (patch) | |
| tree | 9869fd9c32d3fd7076ae6a097af54b9b2839c308 /xmake/plugins | |
| parent | da3ea7a93cb6ff49e48af38b4ee6710cbd4edd52 (diff) | |
fix target name and path for vs201x project plugin
Diffstat (limited to 'xmake/plugins')
| -rw-r--r-- | xmake/plugins/project/vstudio/impl/vs201x.lua | 3 | ||||
| -rw-r--r-- | xmake/plugins/project/vstudio/impl/vs201x_vcxproj.lua | 7 |
2 files changed, 10 insertions, 0 deletions
diff --git a/xmake/plugins/project/vstudio/impl/vs201x.lua b/xmake/plugins/project/vstudio/impl/vs201x.lua index faa265726..cddf6daca 100644 --- a/xmake/plugins/project/vstudio/impl/vs201x.lua +++ b/xmake/plugins/project/vstudio/impl/vs201x.lua @@ -52,6 +52,9 @@ function _make_targetinfo(mode, arch, target) -- save target kind targetinfo.targetkind = target:targetkind() + -- save target file + targetinfo.targetfile = target:targetfile() + -- save sourcebatches targetinfo.sourcebatches = target:sourcebatches() diff --git a/xmake/plugins/project/vstudio/impl/vs201x_vcxproj.lua b/xmake/plugins/project/vstudio/impl/vs201x_vcxproj.lua index ec9c69af4..638390795 100644 --- a/xmake/plugins/project/vstudio/impl/vs201x_vcxproj.lua +++ b/xmake/plugins/project/vstudio/impl/vs201x_vcxproj.lua @@ -215,6 +215,10 @@ function _make_configurations(vcxprojfile, vsinfo, target, vcxprojdir) vcxprojfile:enter("<PropertyGroup Condition=\"\'%$(Configuration)|%$(Platform)\'==\'%s|%s\'\">", targetinfo.mode, targetinfo.arch) vcxprojfile:print("<OutDir>%s\\</OutDir>", path.relative(path.absolute(config.get("buildir")), vcxprojdir)) vcxprojfile:print("<IntDir>%$(Configuration)\\</IntDir>") + vcxprojfile:print("<TargetName>%s</TargetName>", path.basename(targetinfo.targetfile)) + vcxprojfile:print("<TargetExt>%s</TargetExt>", path.extension(targetinfo.targetfile)) + vcxprojfile:print("<TargetPath>%s</TargetPath>", path.relative(path.absolute(targetinfo.targetfile), vcxprojdir)) + if target.kind == "binary" then vcxprojfile:print("<LinkIncremental>true</LinkIncremental>") end @@ -340,6 +344,9 @@ function _make_common_item(vcxprojfile, vsinfo, targetinfo, vcxprojdir) -- make TargetMachine vcxprojfile:print("<TargetMachine>%s</TargetMachine>", ifelse(targetinfo.arch == "x64", "MachineX64", "MachineX86")) + -- make OutputFile + vcxprojfile:print("<OutputFile>%s</OutputFile>", path.relative(path.absolute(targetinfo.targetfile), vcxprojdir)) + vcxprojfile:leave("</Link>") end |
