summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2016-08-25 09:08:13 +0800
committerruki <[email protected]>2016-08-25 09:08:13 +0800
commit226e6a0594469ca7eff931c0c9da703637bdb762 (patch)
tree9b55c944d0d55a74bae708ea1af49d5eee5b8821
parent503d201bb94ba0de2e9e61ab66e52c1cee648064 (diff)
generate vs201x empty project
-rwxr-xr-xxmake/plugins/project/vstudio/impl/vs201x.lua47
-rwxr-xr-xxmake/plugins/project/vstudio/impl/vs201x_vcxproj.lua43
-rwxr-xr-xxmake/plugins/project/vstudio/vs2010.lua38
-rwxr-xr-xxmake/plugins/project/vstudio/vs2012.lua38
-rwxr-xr-xxmake/plugins/project/vstudio/vs2013.lua38
-rwxr-xr-xxmake/plugins/project/vstudio/vs2015.lua38
-rwxr-xr-xxmake/plugins/project/xmake.lua5
7 files changed, 243 insertions, 4 deletions
diff --git a/xmake/plugins/project/vstudio/impl/vs201x.lua b/xmake/plugins/project/vstudio/impl/vs201x.lua
new file mode 100755
index 000000000..618413056
--- /dev/null
+++ b/xmake/plugins/project/vstudio/impl/vs201x.lua
@@ -0,0 +1,47 @@
+--!The Make-like Build Utility based on Lua
+--
+-- XMake is free software; you can redistribute it and/or modify
+-- it under the terms of the GNU Lesser General Public License as published by
+-- the Free Software Foundation; either version 2.1 of the License, or
+-- (at your option) any later version.
+--
+-- XMake is distributed in the hope that it will be useful,
+-- but WITHOUT ANY WARRANTY; without even the implied warranty of
+-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+-- GNU Lesser General Public License for more details.
+--
+-- You should have received a copy of the GNU Lesser General Public License
+-- along with XMake;
+-- If not, see <a href="http://www.gnu.org/licenses/"> http://www.gnu.org/licenses/</a>
+--
+-- Copyright (C) 2015 - 2016, ruki All rights reserved.
+--
+-- @author ruki
+-- @file vs201x.lua
+--
+
+-- imports
+import("core.project.project")
+import("vs200x_solution")
+import("vs201x_vcxproj")
+
+-- make vstudio project
+function make(outputdir, vsinfo)
+
+ -- enter project directory
+ local olddir = os.cd(project.directory())
+
+ -- init solution directory
+ vsinfo.solution_dir = path.join(outputdir, "vs" .. vsinfo.vstudio_version)
+
+ -- make solution
+ vs200x_solution.make(vsinfo)
+
+ -- make vsprojs
+ for _, target in pairs(project.targets()) do
+ vs201x_vcxproj.make(vsinfo, target)
+ end
+
+ -- leave project directory
+ os.cd(olddir)
+end
diff --git a/xmake/plugins/project/vstudio/impl/vs201x_vcxproj.lua b/xmake/plugins/project/vstudio/impl/vs201x_vcxproj.lua
new file mode 100755
index 000000000..c9ab61b0d
--- /dev/null
+++ b/xmake/plugins/project/vstudio/impl/vs201x_vcxproj.lua
@@ -0,0 +1,43 @@
+--!The Make-like Build Utility based on Lua
+--
+-- XMake is free software; you can redistribute it and/or modify
+-- it under the terms of the GNU Lesser General Public License as published by
+-- the Free Software Foundation; either version 2.1 of the License, or
+-- (at your option) any later version.
+--
+-- XMake is distributed in the hope that it will be useful,
+-- but WITHOUT ANY WARRANTY; without even the implied warranty of
+-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+-- GNU Lesser General Public License for more details.
+--
+-- You should have received a copy of the GNU Lesser General Public License
+-- along with XMake;
+-- If not, see <a href="http://www.gnu.org/licenses/"> http://www.gnu.org/licenses/</a>
+--
+-- Copyright (C) 2015 - 2016, ruki All rights reserved.
+--
+-- @author ruki
+-- @file vs201x_vcxproj.lua
+--
+
+-- imports
+import("core.tool.linker")
+import("core.tool.compiler")
+import("core.project.config")
+import("vsfile")
+
+-- make vcxproj
+function make(vsinfo, target)
+
+ -- the target name
+ local targetname = target:name()
+
+ -- the vcxproj directory
+ local vcxprojdir = path.join(vsinfo.solution_dir, targetname)
+
+ -- open vcxproj file
+ local vcxprojfile = vsfile.open(path.join(vcxprojdir, targetname .. ".vcxproj"), "w")
+
+ -- exit solution file
+ vcxprojfile:close()
+end
diff --git a/xmake/plugins/project/vstudio/vs2010.lua b/xmake/plugins/project/vstudio/vs2010.lua
new file mode 100755
index 000000000..63d418a5c
--- /dev/null
+++ b/xmake/plugins/project/vstudio/vs2010.lua
@@ -0,0 +1,38 @@
+--!The Make-like Build Utility based on Lua
+--
+-- XMake is free software; you can redistribute it and/or modify
+-- it under the terms of the GNU Lesser General Public License as published by
+-- the Free Software Foundation; either version 2.1 of the License, or
+-- (at your option) any later version.
+--
+-- XMake is distributed in the hope that it will be useful,
+-- but WITHOUT ANY WARRANTY; without even the implied warranty of
+-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+-- GNU Lesser General Public License for more details.
+--
+-- You should have received a copy of the GNU Lesser General Public License
+-- along with XMake;
+-- If not, see <a href="http://www.gnu.org/licenses/"> http://www.gnu.org/licenses/</a>
+--
+-- Copyright (C) 2015 - 2016, ruki All rights reserved.
+--
+-- @author ruki
+-- @file vs2010.lua
+--
+
+-- imports
+import("impl.vs201x")
+
+-- make
+function make(outputdir)
+
+ -- init vstudio info
+ local vsinfo =
+ {
+ vstudio_version = "2010"
+ , solution_version = "11"
+ }
+
+ -- make project
+ vs201x.make(outputdir, vsinfo)
+end
diff --git a/xmake/plugins/project/vstudio/vs2012.lua b/xmake/plugins/project/vstudio/vs2012.lua
new file mode 100755
index 000000000..b2a552513
--- /dev/null
+++ b/xmake/plugins/project/vstudio/vs2012.lua
@@ -0,0 +1,38 @@
+--!The Make-like Build Utility based on Lua
+--
+-- XMake is free software; you can redistribute it and/or modify
+-- it under the terms of the GNU Lesser General Public License as published by
+-- the Free Software Foundation; either version 2.1 of the License, or
+-- (at your option) any later version.
+--
+-- XMake is distributed in the hope that it will be useful,
+-- but WITHOUT ANY WARRANTY; without even the implied warranty of
+-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+-- GNU Lesser General Public License for more details.
+--
+-- You should have received a copy of the GNU Lesser General Public License
+-- along with XMake;
+-- If not, see <a href="http://www.gnu.org/licenses/"> http://www.gnu.org/licenses/</a>
+--
+-- Copyright (C) 2015 - 2016, ruki All rights reserved.
+--
+-- @author ruki
+-- @file vs2012.lua
+--
+
+-- imports
+import("impl.vs201x")
+
+-- make
+function make(outputdir)
+
+ -- init vstudio info
+ local vsinfo =
+ {
+ vstudio_version = "2012"
+ , solution_version = "12"
+ }
+
+ -- make project
+ vs201x.make(outputdir, vsinfo)
+end
diff --git a/xmake/plugins/project/vstudio/vs2013.lua b/xmake/plugins/project/vstudio/vs2013.lua
new file mode 100755
index 000000000..080c38a8e
--- /dev/null
+++ b/xmake/plugins/project/vstudio/vs2013.lua
@@ -0,0 +1,38 @@
+--!The Make-like Build Utility based on Lua
+--
+-- XMake is free software; you can redistribute it and/or modify
+-- it under the terms of the GNU Lesser General Public License as published by
+-- the Free Software Foundation; either version 2.1 of the License, or
+-- (at your option) any later version.
+--
+-- XMake is distributed in the hope that it will be useful,
+-- but WITHOUT ANY WARRANTY; without even the implied warranty of
+-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+-- GNU Lesser General Public License for more details.
+--
+-- You should have received a copy of the GNU Lesser General Public License
+-- along with XMake;
+-- If not, see <a href="http://www.gnu.org/licenses/"> http://www.gnu.org/licenses/</a>
+--
+-- Copyright (C) 2015 - 2016, ruki All rights reserved.
+--
+-- @author ruki
+-- @file vs2013.lua
+--
+
+-- imports
+import("impl.vs201x")
+
+-- make
+function make(outputdir)
+
+ -- init vstudio info
+ local vsinfo =
+ {
+ vstudio_version = "2013"
+ , solution_version = "13"
+ }
+
+ -- make project
+ vs201x.make(outputdir, vsinfo)
+end
diff --git a/xmake/plugins/project/vstudio/vs2015.lua b/xmake/plugins/project/vstudio/vs2015.lua
new file mode 100755
index 000000000..657fbbeee
--- /dev/null
+++ b/xmake/plugins/project/vstudio/vs2015.lua
@@ -0,0 +1,38 @@
+--!The Make-like Build Utility based on Lua
+--
+-- XMake is free software; you can redistribute it and/or modify
+-- it under the terms of the GNU Lesser General Public License as published by
+-- the Free Software Foundation; either version 2.1 of the License, or
+-- (at your option) any later version.
+--
+-- XMake is distributed in the hope that it will be useful,
+-- but WITHOUT ANY WARRANTY; without even the implied warranty of
+-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+-- GNU Lesser General Public License for more details.
+--
+-- You should have received a copy of the GNU Lesser General Public License
+-- along with XMake;
+-- If not, see <a href="http://www.gnu.org/licenses/"> http://www.gnu.org/licenses/</a>
+--
+-- Copyright (C) 2015 - 2016, ruki All rights reserved.
+--
+-- @author ruki
+-- @file vs2015.lua
+--
+
+-- imports
+import("impl.vs201x")
+
+-- make
+function make(outputdir)
+
+ -- init vstudio info
+ local vsinfo =
+ {
+ vstudio_version = "2015"
+ , solution_version = "14"
+ }
+
+ -- make project
+ vs201x.make(outputdir, vsinfo)
+end
diff --git a/xmake/plugins/project/xmake.lua b/xmake/plugins/project/xmake.lua
index b978ce046..fa81487de 100755
--- a/xmake/plugins/project/xmake.lua
+++ b/xmake/plugins/project/xmake.lua
@@ -42,10 +42,7 @@ task("project")
{
{'k', "kind", "kv", "makefile", "Set the project kind."
, " - makefile"
- , " - vs2002"
- , " - vs2003"
- , " - vs2005"
- , " - vs2008" }
+ , " - vs2002, vs2003, vs2005, vs2008, vs2010, vs2012, vs2013, vs2015" }
, {nil, "outputdir", "v", ".", "Set the output directory." }
}
})