Bug 2675518: Dependencies wrong on config links
This commit is contained in:
parent
7713434939
commit
b041900f25
@ -26,7 +26,7 @@ RC2 -> RC3
|
||||
|
||||
- Bug 2805763: GCC PCH breaks on path
|
||||
- Bug 2709641: Location field does not propagate to projects
|
||||
|
||||
- Bug 2675518: Dependencies wrong on config links
|
||||
|
||||
RC1 -> RC2
|
||||
|
||||
|
@ -17,6 +17,7 @@ project "CppConsoleApp"
|
||||
|
||||
configuration "Debug"
|
||||
targetdir "../bin/debug (x64)"
|
||||
links { "CppStaticLib" }
|
||||
|
||||
configuration "Release"
|
||||
targetdir "../bin/release (x64)"
|
@ -40,19 +40,7 @@
|
||||
|
||||
-- write the project build rules
|
||||
for _, prj in ipairs(sln.projects) do
|
||||
|
||||
-- before each project rule, build a list of dependencies for the project. If any of
|
||||
-- these dependencies change, the project needs to be rebuilt
|
||||
for _, platform in ipairs(platforms) do
|
||||
for cfg in premake.eachconfig(prj, platform) do
|
||||
_p('ifeq ($(config),%s)', _MAKE.esc(cfg.shortname))
|
||||
_p(' DEPENDENCIES := %s', table.concat(_MAKE.esc(table.extract(premake.getdependencies(cfg), "name")), " "))
|
||||
_p('endif')
|
||||
end
|
||||
end
|
||||
_p('')
|
||||
|
||||
_p('%s: ${DEPENDENCIES}', _MAKE.esc(prj.name))
|
||||
_p('%s: %s', _MAKE.esc(prj.name), table.concat(_MAKE.esc(table.extract(premake.getdependencies(prj), "name")), " "))
|
||||
_p('\t@echo ==== Building %s ====', prj.name)
|
||||
_p('\t@${MAKE} --no-print-directory -C %s -f %s', _MAKE.esc(path.getrelative(sln.location, prj.location)), _MAKE.esc(_MAKE.getmakefilename(prj, true)))
|
||||
_p('')
|
||||
|
@ -173,9 +173,7 @@
|
||||
|
||||
function premake.getconfig(prj, cfgname, pltname)
|
||||
-- might have the root configuration, rather than the actual project
|
||||
if prj.project then
|
||||
prj = prj.project
|
||||
end
|
||||
prj = prj.project or prj
|
||||
|
||||
-- if platform is not included in the solution, use general settings instead
|
||||
if pltname == "Native" or not table.contains(prj.solution.platforms or {}, pltname) then
|
||||
@ -212,19 +210,31 @@
|
||||
|
||||
|
||||
--
|
||||
-- Returns a list of sibling projects on which the specified
|
||||
-- configuration depends. This is used to specify project
|
||||
-- dependencies, usually within a solution.
|
||||
-- Returns a list of sibling projects on which the specified project depends.
|
||||
-- This is used to list dependencies within a solution or workspace. Must
|
||||
-- consider all configurations because Visual Studio does not support per-config
|
||||
-- project dependencies.
|
||||
--
|
||||
-- @param prj
|
||||
-- The project to query.
|
||||
-- @returns
|
||||
-- A list of dependent projects, as an array of objects.
|
||||
--
|
||||
|
||||
function premake.getdependencies(cfg)
|
||||
function premake.getdependencies(prj)
|
||||
-- make sure I've got the project and not root config
|
||||
prj = prj.project or prj
|
||||
|
||||
local results = { }
|
||||
for _, link in ipairs(cfg.links) do
|
||||
local prj = premake.findproject(link)
|
||||
if (prj) then
|
||||
table.insert(results, prj)
|
||||
for _, cfg in pairs(prj.__configs) do
|
||||
for _, link in ipairs(cfg.links) do
|
||||
local dep = premake.findproject(link)
|
||||
if dep and not table.contains(results, dep) then
|
||||
table.insert(results, dep)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
return results
|
||||
end
|
||||
|
||||
|
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user