Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/windirstat/windirstat.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOliver Schneider <oliver@assarbad.net>2015-11-15 22:48:52 +0300
committerOliver Schneider <oliver@assarbad.net>2015-11-15 22:48:52 +0300
commit57f06afdb61633745ed144a951ad8eb6de2e899c (patch)
treec1ce51dfc070b2a462088b126e07758a21c6e6a0 /premake4.lua
parentc91d9bb5f4be3bdbc8dd112fd8f68ff4b99d70e4 (diff)
New setvcvars.cmd
Adding contributors for which I received names to the CONTRIBUTORS.txt (still need to add them to the about dialog) Minor corrections to the premake4.lua
Diffstat (limited to 'premake4.lua')
-rw-r--r--premake4.lua31
1 files changed, 29 insertions, 2 deletions
diff --git a/premake4.lua b/premake4.lua
index 4cd9dcf..98c0313 100644
--- a/premake4.lua
+++ b/premake4.lua
@@ -25,12 +25,39 @@ if _OPTIONS["release"] then
_OPTIONS["release"] = pfx
end
do
+ -- This is mainly to support older premake4 builds
+ if not premake.project.getbasename then
+ print "Magic happens ..."
+ -- override the function to establish the behavior we'd get after patching Premake to have premake.project.getbasename
+ premake.project.getbasename = function(prjname, pattern)
+ return pattern:gsub("%%%%", prjname)
+ end
+ -- obviously we also need to overwrite the following to generate functioning VS solution files
+ premake.vstudio.projectfile = function(prj)
+ local pattern
+ if prj.language == "C#" then
+ pattern = "%%.csproj"
+ else
+ pattern = iif(_ACTION > "vs2008", "%%.vcxproj", "%%.vcproj")
+ end
+
+ local fname = premake.project.getbasename(prj.name, pattern)
+ fname = path.join(prj.location, fname)
+ return fname
+ end
+ -- we simply overwrite the original function on older Premake versions
+ premake.project.getfilename = function(prj, pattern)
+ local fname = premake.project.getbasename(prj.name, pattern)
+ fname = path.join(prj.location, fname)
+ return path.getrelative(os.getcwd(), fname)
+ end
+ end
-- Name the project files after their VS version
local orig_getbasename = premake.project.getbasename
premake.project.getbasename = function(prjname, pattern)
- -- The below is used to insert the .vs(8|9|10|11|12) into the file names for projects and solutions
+ -- The below is used to insert the .vs(8|9|10|11|12|14) into the file names for projects and solutions
if _ACTION then
- name_map = {vs2005 = "vs8", vs2008 = "vs9", vs2010 = "vs10", vs2012 = "vs11", vs2013 = "vs12"}
+ name_map = {vs2005 = "vs8", vs2008 = "vs9", vs2010 = "vs10", vs2012 = "vs11", vs2013 = "vs12", vs2015 = "vs14"}
if name_map[_ACTION] then
pattern = pattern:gsub("%%%%", "%%%%." .. name_map[_ACTION])
else