Merge with premake-dev

This commit is contained in:
Jason Perkins 2011-12-21 16:19:54 -05:00
commit 12b033afc0
8 changed files with 77 additions and 16 deletions

View File

@ -60,6 +60,7 @@ Sony NGP (in progress)
* Patch 3428348: Add .gitignore file (Konstantin Tokarev)
* Patch 3430158: Reorder LINKCMD for Gmake (rjmyst3)
* Patch 3451212: Fix Visual Studio MFC with StaticRuntime
* Patch 3463020: Add windres environment variable for makefiles (icebreaker)
-------

View File

@ -118,7 +118,7 @@
elseif (path.getextension(file) == ".rc") then
_p('$(OBJDIR)/%s.res: %s', _MAKE.esc(path.getbasename(file)), _MAKE.esc(file))
_p('\t@echo $(notdir $<)')
_p('\t$(SILENT) windres $< -O coff -o "$@" $(RESFLAGS)')
_p('\t$(SILENT) $(RESCOMP) $< -O coff -o "$@" $(RESFLAGS)')
end
end
_p('')
@ -161,9 +161,17 @@
_p(' AR = %s', cc.ar)
_p('endif')
_p('')
_p('ifndef RESCOMP')
_p(' ifdef WINDRES')
_p(' RESCOMP = $(WINDRES)')
_p(' else')
_p(' RESCOMP = windres')
_p(' endif')
_p('endif')
_p('')
end
--
-- Write a block of configuration settings.
--

View File

@ -72,9 +72,9 @@
-- kind of binary it produces, and some global settings.
--
function vc2010.configurationPropertyGroup(cfg)
function vc2010.configurationPropertyGroup(cfg, cfginfo)
_p(1,'<PropertyGroup '..if_config_and_platform() ..' Label="Configuration">'
, premake.esc(cfg.name))
, premake.esc(cfginfo.name))
_p(2,'<ConfigurationType>%s</ConfigurationType>',vc2010.config_type(cfg))
_p(2,'<UseDebugLibraries>%s</UseDebugLibraries>', iif(optimisation(cfg) == "Disabled","true","false"))
_p(2,'<CharacterSet>%s</CharacterSet>',iif(cfg.flags.Unicode,"Unicode","MultiByte"))
@ -90,14 +90,6 @@
end
local function config_type_block(prj)
for _, cfginfo in ipairs(prj.solution.vstudio_configs) do
local cfg = premake.getconfig(prj, cfginfo.src_buildcfg, cfginfo.src_platform)
vc2010.configurationPropertyGroup(cfg)
end
end
local function import_props(prj)
for _, cfginfo in ipairs(prj.solution.vstudio_configs) do
local cfg = premake.getconfig(prj, cfginfo.src_buildcfg, cfginfo.src_platform)
@ -573,7 +565,7 @@
for _, cfginfo in ipairs(prj.solution.vstudio_configs) do
local cfg = premake.getconfig(prj, cfginfo.src_buildcfg, cfginfo.src_platform)
vc2010.configurationPropertyGroup(cfg)
vc2010.configurationPropertyGroup(cfg, cfginfo)
end
_p(1,'<Import Project="$(VCTargetsPath)\\Microsoft.Cpp.props" />')

View File

@ -101,6 +101,8 @@
function premake.tree.getlocalpath(node)
if node.parent.path then
return node.name
elseif node.cfg then
return node.cfg.name
else
return node.path
end

View File

@ -24,7 +24,7 @@
premake.bake.buildconfigs()
sln.vstudio_configs = premake.vstudio.buildconfigs(sln)
cfg = premake.getconfig(prj, "Debug", platform)
vc2010.configurationPropertyGroup(cfg)
vc2010.configurationPropertyGroup(cfg, sln.vstudio_configs[1])
end
@ -37,7 +37,7 @@
flags { "MFC" }
prepare()
test.capture [[
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug'" Label="Configuration">
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<CharacterSet>MultiByte</CharacterSet>
@ -50,7 +50,7 @@
flags { "MFC", "StaticRuntime" }
prepare()
test.capture [[
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug'" Label="Configuration">
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<CharacterSet>MultiByte</CharacterSet>

View File

@ -0,0 +1,49 @@
--
-- tests/actions/xcode/test_file_references.lua
-- Verify generation of PBXFileReference section of Xcode project
-- Copyright (c) 2011 Jason Perkins and the Premake project
--
T.xcode3_filerefs = { }
local suite = T.xcode3_filerefs
local xcode = premake.xcode
--
-- Setup and teardown
--
local sln
function suite.setup()
_ACTION = "xcode3"
xcode.used_ids = { } -- reset the list of generated IDs
sln = test.createsolution()
end
local function prepare()
premake.bake.buildconfigs()
xcode.preparesolution(sln)
local prj = premake.solution.getproject(sln, 1)
tr = xcode.buildprjtree(prj)
xcode.PBXFileReference(tr)
end
--
-- Bug #3410213: regression in xcode generation in 4.4 beta3
-- When a location has been set on a project, a file at the top of
-- the source tree (i.e. not in a folder) should use the relative
-- path to the project.
--
function suite.canFindFile_onLocationSet()
location "build"
files "hello.c"
prepare()
test.capture [[
/* Begin PBXFileReference section */
[hello.c] /* hello.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; name = "hello.c"; path = "../hello.c"; sourceTree = "<group>"; };
]]
end

View File

@ -126,6 +126,7 @@
dofile("actions/make/test_wiidev.lua")
-- Xcode3 tests
dofile("actions/xcode/test_file_references.lua")
dofile("actions/xcode/test_xcode_common.lua")
dofile("actions/xcode/test_xcode_project.lua")
dofile("actions/xcode/test_xcode_dependencies.lua")

View File

@ -58,6 +58,14 @@ endif
ifndef AR
AR = ar
endif
ifndef RESCOMP
ifdef WINDRES
RESCOMP = $(WINDRES)
else
RESCOMP = windres
endif
endif
]]
end