An extension of Lua's require() function which adds support for Premake modules and version checking.
require ("modname", "versions")
Premake will use its extended set of module locations when locating the requested module.
modname
is the name of the module to be loaded. See Locating Scripts for more information about how Premake modules are located.
versions
is an optional string of a version requirements. See the examples below for more information on the format of the requirements string. If the requirements are not met, an error will be raised.
The module object.
Premake 5.0 or later.
Require Premake version 5.0 or later.
require("premake", ">=5.0")
If no operator is specified, defaults to ">=". I think it is a little more readable to include it though.
require("premake", "5.0")
Require a version 5.0 alpha 3 or later.
require("premake", ">=5.0.0-alpha3")
Require anything between Premake version 5.1 and 6.0.
require("premake", ">=5.0 <6.0")
The same rules apply to third-party modules.
require("foo", ">=1.1")