Skip to content

project

starkos edited this page Oct 28, 2013 · 13 revisions

The project function creates a new project, and make it the active configuration scope.

#!lua
project ("name")

Projects contain all of the settings necessary to build a single binary target, and are synonymous with a Visual Studio project. These settings include the list of source code files, the programming language used by those files, compiler flags, include directories, and which libraries to link against.

Every project belongs to a solution.

Parameters

name is the name for the project, which must be unique within the solution which contains the project. If a project with the given name already exists, it is made active and returned.

If no name is given, the current project scope is returned, and also made active.

If "*" is used, the containing solution, which applies to all solutions, is made active and nil is returned.

By default, the project name will be used as the file name of the generated project file; be careful with spaces and special characters. You can override this default with the filename call.

Examples

Create a new project named "MyProject". Note that a solution must exist to contain the project. The indentation is for readability and is optional.

#!lua
solution "MySolution"
   configurations { "Debug", "Release" }

project "MyProject"
   kind "ConsoleApp"
   language "C++"

See Also

Clone this wiki locally