Merge pull request #950 from LORgames/ssurtees/gmakeDefaultPlatform
Added defaultplatform support to gmake and gmake2 actions
This commit is contained in:
commit
1279e6baf6
@ -25,13 +25,27 @@
|
|||||||
function make.defaultconfig(target)
|
function make.defaultconfig(target)
|
||||||
-- find the right configuration iterator function for this object
|
-- find the right configuration iterator function for this object
|
||||||
local eachconfig = iif(target.project, project.eachconfig, p.workspace.eachconfig)
|
local eachconfig = iif(target.project, project.eachconfig, p.workspace.eachconfig)
|
||||||
local iter = eachconfig(target)
|
local defaultconfig = nil
|
||||||
|
|
||||||
|
-- find the right default configuration platform, grab first configuration that matches
|
||||||
|
if target.defaultplatform then
|
||||||
|
for cfg in eachconfig(target) do
|
||||||
|
if cfg.platform == target.defaultplatform then
|
||||||
|
defaultconfig = cfg
|
||||||
|
break
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
-- grab the first configuration and write the block
|
-- grab the first configuration and write the block
|
||||||
local cfg = iter()
|
if not defaultconfig then
|
||||||
if cfg then
|
local iter = eachconfig(target)
|
||||||
|
defaultconfig = iter()
|
||||||
|
end
|
||||||
|
|
||||||
|
if defaultconfig then
|
||||||
_p('ifndef config')
|
_p('ifndef config')
|
||||||
_x(' config=%s', cfg.shortname)
|
_x(' config=%s', defaultconfig.shortname)
|
||||||
_p('endif')
|
_p('endif')
|
||||||
_p('')
|
_p('')
|
||||||
end
|
end
|
||||||
|
@ -69,3 +69,19 @@ ifndef config
|
|||||||
endif
|
endif
|
||||||
]]
|
]]
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Verify handling of defaultplatform
|
||||||
|
--
|
||||||
|
|
||||||
|
function suite.defaultsToSpecifiedPlatform()
|
||||||
|
platforms { "Win32", "Win64" }
|
||||||
|
defaultplatform "Win64"
|
||||||
|
prepare()
|
||||||
|
test.capture [[
|
||||||
|
ifndef config
|
||||||
|
config=debug_win64
|
||||||
|
endif
|
||||||
|
]]
|
||||||
|
end
|
||||||
|
@ -20,13 +20,27 @@
|
|||||||
function gmake2.defaultconfig(target)
|
function gmake2.defaultconfig(target)
|
||||||
-- find the right configuration iterator function for this object
|
-- find the right configuration iterator function for this object
|
||||||
local eachconfig = iif(target.project, project.eachconfig, p.workspace.eachconfig)
|
local eachconfig = iif(target.project, project.eachconfig, p.workspace.eachconfig)
|
||||||
local iter = eachconfig(target)
|
local defaultconfig = nil
|
||||||
|
|
||||||
|
-- find the right default configuration platform, grab first configuration that matches
|
||||||
|
if target.defaultplatform then
|
||||||
|
for cfg in eachconfig(target) do
|
||||||
|
if cfg.platform == target.defaultplatform then
|
||||||
|
defaultconfig = cfg
|
||||||
|
break
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
-- grab the first configuration and write the block
|
-- grab the first configuration and write the block
|
||||||
local cfg = iter()
|
if not defaultconfig then
|
||||||
if cfg then
|
local iter = eachconfig(target)
|
||||||
|
defaultconfig = iter()
|
||||||
|
end
|
||||||
|
|
||||||
|
if defaultconfig then
|
||||||
_p('ifndef config')
|
_p('ifndef config')
|
||||||
_x(' config=%s', cfg.shortname)
|
_x(' config=%s', defaultconfig.shortname)
|
||||||
_p('endif')
|
_p('endif')
|
||||||
_p('')
|
_p('')
|
||||||
end
|
end
|
||||||
|
Reference in New Issue
Block a user