Merge branch 'master' into toolset-frameworkdirs
This commit is contained in:
commit
0c87f0cc2d
@ -12,7 +12,7 @@ An _action_ indicates what Premake should do on any given run. For instance, the
|
||||
|
||||
An _option_ modifies the behavior of the action. For instance, the `dotnet` option is used to change which .NET compiler set is used in the generated files. Options can accept a value, such as `--dotnet=mono` or act as a flag, like `--with-opengl`.
|
||||
|
||||
From within your script, you can identify the current action with the [`_ACTION`](_ACTION.md) global variable, a string value. You can check for an option using the [`_OPTIONS`](_OPTIONS.md) table, which contains a list of key-value pairs. The key is the option identifier ("dotnet"), which references the command line value ("mono") or an empty string for valueless options.
|
||||
From within your script, you can identify the current action with the [`_ACTION`](premake_ACTION.md) global variable, a string value. You can check for an option using the [`_OPTIONS`](premake_OPTIONS.md) table, which contains a list of key-value pairs. The key is the option identifier ("dotnet"), which references the command line value ("mono") or an empty string for valueless options.
|
||||
|
||||
```lua
|
||||
-- delete a file if the clean action is running
|
||||
|
@ -71,7 +71,7 @@ end)
|
||||
|
||||
This snippet replaces the original implementation of `m.project()` with my new (anonymous) function. From this point on, when someone calls `m.project()`, Premake will call my new function, passing it the original implementation as the first argument (`base`). If the function requires any other arguments (in this case, it receives the project being exported as `prj`) they appear after.
|
||||
|
||||
In our replacement function, we emit our comment header using `premake.w()`, which is short for "premake write", and [_PREMAKE_VERSION](_PREMAKE_VERSION.md), which is a global variable holding the version of the currently running Premake executable.
|
||||
In our replacement function, we emit our comment header using `premake.w()`, which is short for "premake write", and [_PREMAKE_VERSION](premake_PREMAKE_VERSION.md), which is a global variable holding the version of the currently running Premake executable.
|
||||
|
||||
After emitting the comment we call `base(prj)`, the original implementation of `m.project()`, to do the rest of the work for us. Easy!
|
||||
|
||||
|
@ -2,16 +2,16 @@
|
||||
|
||||
| API | Brief |
|
||||
|-----------------------------------------------------------|--------------------|
|
||||
| [_ACTION](_ACTION.md) | The action that will be run |
|
||||
| [_ARGS](_ARGS.md) | Array of action args |
|
||||
| [_MAIN_SCRIPT](_MAIN_SCRIPT.md) | |
|
||||
| [_MAIN_SCRIPT_DIR](_MAIN_SCRIPT_DIR.md) | |
|
||||
| [_OPTIONS](_OPTIONS.md) | |
|
||||
| [_OS](_OS.md) | The currently targeted operating system |
|
||||
| [_PREMAKE_COMMAND](_PREMAKE_COMMAND.md) | |
|
||||
| [_PREMAKE_DIR](_PREMAKE_DIR.md) | |
|
||||
| [_PREMAKE_VERSION](_PREMAKE_VERSION.md) | The version of the currently executing instance of Premake |
|
||||
| [_WORKING_DIR](_WORKING_DIR.md) | |
|
||||
| [_ACTION](premake_ACTION.md) | The action that will be run |
|
||||
| [_ARGS](premake_ARGS.md) | Array of action args |
|
||||
| [_MAIN_SCRIPT](premake_MAIN_SCRIPT.md) | |
|
||||
| [_MAIN_SCRIPT_DIR](premake_MAIN_SCRIPT_DIR.md) | |
|
||||
| [_OPTIONS](premake_OPTIONS.md) | |
|
||||
| [_OS](premake_OS.md) | The currently targeted operating system |
|
||||
| [_PREMAKE_COMMAND](premake_PREMAKE_COMMAND.md) | |
|
||||
| [_PREMAKE_DIR](premake_PREMAKE_DIR.md) | |
|
||||
| [_PREMAKE_VERSION](premake_PREMAKE_VERSION.md) | The version of the currently executing instance of Premake |
|
||||
| [_WORKING_DIR](premake_WORKING_DIR.md) | |
|
||||
| [architecture](architecture.md) | |
|
||||
| [atl](atl.md) | Use Microsoft's Active Template Library |
|
||||
| [basedir](basedir.md) | |
|
||||
|
@ -30,9 +30,9 @@ title: What's New in 5.0
|
||||
|
||||
## New or Modified Globals ##
|
||||
|
||||
* [_MAIN_SCRIPT](_MAIN_SCRIPT.md)
|
||||
* [_MAIN_SCRIPT_DIR](_MAIN_SCRIPT_DIR.md)
|
||||
* [_PREMAKE_DIR](_PREMAKE_DIR.md)
|
||||
* [_MAIN_SCRIPT](premake_MAIN_SCRIPT.md)
|
||||
* [_MAIN_SCRIPT_DIR](premake_MAIN_SCRIPT_DIR.md)
|
||||
* [_PREMAKE_DIR](premake_PREMAKE_DIR.md)
|
||||
|
||||
## New or Modified API calls ##
|
||||
|
||||
|
@ -1,11 +0,0 @@
|
||||
The `_PREMAKE_COMMAND` global variable stores the full path to the Premake executable.
|
||||
|
||||
### Availability ###
|
||||
|
||||
Premake 4.4 or later.
|
||||
|
||||
## See Also ##
|
||||
|
||||
* [_PREMAKE_DIR](_PREMAKE_DIR.md)
|
||||
* [_PREMAKE_VERSION](_PREMAKE_VERSION.md)
|
||||
* [_WORKING_DIR](_WORKING_DIR.md)
|
@ -12,13 +12,13 @@ Any settings that appear after this function in the script will be applied only
|
||||
|
||||
Each keyword must include a prefix to specify which field should be tested. The following field prefixes are currently supported:
|
||||
|
||||
* [action](_ACTION.md)
|
||||
* [action](premake_ACTION.md)
|
||||
* [architecture](architecture.md)
|
||||
* [configurations](configurations.md)
|
||||
* [files](files.md)
|
||||
* [kind](kind.md)
|
||||
* [language](language.md)
|
||||
* [options](_OPTIONS.md)
|
||||
* [options](premake_OPTIONS.md)
|
||||
* [platforms](platforms.md)
|
||||
* [system](system.md)
|
||||
* [toolset](toolset.md)
|
||||
|
@ -29,7 +29,7 @@ workspace "MyWorkspace"
|
||||
location "../build"
|
||||
```
|
||||
|
||||
If you plan to build with multiple tools from the same source tree you might want to split up the project files by toolset. The [_ACTION](_ACTION.md) global variable contains the current toolset identifier, as specified on the command line. Note that Lua syntax requires parenthesis around the function parameters in this case.
|
||||
If you plan to build with multiple tools from the same source tree you might want to split up the project files by toolset. The [_ACTION](premake_ACTION.md) global variable contains the current toolset identifier, as specified on the command line. Note that Lua syntax requires parenthesis around the function parameters in this case.
|
||||
|
||||
```lua
|
||||
location ("../build/" .. _ACTION)
|
||||
|
@ -1,3 +1,7 @@
|
||||
---
|
||||
id: _ACTION
|
||||
---
|
||||
|
||||
The `_ACTION` global variable stores the name of the action to be performed on this execution run. As an example, if this command line was used to launch Premake:
|
||||
|
||||
```
|
||||
@ -12,5 +16,5 @@ Premake 4.0 or later.
|
||||
|
||||
## See Also ##
|
||||
|
||||
* [_ARGS](_ARGS.md)
|
||||
* [_OPTIONS](_OPTIONS.md)
|
||||
* [_ARGS](premake_ARGS.md)
|
||||
* [_OPTIONS](premake_OPTIONS.md)
|
@ -1,3 +1,7 @@
|
||||
---
|
||||
id: _ARGS
|
||||
---
|
||||
|
||||
The `_ARGS` global variable stores any arguments to the current action. As an example, if this command line was used to launch Premake:
|
||||
|
||||
```
|
||||
@ -13,5 +17,5 @@ Premake 4.0 or later.
|
||||
|
||||
## See Also ##
|
||||
|
||||
* [_ACTION](_ACTION.md)
|
||||
* [_OPTIONS](_OPTIONS.md)
|
||||
* [_ACTION](premake_ACTION.md)
|
||||
* [_OPTIONS](premake_OPTIONS.md)
|
@ -1,3 +1,7 @@
|
||||
---
|
||||
id: _MAIN_SCRIPT
|
||||
---
|
||||
|
||||
The `_MAIN_SCRIPT` global variable stores the full path to the main project script. This will be the value passed to the `--file` command line argument, or the location of the initial **premake5.lua** script if no `--file` argument was specified.
|
||||
|
||||
### Availability ###
|
||||
@ -6,6 +10,6 @@ Premake 5.0 or later.
|
||||
|
||||
## See Also ##
|
||||
|
||||
* [_MAIN_SCRIPT_DIR](_MAIN_SCRIPT_DIR.md)
|
||||
* [_PREMAKE_DIR](_PREMAKE_DIR.md)
|
||||
* [_WORKING_DIR](_WORKING_DIR.md)
|
||||
* [_MAIN_SCRIPT_DIR](premake_MAIN_SCRIPT_DIR.md)
|
||||
* [_PREMAKE_DIR](premake_PREMAKE_DIR.md)
|
||||
* [_WORKING_DIR](premake_WORKING_DIR.md)
|
@ -1,3 +1,7 @@
|
||||
---
|
||||
id: _MAIN_SCRIPT_DIR
|
||||
---
|
||||
|
||||
The `_MAIN_SCRIPT_DIR` global variable stores the full path to the directory which contains the main project script. This will be the value passed to the `--file` command line argument, or the location of the initial premake5.lua script if no `--file` argument was specified.
|
||||
|
||||
### Availability ###
|
||||
@ -6,6 +10,6 @@ Premake 5.0 or later.
|
||||
|
||||
## See Also ##
|
||||
|
||||
* [_MAIN_SCRIPT](_MAIN_SCRIPT.md)
|
||||
* [_PREMAKE_DIR](_PREMAKE_DIR.md)
|
||||
* [_WORKING_DIR](_WORKING_DIR.md)
|
||||
* [_MAIN_SCRIPT](premake_MAIN_SCRIPT.md)
|
||||
* [_PREMAKE_DIR](premake_PREMAKE_DIR.md)
|
||||
* [_WORKING_DIR](premake_WORKING_DIR.md)
|
@ -1,3 +1,7 @@
|
||||
---
|
||||
id: _OPTIONS
|
||||
---
|
||||
|
||||
The `_OPTIONS` global variable lists the current set of command line options and their values, if any. For more information, see [Command Line Arguments](Command-Line-Arguments.md).
|
||||
|
||||
### Availability ###
|
||||
@ -6,5 +10,5 @@ Premake 4.0 or later.
|
||||
|
||||
## See Also ##
|
||||
|
||||
* [_ACTION](_ACTION.md)
|
||||
* [_ARGS](_ARGS.md)
|
||||
* [_ACTION](premake_ACTION.md)
|
||||
* [_ARGS](premake_ARGS.md)
|
@ -1,3 +1,7 @@
|
||||
---
|
||||
id: _OS
|
||||
---
|
||||
|
||||
Stores the name of the operating system currently being targeted; see [system()](system.md) for a complete list of OS identifiers.
|
||||
|
||||
The current OS may be overridden on the command line with the `--os` option.
|
15
website/docs/premake_PREMAKE_COMMAND.md
Normal file
15
website/docs/premake_PREMAKE_COMMAND.md
Normal file
@ -0,0 +1,15 @@
|
||||
---
|
||||
id: _PREMAKE_COMMAND
|
||||
---
|
||||
|
||||
The `_PREMAKE_COMMAND` global variable stores the full path to the Premake executable.
|
||||
|
||||
### Availability ###
|
||||
|
||||
Premake 4.4 or later.
|
||||
|
||||
## See Also ##
|
||||
|
||||
* [_PREMAKE_DIR](premake_PREMAKE_DIR.md)
|
||||
* [_PREMAKE_VERSION](premake_PREMAKE_VERSION.md)
|
||||
* [_WORKING_DIR](premake_WORKING_DIR.md)
|
@ -1,3 +1,7 @@
|
||||
---
|
||||
id: _PREMAKE_DIR
|
||||
---
|
||||
|
||||
The `_PREMAKE_DIR` global variable stores the full path to the directory which contains the Premake executable.
|
||||
|
||||
### Availability ###
|
||||
@ -6,5 +10,5 @@ Premake 5.0 or later.
|
||||
|
||||
## See Also ##
|
||||
|
||||
* [_MAIN_SCRIPT_DIR](_MAIN_SCRIPT_DIR.md)
|
||||
* [_WORKING_DIR](_WORKING_DIR.md)
|
||||
* [_MAIN_SCRIPT_DIR](premake_MAIN_SCRIPT_DIR.md)
|
||||
* [_WORKING_DIR](premake_WORKING_DIR.md)
|
@ -1,3 +1,7 @@
|
||||
---
|
||||
id: _PREMAKE_VERSION
|
||||
---
|
||||
|
||||
Stores the version of the currently executing instance of Premake, in the form "major.minor.patch.dev".
|
||||
|
||||
The current development version (i.e. what's in the git repository) uses the development version "dev", as in "5.0.0.dev". When a development release is made, this will become "5.0.0.alpha1", then "5.0.0.alpha2", "5.0.0.beta1" and so on, until the final release "5.0.0".
|
@ -1,3 +1,7 @@
|
||||
---
|
||||
id: _WORKING_DIR
|
||||
---
|
||||
|
||||
The `_WORKING_DIR` global variable stores the full path to the directory which current when Premake was launched.
|
||||
|
||||
### Availability ###
|
||||
@ -6,6 +10,6 @@ Premake 5.0 or later.
|
||||
|
||||
## See Also ##
|
||||
|
||||
* [_MAIN_SCRIPT_DIR](_MAIN_SCRIPT_DIR.md)
|
||||
* [_PREMAKE_DIR](_PREMAKE_DIR.md)
|
||||
* [_WORKING_DIR](_WORKING_DIR.md)
|
||||
* [_MAIN_SCRIPT_DIR](premake_MAIN_SCRIPT_DIR.md)
|
||||
* [_PREMAKE_DIR](premake_PREMAKE_DIR.md)
|
||||
* [_WORKING_DIR](premake_WORKING_DIR.md)
|
@ -58,4 +58,4 @@ require("foo", ">=1.1")
|
||||
|
||||
### See Also ###
|
||||
|
||||
* [_PREMAKE_VERSION](_PREMAKE_VERSION.md)
|
||||
* [_PREMAKE_VERSION](premake_PREMAKE_VERSION.md)
|
||||
|
@ -48,4 +48,4 @@ workspace "MyWorkspace"
|
||||
### See Also ###
|
||||
|
||||
* [architecture](architecture.md)
|
||||
* [_OS](_OS.md)
|
||||
* [_OS](premake_OS.md)
|
||||
|
@ -1,3 +1,7 @@
|
||||
---
|
||||
slug: premake-tags # docusaurus reserves /docs/tags
|
||||
---
|
||||
|
||||
tags
|
||||
|
||||
```lua
|
||||
|
@ -12,12 +12,10 @@
|
||||
"clear": "docusaurus clear"
|
||||
},
|
||||
"dependencies": {
|
||||
"@docusaurus/core": "2.0.0-alpha.70",
|
||||
"@docusaurus/preset-classic": "2.0.0-alpha.70",
|
||||
"@mdx-js/react": "^1.6.21",
|
||||
"clsx": "^1.1.1",
|
||||
"react": "^16.8.4",
|
||||
"react-dom": "^16.8.4"
|
||||
"@docusaurus/core": "2.0.0-beta.6",
|
||||
"@docusaurus/preset-classic": "2.0.0-beta.6",
|
||||
"react": "^17.0.1",
|
||||
"react-dom": "^17.0.1"
|
||||
},
|
||||
"browserslist": {
|
||||
"production": [
|
||||
|
Loading…
Reference in New Issue
Block a user