diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/_premake_main.lua | 4 | ||||
-rw-r--r-- | src/actions/vstudio/_vstudio.lua | 4 | ||||
-rw-r--r-- | src/base/project.lua | 9 |
3 files changed, 10 insertions, 7 deletions
diff --git a/src/_premake_main.lua b/src/_premake_main.lua index b467677..3dfecfc 100644 --- a/src/_premake_main.lua +++ b/src/_premake_main.lua @@ -112,7 +112,9 @@ -- Some actions imply a particular operating system. Set it early so -- it can be picked up by the scripts. - _OS = premake.actions[_ACTION].os or _OS + if (_ACTION and premake.actions[_ACTION]) then + _OS = premake.actions[_ACTION].os or _OS + end -- If there is a project script available, run it to get the diff --git a/src/actions/vstudio/_vstudio.lua b/src/actions/vstudio/_vstudio.lua index afd3137..cc6dc2b 100644 --- a/src/actions/vstudio/_vstudio.lua +++ b/src/actions/vstudio/_vstudio.lua @@ -317,7 +317,6 @@ shortname = "Visual Studio 2002", description = "Microsoft Visual Studio 2002", os = "windows", - pathstyle = "windows", valid_kinds = { "ConsoleApp", "WindowedApp", "StaticLib", "SharedLib" }, @@ -346,7 +345,6 @@ shortname = "Visual Studio 2003", description = "Microsoft Visual Studio 2003", os = "windows", - pathstyle = "windows", valid_kinds = { "ConsoleApp", "WindowedApp", "StaticLib", "SharedLib" }, @@ -375,7 +373,6 @@ shortname = "Visual Studio 2005", description = "Microsoft Visual Studio 2005 (SharpDevelop, MonoDevelop)", os = "windows", - pathstyle = "windows", valid_kinds = { "ConsoleApp", "WindowedApp", "StaticLib", "SharedLib" }, @@ -404,7 +401,6 @@ shortname = "Visual Studio 2008", description = "Microsoft Visual Studio 2008", os = "windows", - pathstyle = "windows", valid_kinds = { "ConsoleApp", "WindowedApp", "StaticLib", "SharedLib" }, diff --git a/src/base/project.lua b/src/base/project.lua index 10b21dc..c5a20d5 100644 --- a/src/base/project.lua +++ b/src/base/project.lua @@ -253,6 +253,7 @@ local cfgname = iif(cfg.name == cfg.project.name, "", cfg.name) -- how should files be named? + local pathstyle = premake.getpathstyle(cfg) local namestyle = premake.getnamestyle(cfg) local function canlink(source, target) @@ -312,7 +313,7 @@ end if item then - if namestyle == "windows" and part ~= "object" then + if pathstyle == "windows" and part ~= "object" then item = path.translate(item, "\\") end if not table.contains(result, item) then @@ -371,7 +372,11 @@ -- function premake.getpathstyle(cfg) - return premake.actions[_ACTION].pathstyle or "posix" + if premake.actions[_ACTION].os == "windows" then + return "windows" + else + return "posix" + end end |