Skip to content

include

starkos edited this page Apr 10, 2021 · 7 revisions

⚠️ We have a new website! Visit now for the most update to date documentation.
       This wiki is no longer being maintained.


Looks for and executes another script file, if it hasn't been run previously.

include("path")

Parameters

path is the file system path to a script file or a directory. If a directory is specified, Premake looks for a file named premake5.lua in that directory and runs it if found.

If the file or directory specified has already been included previously, the call is ignored. If you want to execute the same script multiple times, use Lua's dofile() instead.

Return Value

Any values returned by the included script are passed through to the caller.

Availability

Premake 5.0 or later.

Examples

-- runs "src/MyApplication/premake5.lua"
include "src/MyApplication"

-- runs "my_script.lua" just once
include "my_script.lua"
include "my_script.lua"

See Also

Clone this wiki locally