Skip to content

Commit

Permalink
Merge pull request #2254 from tritao/desktop-system-tags
Browse files Browse the repository at this point in the history
Adds `desktop` system tag to desktop systems.
  • Loading branch information
samsinsane authored Sep 26, 2024
2 parents a5a00d6 + 5bd3969 commit ac4ef40
Show file tree
Hide file tree
Showing 5 changed files with 67 additions and 9 deletions.
16 changes: 8 additions & 8 deletions src/base/os.lua
Original file line number Diff line number Diff line change
Expand Up @@ -804,15 +804,15 @@

os.systemTags =
{
["aix"] = { "aix", "posix" },
["bsd"] = { "bsd", "posix" },
["haiku"] = { "haiku", "posix" },
["aix"] = { "aix", "posix", "desktop" },
["bsd"] = { "bsd", "posix", "desktop" },
["haiku"] = { "haiku", "posix", "desktop" },
["ios"] = { "ios", "darwin", "posix", "mobile" },
["linux"] = { "linux", "posix" },
["macosx"] = { "macosx", "darwin", "posix" },
["solaris"] = { "solaris", "posix" },
["uwp"] = { "uwp", "windows" },
["windows"] = { "windows", "win32" },
["linux"] = { "linux", "posix", "desktop" },
["macosx"] = { "macosx", "darwin", "posix", "desktop" },
["solaris"] = { "solaris", "posix", "desktop" },
["uwp"] = { "uwp", "windows", "desktop" },
["windows"] = { "windows", "win32", "desktop" },
}

function os.getSystemTags(name)
Expand Down
35 changes: 35 additions & 0 deletions website/docs/os.getSystemTags.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
Returns the list of tags corresponding to a system.

There are tags specific to each operating system (see [system()](system.md) for a complete list of identifiers.),
and meta tags like `posix`, `darwin`, `desktop` and `mobile` tags.

### Tags ###

| OS | Tags |
|----------|-----------------------------------------|
| aix | aix, posix, desktop |
| android | android, mobile |
| bsd | bsd, posix, desktop |
| haiku | haiku, posix, desktop |
| ios | ios, darwin, posix, mobile |
| linux | linux, posix, desktop |
| macosx | macosx, darwin, posix, desktop |
| solaris | solaris, posix, desktop |
| uwp | uwp, windows, desktop |
| windows | windows, win32, desktop |

### Examples ###

```lua
print("iOS system tags: " .. table.concat(os.getSystemTags("ios"), ", "))
-- iOS system tags: ios, darwin, posix, mobile
```

### See Also ###
[os.istarget](os.istarget.md)
[os.target](os.target.md)

### Availability ###

Premake 5.0.0 alpha 12 or later.

5 changes: 4 additions & 1 deletion website/docs/os.is.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
:::caution
**This function has been deprecated.** Use [os.target()](os.target.md) or [os.host()](os.host.md) instead.
**This function has been deprecated.** Use [os.istarget()](os.istarget.md), os.target()](os.target.md), or [os.host()](os.host.md) instead.
:::

Checks the current operating system identifier against a particular value.
Expand Down Expand Up @@ -27,4 +27,7 @@ Premake 4.0 or later.

### See Also ###

* [os.istarget](os.istarget.md)
* [os.target](os.target.md)
* [os.host](os.host.md)
* [os.getversion](os.getversion.md)
18 changes: 18 additions & 0 deletions website/docs/os.istarget.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
Checks the target operating system against a particular identifier or tag.
See [os.getSystemTags](os.getSystemTags.md) for documentation about OS tags.

### Examples ###
```lua
print("Android: " .. os.istarget("android"))
print("Mobile: " .. os.istarget("mobile"))
print("Desktop: " .. os.istarget("desktop"))
```

### See Also ###
[os.target](os.target.md)
[os.getSystemTags](os.getSystemTags.md)

### Availability ###

Premake 5.0.0 alpha 12 or later.

2 changes: 2 additions & 0 deletions website/sidebars.js
Original file line number Diff line number Diff line change
Expand Up @@ -386,6 +386,7 @@ module.exports = {
'os.getenv',
'os.getnumcpus',
'os.getpass',
'os.getSystemTags',
'os.getversion',
'os.host',
'os.hostarch',
Expand All @@ -394,6 +395,7 @@ module.exports = {
'os.isdir',
'os.isfile',
'os.islink',
'os.istarget',
'os.locate',
'os.matchdirs',
'os.matchfiles',
Expand Down

0 comments on commit ac4ef40

Please sign in to comment.