Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/windirstat/premake-4.x-stable.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/base/validate.lua')
-rw-r--r--src/base/validate.lua34
1 files changed, 17 insertions, 17 deletions
diff --git a/src/base/validate.lua b/src/base/validate.lua
index 0274186..82f235f 100644
--- a/src/base/validate.lua
+++ b/src/base/validate.lua
@@ -6,32 +6,32 @@
--
--- Performs a sanity check of all of the solutions and projects
+-- Performs a sanity check of all of the solutions and projects
-- in the session to be sure they meet some minimum requirements.
--
function premake.checkprojects()
local action = premake.action.current()
-
+
for sln in premake.solution.each() do
-
+
-- every solution must have at least one project
if (#sln.projects == 0) then
return nil, "solution '" .. sln.name .. "' needs at least one project"
end
-
+
-- every solution must provide a list of configurations
if (#sln.configurations == 0) then
return nil, "solution '" .. sln.name .. "' needs configurations"
end
-
+
for prj in premake.solution.eachproject(sln) do
-- every project must have a language
if (not prj.language) then
return nil, "project '" ..prj.name .. "' needs a language"
end
-
+
-- and the action must support it
if (action.valid_languages) then
if (not table.contains(action.valid_languages, prj.language)) then
@@ -39,29 +39,29 @@
end
end
- for cfg in premake.eachconfig(prj) do
-
+ for cfg in premake.eachconfig(prj) do
+
-- every config must have a kind
if (not cfg.kind) then
return nil, "project '" ..prj.name .. "' needs a kind in configuration '" .. cfg.name .. "'"
end
-
+
-- and the action must support it
if (action.valid_kinds) then
if (not table.contains(action.valid_kinds, cfg.kind)) then
return nil, "the " .. action.shortname .. " action does not support " .. cfg.kind .. " projects"
end
end
-
+
end
-
+
-- some actions have custom validation logic
if action.oncheckproject then
action.oncheckproject(prj)
end
-
+
end
- end
+ end
return true
end
@@ -73,10 +73,10 @@
function premake.checktools()
local action = premake.action.current()
- if (not action.valid_tools) then
- return true
+ if (not action.valid_tools) then
+ return true
end
-
+
for tool, values in pairs(action.valid_tools) do
if (_OPTIONS[tool]) then
if (not table.contains(values, _OPTIONS[tool])) then
@@ -86,6 +86,6 @@
_OPTIONS[tool] = values[1]
end
end
-
+
return true
end