Bit of code cleanup

This commit is contained in:
starkos 2009-06-08 19:40:13 +00:00
parent 88db91b2f1
commit 3f96e6a87a
8 changed files with 15 additions and 12 deletions

View File

@ -1,4 +1,4 @@
#include "CppConsoleApp.h"
#include "stdafx.h"
int main()
{

View File

@ -12,8 +12,9 @@ project "CppConsoleApp"
libdirs { "../lib" }
links { "CppSharedLib" }
pchheader "CppConsoleApp.h"
pchheader "stdafx.h"
pchsource "stdafx.cpp"
configuration "Debug"
targetdir "../bin/debug (x64)"

View File

@ -0,0 +1 @@
#include "stdafx.h"

View File

@ -1,7 +1,5 @@
solution "PremakeTestbox"
configurations { "Debug", "Release" }
objdir "obj"
-- solution level configuration

View File

@ -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

View File

@ -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" },

View File

@ -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