Added external() to reference non-Premake generated project files

This commit is contained in:
Jason Perkins 2012-06-07 16:46:36 -04:00
parent e926a49c28
commit 1fa3951541
5 changed files with 37 additions and 5 deletions

View File

@ -7,6 +7,7 @@
* Enabled per-configuration file lists
* Enabled per-configuration toolset selection
* Added custom build rules
* Added external() to reference non-Premake generated projects
* Added remove...() API to remove values from list fields
* Folders containing single sub-folder now trimmed from top of source tree
* Added debugformat with C7 support for Visual Studio

View File

@ -151,8 +151,8 @@
end
local location = project.getlocation(prj)
local filename = path.join(location, prj.name) .. extension
return filename
local filename = path.join(location, project.getfilename(prj))
return filename .. extension
end

View File

@ -63,7 +63,7 @@
a.onsolution(sln)
end
for prj in premake.solution.eachproject_ng(sln) do
if a.onproject then
if a.onproject and not prj.external then
a.onproject(prj)
end
end
@ -74,7 +74,7 @@
a.onsolution(sln)
end
for prj in premake.solution.eachproject(sln) do
if a.onproject then
if a.onproject and not prj.external then
a.onproject(prj)
end
end

View File

@ -430,7 +430,7 @@
}
api.register {
name = "flags",
name = "flags",
scope = "config",
kind = "list",
allowed = {
@ -1219,6 +1219,22 @@
end
--
-- Creates a reference to an external, non-Premake generated project.
--
function external(name)
-- define it like a regular project
local prj = project(name)
-- then mark it as external
prj.external = true;
prj.externalname = prj.name
return prj
end
--
-- Define a new action.
--

View File

@ -285,6 +285,21 @@
end
--
-- Retrieve the project's file name.
--
-- @param prj
-- The project object to query.
-- @return
-- The project's file name. This will usually match the project's
-- name, or the external name for externally created projects.
--
function project.getfilename(prj)
return prj.externalname or prj.name
end
--
-- Retrieve the project's file system location.
--