summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author Miodrag Milanovic <mmicko@gmail.com>2015-03-05 08:40:11 +0100
committer Miodrag Milanovic <mmicko@gmail.com>2015-03-05 08:40:11 +0100
commitab9dc8369c1a80d75fe685ff058a74c8959d6960 (patch)
tree0e3300fe874db4d103aa05a698d7c076d7fd1e59
parentbc2b71f47f225f21e98325c189742190770b4adf (diff)
sync with latest 3rdparty (nw)
-rw-r--r--3rdparty/bgfx/examples/common/entry/entry_osx.mm47
-rw-r--r--3rdparty/bgfx/examples/common/entry/entry_windows.cpp2
-rw-r--r--3rdparty/bgfx/examples/common/entry/entry_x11.cpp33
-rw-r--r--3rdparty/bgfx/include/bgfx.c99.h7
-rw-r--r--3rdparty/bgfx/include/bgfx.h7
-rw-r--r--3rdparty/bgfx/include/bgfxdefines.h6
-rw-r--r--3rdparty/bgfx/src/bgfx.cpp16
-rw-r--r--3rdparty/bgfx/src/bgfx_compute.sh42
-rw-r--r--3rdparty/bgfx/src/renderer_d3d11.cpp46
-rw-r--r--3rdparty/bgfx/src/renderer_d3d9.cpp46
-rw-r--r--3rdparty/bgfx/src/renderer_gl.cpp75
-rw-r--r--3rdparty/bgfx/src/renderer_gl.h8
-rw-r--r--3rdparty/bx/3rdparty/CL/cl_platform.h2
-rw-r--r--3rdparty/bx/include/bx/uint32_t.h2
-rw-r--r--3rdparty/bx/tools/bin/darwin/geniebin385392 -> 385392 bytes
-rw-r--r--3rdparty/bx/tools/bin/linux/geniebin367968 -> 367968 bytes
-rw-r--r--3rdparty/bx/tools/bin/windows/genie.exebin375296 -> 375808 bytes
-rw-r--r--3rdparty/genie/README.md4
-rw-r--r--3rdparty/genie/docs/scripting-reference.md1945
-rw-r--r--3rdparty/genie/scripting-reference.md2436
-rw-r--r--3rdparty/genie/src/actions/make/make_cpp.lua11
-rw-r--r--3rdparty/genie/src/base/api.lua23
-rw-r--r--3rdparty/genie/src/base/path.lua6
-rw-r--r--3rdparty/genie/src/host/scripts.c46
-rw-r--r--3rdparty/mongoose/docs/Embed.md2
-rw-r--r--3rdparty/mongoose/mongoose.c42
26 files changed, 2311 insertions, 2543 deletions
diff --git a/3rdparty/bgfx/examples/common/entry/entry_osx.mm b/3rdparty/bgfx/examples/common/entry/entry_osx.mm
index eec2e513cff..d09ccb4b45e 100644
--- a/3rdparty/bgfx/examples/common/entry/entry_osx.mm
+++ b/3rdparty/bgfx/examples/common/entry/entry_osx.mm
@@ -16,9 +16,6 @@
#include <bx/os.h>
#include <bx/handlealloc.h>
-#define DEFAULT_WIDTH 1280
-#define DEFAULT_HEIGHT 720
-
@interface AppDelegate : NSObject<NSApplicationDelegate>
{
bool terminated;
@@ -80,7 +77,8 @@ namespace entry
struct Context
{
Context()
- : m_exit(false)
+ : m_scroll(0)
+ , m_exit(false)
{
s_translateKey[27] = Key::Esc;
s_translateKey[13] = Key::Return;
@@ -106,7 +104,7 @@ namespace entry
for (char ch = 'a'; ch <= 'z'; ++ch)
{
- s_translateKey[uint8_t(ch)] =
+ s_translateKey[uint8_t(ch)] =
s_translateKey[uint8_t(ch - ' ')] = Key::KeyA + (ch - 'a');
}
}
@@ -236,10 +234,11 @@ namespace entry
case NSMouseMoved:
case NSLeftMouseDragged:
case NSRightMouseDragged:
+ case NSOtherMouseDragged:
{
int x, y;
getMousePos(&x, &y);
- m_eventQueue.postMouseEvent(s_defaultWindow, x, y, 0);
+ m_eventQueue.postMouseEvent(s_defaultWindow, x, y, m_scroll);
break;
}
@@ -247,7 +246,7 @@ namespace entry
{
int x, y;
getMousePos(&x, &y);
- m_eventQueue.postMouseEvent(s_defaultWindow, x, y, 0, MouseButton::Left, true);
+ m_eventQueue.postMouseEvent(s_defaultWindow, x, y, m_scroll, MouseButton::Left, true);
break;
}
@@ -255,7 +254,7 @@ namespace entry
{
int x, y;
getMousePos(&x, &y);
- m_eventQueue.postMouseEvent(s_defaultWindow, x, y, 0, MouseButton::Left, false);
+ m_eventQueue.postMouseEvent(s_defaultWindow, x, y, m_scroll, MouseButton::Left, false);
break;
}
@@ -263,7 +262,7 @@ namespace entry
{
int x, y;
getMousePos(&x, &y);
- m_eventQueue.postMouseEvent(s_defaultWindow, x, y, 0, MouseButton::Right, true);
+ m_eventQueue.postMouseEvent(s_defaultWindow, x, y, m_scroll, MouseButton::Right, true);
break;
}
@@ -271,7 +270,32 @@ namespace entry
{
int x, y;
getMousePos(&x, &y);
- m_eventQueue.postMouseEvent(s_defaultWindow, x, y, 0, MouseButton::Right, false);
+ m_eventQueue.postMouseEvent(s_defaultWindow, x, y, m_scroll, MouseButton::Right, false);
+ break;
+ }
+
+ case NSOtherMouseDown:
+ {
+ int x, y;
+ getMousePos(&x, &y);
+ m_eventQueue.postMouseEvent(s_defaultWindow, x, y, m_scroll, MouseButton::Middle, true);
+ break;
+ }
+
+ case NSOtherMouseUp:
+ {
+ int x, y;
+ getMousePos(&x, &y);
+ m_eventQueue.postMouseEvent(s_defaultWindow, x, y, m_scroll, MouseButton::Middle, false);
+ break;
+ }
+
+ case NSScrollWheel:
+ {
+ int x, y;
+ getMousePos(&x, &y);
+ m_scroll += ([event deltaY] > 0.0f) ? 1 : -1;
+ m_eventQueue.postMouseEvent(s_defaultWindow, x, y, m_scroll);
break;
}
@@ -364,7 +388,7 @@ namespace entry
[NSApp setMainMenu:menubar];
m_windowAlloc.alloc();
- NSRect rect = NSMakeRect(0, 0, DEFAULT_WIDTH, DEFAULT_HEIGHT);
+ NSRect rect = NSMakeRect(0, 0, ENTRY_DEFAULT_WIDTH, ENTRY_DEFAULT_HEIGHT);
NSWindow* window = [[NSWindow alloc]
initWithContentRect:rect
styleMask:0
@@ -419,6 +443,7 @@ namespace entry
bx::HandleAllocT<ENTRY_CONFIG_MAX_WINDOWS> m_windowAlloc;
NSWindow* m_window[ENTRY_CONFIG_MAX_WINDOWS];
+ int32_t m_scroll;
bool m_exit;
};
diff --git a/3rdparty/bgfx/examples/common/entry/entry_windows.cpp b/3rdparty/bgfx/examples/common/entry/entry_windows.cpp
index 1b3f4f2d45e..335d5cb45b6 100644
--- a/3rdparty/bgfx/examples/common/entry/entry_windows.cpp
+++ b/3rdparty/bgfx/examples/common/entry/entry_windows.cpp
@@ -706,7 +706,7 @@ namespace entry
ScreenToClient(_hwnd, &pt);
int32_t mx = pt.x;
int32_t my = pt.y;
- m_mz += GET_WHEEL_DELTA_WPARAM(_wparam);
+ m_mz += GET_WHEEL_DELTA_WPARAM(_wparam)/WHEEL_DELTA;
m_eventQueue.postMouseEvent(findHandle(_hwnd), mx, my, m_mz);
}
break;
diff --git a/3rdparty/bgfx/examples/common/entry/entry_x11.cpp b/3rdparty/bgfx/examples/common/entry/entry_x11.cpp
index 05080671258..627263faa23 100644
--- a/3rdparty/bgfx/examples/common/entry/entry_x11.cpp
+++ b/3rdparty/bgfx/examples/common/entry/entry_x11.cpp
@@ -267,6 +267,10 @@ namespace entry
initTranslateKey('x', Key::KeyX);
initTranslateKey('y', Key::KeyY);
initTranslateKey('z', Key::KeyZ);
+
+ m_mx = 0;
+ m_my = 0;
+ m_mz = 0;
}
int32_t run(int _argc, char** _argv)
@@ -367,18 +371,19 @@ namespace entry
case ButtonRelease:
{
const XButtonEvent& xbutton = event.xbutton;
- MouseButton::Enum mb;
+ MouseButton::Enum mb = MouseButton::None;
switch (xbutton.button)
{
case Button1: mb = MouseButton::Left; break;
case Button2: mb = MouseButton::Middle; break;
case Button3: mb = MouseButton::Right; break;
- default: mb = MouseButton::None; break;
+ case Button4: ++m_mz; break;
+ case Button5: --m_mz; break;
}
+ WindowHandle handle = findHandle(xbutton.window);
if (MouseButton::None != mb)
{
- WindowHandle handle = findHandle(xbutton.window);
m_eventQueue.postMouseEvent(handle
, xbutton.x
, xbutton.y
@@ -387,6 +392,14 @@ namespace entry
, event.type == ButtonPress
);
}
+ else
+ {
+ m_eventQueue.postMouseEvent(handle
+ , m_mx
+ , m_my
+ , m_mz
+ );
+ }
}
break;
@@ -394,10 +407,14 @@ namespace entry
{
const XMotionEvent& xmotion = event.xmotion;
WindowHandle handle = findHandle(xmotion.window);
+
+ m_mx = xmotion.x;
+ m_my = xmotion.y;
+
m_eventQueue.postMouseEvent(handle
- , xmotion.x
- , xmotion.y
- , 0
+ , m_mx
+ , m_my
+ , m_mz
);
}
break;
@@ -543,6 +560,10 @@ namespace entry
uint8_t m_modifiers;
bool m_exit;
+ int32_t m_mx;
+ int32_t m_my;
+ int32_t m_mz;
+
EventQueue m_eventQueue;
bx::LwMutex m_lock;
bx::HandleAllocT<ENTRY_CONFIG_MAX_WINDOWS> m_windowAlloc;
diff --git a/3rdparty/bgfx/include/bgfx.c99.h b/3rdparty/bgfx/include/bgfx.c99.h
index 7e038e4b7c5..d44b85fba82 100644
--- a/3rdparty/bgfx/include/bgfx.c99.h
+++ b/3rdparty/bgfx/include/bgfx.c99.h
@@ -293,9 +293,10 @@ typedef struct bgfx_caps
/**
* Supported texture formats.
- * 0 - not supported
- * 1 - supported
- * 2 - emulated
+ * `BGFX_CAPS_FORMAT_TEXTURE_NONE` - not supported
+ * `BGFX_CAPS_FORMAT_TEXTURE_COLOR` - supported
+ * `BGFX_CAPS_FORMAT_TEXTURE_EMULATED` - emulated
+ * `BGFX_CAPS_FORMAT_TEXTURE_VERTEX` - supported vertex texture
*/
uint8_t formats[BGFX_TEXTURE_FORMAT_COUNT];
diff --git a/3rdparty/bgfx/include/bgfx.h b/3rdparty/bgfx/include/bgfx.h
index 84ad172de03..f414e5887ad 100644
--- a/3rdparty/bgfx/include/bgfx.h
+++ b/3rdparty/bgfx/include/bgfx.h
@@ -315,9 +315,10 @@ namespace bgfx
uint8_t maxFBAttachments; ///< Maximum frame buffer attachments.
/// Supported texture formats.
- /// - 0 - not supported
- /// - 1 - supported
- /// - 2 - emulated
+ /// - `BGFX_CAPS_FORMAT_TEXTURE_NONE` - not supported
+ /// - `BGFX_CAPS_FORMAT_TEXTURE_COLOR` - supported
+ /// - `BGFX_CAPS_FORMAT_TEXTURE_EMULATED` - emulated
+ /// - `BGFX_CAPS_FORMAT_TEXTURE_VERTEX` - supported vertex texture
uint8_t formats[TextureFormat::Count];
};
diff --git a/3rdparty/bgfx/include/bgfxdefines.h b/3rdparty/bgfx/include/bgfxdefines.h
index ec652508e4b..eb57fdba47c 100644
--- a/3rdparty/bgfx/include/bgfxdefines.h
+++ b/3rdparty/bgfx/include/bgfxdefines.h
@@ -318,6 +318,12 @@
#define BGFX_CAPS_HMD UINT64_C(0x0000000000000800)
///
+#define BGFX_CAPS_FORMAT_TEXTURE_NONE UINT8_C(0x00)
+#define BGFX_CAPS_FORMAT_TEXTURE_COLOR UINT8_C(0x01)
+#define BGFX_CAPS_FORMAT_TEXTURE_EMULATED UINT8_C(0x02)
+#define BGFX_CAPS_FORMAT_TEXTURE_VERTEX UINT8_C(0x04)
+
+///
#define BGFX_VIEW_NONE UINT8_C(0x00)
#define BGFX_VIEW_STEREO UINT8_C(0x01)
diff --git a/3rdparty/bgfx/src/bgfx.cpp b/3rdparty/bgfx/src/bgfx.cpp
index 7d9b5714ce0..7775f60a0ed 100644
--- a/3rdparty/bgfx/src/bgfx.cpp
+++ b/3rdparty/bgfx/src/bgfx.cpp
@@ -902,14 +902,18 @@ namespace bgfx
}
BX_TRACE("Supported texture formats:");
+ BX_TRACE("\t +------ x = supported / * = emulated");
+ BX_TRACE("\t |+----- vertex format");
+ BX_TRACE("\t || +-- name");
for (uint32_t ii = 0; ii < TextureFormat::Count; ++ii)
{
if (TextureFormat::Unknown != ii
&& TextureFormat::UnknownDepth != ii)
{
uint8_t flags = g_caps.formats[ii];
- BX_TRACE("\t[%c] %s"
- , flags&1 ? 'x' : flags&2 ? '*' : ' '
+ BX_TRACE("\t[%c%c] %s"
+ , flags&BGFX_CAPS_FORMAT_TEXTURE_COLOR ? 'x' : flags&BGFX_CAPS_FORMAT_TEXTURE_EMULATED ? '*' : ' '
+ , flags&BGFX_CAPS_FORMAT_TEXTURE_VERTEX ? 'v' : ' '
, getName(TextureFormat::Enum(ii) )
);
BX_UNUSED(flags);
@@ -938,11 +942,11 @@ namespace bgfx
{
BX_CHECK(!m_rendererInitialized, "Already initialized?");
- m_exit = false;
+ m_exit = false;
m_frames = 0;
m_render = &m_frame[0];
m_submit = &m_frame[1];
- m_debug = BGFX_DEBUG_NONE;
+ m_debug = BGFX_DEBUG_NONE;
m_submit->create();
m_render->create();
@@ -1002,9 +1006,9 @@ namespace bgfx
for (uint32_t ii = 0; ii < BX_COUNTOF(s_emulatedFormats); ++ii)
{
- if (0 == g_caps.formats[s_emulatedFormats[ii] ])
+ if (0 == (g_caps.formats[s_emulatedFormats[ii] ] & BGFX_CAPS_FORMAT_TEXTURE_COLOR) )
{
- g_caps.formats[s_emulatedFormats[ii] ] = 2;
+ g_caps.formats[s_emulatedFormats[ii] ] |= BGFX_CAPS_FORMAT_TEXTURE_EMULATED;
}
}
diff --git a/3rdparty/bgfx/src/bgfx_compute.sh b/3rdparty/bgfx/src/bgfx_compute.sh
index 4bb11dcdcd3..d042293d91e 100644
--- a/3rdparty/bgfx/src/bgfx_compute.sh
+++ b/3rdparty/bgfx/src/bgfx_compute.sh
@@ -54,16 +54,29 @@ vec2 unpackHalf2x16(uint _x)
#define NUM_THREADS(_x, _y, _z) [numthreads(_x, _y, _z)]
-vec4 imageLoad(Texture2D _image, ivec2 _uv)
-{
- return _image.Load(uint3(_uv.xy, 0) );
-}
+#define __IMAGE_IMPL(_textureType, _storeComponents, _type, _loadComponents) \
+ _type imageLoad(Texture2D<_textureType> _image, ivec2 _uv) \
+ { \
+ return _image[_uv]._loadComponents; \
+ } \
+ \
+ void imageStore(RWTexture2D<_textureType> _image, ivec2 _uv, _type _value) \
+ { \
+ _image[_uv] = _value._storeComponents; \
+ }
-uint4 imageLoad(Texture2D<uint> _image, ivec2 _uv)
-{
- uint rr = _image.Load(uint3(_uv.xy, 0) );
- return uint4(rr, rr, rr, rr);
-}
+__IMAGE_IMPL(float, x, vec4, xxxx)
+__IMAGE_IMPL(vec2, xy, vec4, xyyy)
+__IMAGE_IMPL(vec3, xyz, vec4, xyzz)
+__IMAGE_IMPL(vec4, xyzw, vec4, xyzw)
+__IMAGE_IMPL(uint, x, uvec4, xxxx)
+__IMAGE_IMPL(uvec2, xy, uvec4, xyyy)
+__IMAGE_IMPL(uvec3, xyz, uvec4, xyzz)
+__IMAGE_IMPL(uvec4, xyzw, uvec4, xyzw)
+__IMAGE_IMPL(int, x, ivec4, xxxx)
+__IMAGE_IMPL(ivec2, xy, ivec4, xyyy)
+__IMAGE_IMPL(ivec3, xyz, ivec4, xyzz)
+__IMAGE_IMPL(ivec4, xyzw, ivec4, xyzw)
uint4 imageLoad(RWTexture2D<uint> _image, ivec2 _uv)
{
@@ -92,16 +105,6 @@ ivec2 imageSize(RWTexture2D<uint> _image)
return result;
}
-void imageStore(RWTexture2D<float4> _image, ivec2 _uv, vec4 _rgba)
-{
- _image[_uv] = _rgba;
-}
-
-void imageStore(RWTexture2D<uint> _image, ivec2 _uv, uvec4 _r)
-{
- _image[_uv] = _r.x;
-}
-
#define __ATOMIC_IMPL_TYPE(_genType, _glFunc, _dxFunc) \
_genType _glFunc(_genType _mem, _genType _data) \
{ \
@@ -153,6 +156,7 @@ uint atomicCompSwap(uint _mem, uint _compare, uint _data)
#define __IMAGE2D_XX(_name, _reg, _access) \
layout(rgba8, binding=_reg) _access uniform highp image2D _name
+#define readwrite
#define IMAGE2D_RO(_name, _reg) __IMAGE2D_XX(_name, _reg, readonly)
#define IMAGE2D_RW(_name, _reg) __IMAGE2D_XX(_name, _reg, readwrite)
#define IMAGE2D_WR(_name, _reg) __IMAGE2D_XX(_name, _reg, writeonly)
diff --git a/3rdparty/bgfx/src/renderer_d3d11.cpp b/3rdparty/bgfx/src/renderer_d3d11.cpp
index e67eacb9a77..81831b514d2 100644
--- a/3rdparty/bgfx/src/renderer_d3d11.cpp
+++ b/3rdparty/bgfx/src/renderer_d3d11.cpp
@@ -1786,6 +1786,9 @@ namespace bgfx
void commitTextureStage()
{
+ m_deviceCtx->VSSetShaderResources(0, BGFX_CONFIG_MAX_TEXTURE_SAMPLERS, m_textureStage.m_srv);
+ m_deviceCtx->VSSetSamplers(0, BGFX_CONFIG_MAX_TEXTURE_SAMPLERS, m_textureStage.m_sampler);
+
m_deviceCtx->PSSetShaderResources(0, BGFX_CONFIG_MAX_TEXTURE_SAMPLERS, m_textureStage.m_srv);
m_deviceCtx->PSSetSamplers(0, BGFX_CONFIG_MAX_TEXTURE_SAMPLERS, m_textureStage.m_sampler);
}
@@ -2369,12 +2372,53 @@ namespace bgfx
ID3D11DeviceContext* deviceCtx = s_renderD3D11->m_deviceCtx;
BX_CHECK(m_dynamic, "Must be dynamic!");
+#if 1
+ BX_UNUSED(_discard);
+ ID3D11Device* device = s_renderD3D11->m_device;
+
+ D3D11_BUFFER_DESC desc;
+ desc.ByteWidth = _size;
+ desc.Usage = D3D11_USAGE_STAGING;
+ desc.BindFlags = 0;
+ desc.MiscFlags = 0;
+ desc.CPUAccessFlags = D3D11_CPU_ACCESS_WRITE;
+ desc.StructureByteStride = 0;
+
+ D3D11_SUBRESOURCE_DATA srd;
+ srd.pSysMem = _data;
+ srd.SysMemPitch = 0;
+ srd.SysMemSlicePitch = 0;
+
+ ID3D11Buffer* ptr;
+ DX_CHECK(device->CreateBuffer(&desc, &srd, &ptr) );
+
+ D3D11_BOX box;
+ box.left = 0;
+ box.top = 0;
+ box.front = 0;
+ box.right = _size;
+ box.bottom = 1;
+ box.back = 1;
+
+ deviceCtx->CopySubresourceRegion(m_ptr
+ , 0
+ , _offset
+ , 0
+ , 0
+ , ptr
+ , 0
+ , &box
+ );
+
+ DX_RELEASE(ptr, 0);
+#else
D3D11_MAPPED_SUBRESOURCE mapped;
BX_UNUSED(_discard);
D3D11_MAP type = D3D11_MAP_WRITE_DISCARD;
DX_CHECK(deviceCtx->Map(m_ptr, 0, type, 0, &mapped));
- memcpy((uint8_t*)mapped.pData + _offset, _data, _size);
+ memcpy( (uint8_t*)mapped.pData + _offset, _data, _size);
deviceCtx->Unmap(m_ptr, 0);
+#endif // 0
}
void VertexBufferD3D11::create(uint32_t _size, void* _data, VertexDeclHandle _declHandle, uint8_t _flags)
diff --git a/3rdparty/bgfx/src/renderer_d3d9.cpp b/3rdparty/bgfx/src/renderer_d3d9.cpp
index 634704065bd..78ff0dce834 100644
--- a/3rdparty/bgfx/src/renderer_d3d9.cpp
+++ b/3rdparty/bgfx/src/renderer_d3d9.cpp
@@ -498,13 +498,23 @@ namespace bgfx
for (uint32_t ii = 0; ii < TextureFormat::Count; ++ii)
{
- g_caps.formats[ii] = SUCCEEDED(m_d3d9->CheckDeviceFormat(m_adapter
+ uint8_t support = SUCCEEDED(m_d3d9->CheckDeviceFormat(m_adapter
, m_deviceType
, adapterFormat
, 0
, D3DRTYPE_TEXTURE
, s_textureFormat[ii].m_fmt
- ) ) ? 1 : 0;
+ ) ) ? BGFX_CAPS_FORMAT_TEXTURE_COLOR : BGFX_CAPS_FORMAT_TEXTURE_NONE;
+
+ support |= SUCCEEDED(m_d3d9->CheckDeviceFormat(m_adapter
+ , m_deviceType
+ , adapterFormat
+ , D3DUSAGE_QUERY_VERTEXTEXTURE
+ , D3DRTYPE_TEXTURE
+ , s_textureFormat[ii].m_fmt
+ ) ) ? BGFX_CAPS_FORMAT_TEXTURE_VERTEX : BGFX_CAPS_FORMAT_TEXTURE_NONE;
+
+ g_caps.formats[ii] = support;
}
}
@@ -1236,16 +1246,18 @@ namespace bgfx
{
for (uint32_t stage = 0; stage < BGFX_CONFIG_MAX_TEXTURE_SAMPLERS; ++stage)
{
- m_samplerFlags[stage] = UINT32_MAX;
+ m_samplerFlags[stage][0] = UINT32_MAX;
+ m_samplerFlags[stage][1] = UINT32_MAX;
}
}
- void setSamplerState(uint8_t _stage, uint32_t _flags)
+ void setSamplerState(uint8_t _stage, uint32_t _flags, bool _vertex = false)
{
const uint32_t flags = _flags&( (~BGFX_TEXTURE_RESERVED_MASK) | BGFX_TEXTURE_SAMPLER_BITS_MASK);
- if (m_samplerFlags[_stage] != flags)
+ BX_CHECK(_stage < BX_COUNTOF(m_samplerFlags), "");
+ if (m_samplerFlags[_stage][_vertex] != flags)
{
- m_samplerFlags[_stage] = flags;
+ m_samplerFlags[_stage][_vertex] = flags;
IDirect3DDevice9* device = m_device;
D3DTEXTUREADDRESS tau = s_textureAddress[(_flags&BGFX_TEXTURE_U_MASK)>>BGFX_TEXTURE_U_SHIFT];
D3DTEXTUREADDRESS tav = s_textureAddress[(_flags&BGFX_TEXTURE_V_MASK)>>BGFX_TEXTURE_V_SHIFT];
@@ -1253,13 +1265,16 @@ namespace bgfx
D3DTEXTUREFILTERTYPE minFilter = s_textureFilter[(_flags&BGFX_TEXTURE_MIN_MASK)>>BGFX_TEXTURE_MIN_SHIFT];
D3DTEXTUREFILTERTYPE magFilter = s_textureFilter[(_flags&BGFX_TEXTURE_MAG_MASK)>>BGFX_TEXTURE_MAG_SHIFT];
D3DTEXTUREFILTERTYPE mipFilter = s_textureFilter[(_flags&BGFX_TEXTURE_MIP_MASK)>>BGFX_TEXTURE_MIP_SHIFT];
- DX_CHECK(device->SetSamplerState(_stage, D3DSAMP_ADDRESSU, tau) );
- DX_CHECK(device->SetSamplerState(_stage, D3DSAMP_ADDRESSV, tav) );
- DX_CHECK(device->SetSamplerState(_stage, D3DSAMP_ADDRESSW, taw) );
- DX_CHECK(device->SetSamplerState(_stage, D3DSAMP_MINFILTER, minFilter) );
- DX_CHECK(device->SetSamplerState(_stage, D3DSAMP_MAGFILTER, magFilter) );
- DX_CHECK(device->SetSamplerState(_stage, D3DSAMP_MIPFILTER, mipFilter) );
- DX_CHECK(device->SetSamplerState(_stage, D3DSAMP_MAXANISOTROPY, m_maxAnisotropy) );
+
+ DWORD stage = (_vertex ? D3DVERTEXTEXTURESAMPLER0 : 0) + _stage;
+
+ DX_CHECK(device->SetSamplerState(stage, D3DSAMP_ADDRESSU, tau) );
+ DX_CHECK(device->SetSamplerState(stage, D3DSAMP_ADDRESSV, tav) );
+ DX_CHECK(device->SetSamplerState(stage, D3DSAMP_ADDRESSW, taw) );
+ DX_CHECK(device->SetSamplerState(stage, D3DSAMP_MINFILTER, minFilter) );
+ DX_CHECK(device->SetSamplerState(stage, D3DSAMP_MAGFILTER, magFilter) );
+ DX_CHECK(device->SetSamplerState(stage, D3DSAMP_MIPFILTER, mipFilter) );
+ DX_CHECK(device->SetSamplerState(stage, D3DSAMP_MAXANISOTROPY, m_maxAnisotropy) );
}
}
@@ -1699,7 +1714,7 @@ namespace bgfx
UniformRegistry m_uniformReg;
void* m_uniforms[BGFX_CONFIG_MAX_UNIFORMS];
- uint32_t m_samplerFlags[BGFX_CONFIG_MAX_TEXTURE_SAMPLERS];
+ uint32_t m_samplerFlags[BGFX_CONFIG_MAX_TEXTURE_SAMPLERS][1];
TextureD3D9* m_updateTexture;
uint8_t* m_updateTextureBits;
@@ -2514,6 +2529,9 @@ namespace bgfx
{
s_renderD3D9->setSamplerState(_stage, 0 == (BGFX_SAMPLER_DEFAULT_FLAGS & _flags) ? _flags : m_flags);
DX_CHECK(s_renderD3D9->m_device->SetTexture(_stage, m_ptr) );
+
+// s_renderD3D9->setSamplerState(_stage, 0 == (BGFX_SAMPLER_DEFAULT_FLAGS & _flags) ? _flags : m_flags, true);
+// DX_CHECK(s_renderD3D9->m_device->SetTexture(D3DVERTEXTEXTURESAMPLER0 + _stage, m_ptr) );
}
void TextureD3D9::resolve() const
diff --git a/3rdparty/bgfx/src/renderer_gl.cpp b/3rdparty/bgfx/src/renderer_gl.cpp
index f5caa585dcd..d01f41b075f 100644
--- a/3rdparty/bgfx/src/renderer_gl.cpp
+++ b/3rdparty/bgfx/src/renderer_gl.cpp
@@ -236,6 +236,59 @@ namespace bgfx
};
BX_STATIC_ASSERT(TextureFormat::Count == BX_COUNTOF(s_textureFormat) );
+ static GLenum s_rboFormat[] =
+ {
+ GL_ZERO, // BC1
+ GL_ZERO, // BC2
+ GL_ZERO, // BC3
+ GL_ZERO, // BC4
+ GL_ZERO, // BC5
+ GL_ZERO, // BC6H
+ GL_ZERO, // BC7
+ GL_ZERO, // ETC1
+ GL_ZERO, // ETC2
+ GL_ZERO, // ETC2A
+ GL_ZERO, // ETC2A1
+ GL_ZERO, // PTC12
+ GL_ZERO, // PTC14
+ GL_ZERO, // PTC12A
+ GL_ZERO, // PTC14A
+ GL_ZERO, // PTC22
+ GL_ZERO, // PTC24
+ GL_ZERO, // Unknown
+ GL_ZERO, // R1
+ GL_R8, // R8
+ GL_R16, // R16
+ GL_R16F, // R16F
+ GL_R32UI, // R32
+ GL_R32F, // R32F
+ GL_RG8, // RG8
+ GL_RG16, // RG16
+ GL_RG16F, // RG16F
+ GL_RG32UI, // RG32
+ GL_RG32F, // RG32F
+ GL_RGBA8, // BGRA8
+ GL_RGBA16, // RGBA16
+ GL_RGBA16F, // RGBA16F
+ GL_RGBA32UI, // RGBA32
+ GL_RGBA32F, // RGBA32F
+ GL_RGB565, // R5G6B5
+ GL_RGBA4, // RGBA4
+ GL_RGB5_A1, // RGB5A1
+ GL_RGB10_A2, // RGB10A2
+ GL_R11F_G11F_B10F, // R11G11B10F
+ GL_ZERO, // UnknownDepth
+ GL_DEPTH_COMPONENT16, // D16
+ GL_DEPTH_COMPONENT24, // D24
+ GL_DEPTH24_STENCIL8, // D24S8
+ GL_DEPTH_COMPONENT32, // D32
+ GL_DEPTH_COMPONENT32F, // D16F
+ GL_DEPTH_COMPONENT32F, // D24F
+ GL_DEPTH_COMPONENT32F, // D32F
+ GL_STENCIL_INDEX8, // D0S8
+ };
+ BX_STATIC_ASSERT(TextureFormat::Count == BX_COUNTOF(s_rboFormat) );
+
static GLenum s_imageFormat[] =
{
GL_ZERO, // BC1
@@ -1115,12 +1168,7 @@ namespace bgfx
{
setTextureFormat(TextureFormat::D32, GL_DEPTH_COMPONENT, GL_DEPTH_COMPONENT, GL_UNSIGNED_INT);
- if (BX_ENABLED(BGFX_CONFIG_RENDERER_OPENGLES >= 30) )
- {
- setTextureFormat(TextureFormat::R16, GL_R16UI, GL_RED_INTEGER, GL_UNSIGNED_SHORT);
- setTextureFormat(TextureFormat::RGBA16, GL_RGBA16UI, GL_RGBA_INTEGER, GL_UNSIGNED_SHORT);
- }
- else
+ if (BX_ENABLED(BGFX_CONFIG_RENDERER_OPENGLES < 30) )
{
setTextureFormat(TextureFormat::RGBA16F, GL_RGBA, GL_RGBA, GL_HALF_FLOAT);
@@ -1132,6 +1180,17 @@ namespace bgfx
}
}
+ if (BX_ENABLED(BGFX_CONFIG_RENDERER_OPENGL)
+ || BX_ENABLED(BGFX_CONFIG_RENDERER_OPENGLES >= 30) )
+ {
+ setTextureFormat(TextureFormat::R16, GL_R16UI, GL_RED_INTEGER, GL_UNSIGNED_SHORT);
+ setTextureFormat(TextureFormat::RG16, GL_RG16UI, GL_RG_INTEGER, GL_UNSIGNED_SHORT);
+ setTextureFormat(TextureFormat::RGBA16, GL_RGBA16UI, GL_RGBA_INTEGER, GL_UNSIGNED_SHORT);
+ setTextureFormat(TextureFormat::R32, GL_R32UI, GL_RED_INTEGER, GL_UNSIGNED_INT);
+ setTextureFormat(TextureFormat::RG32, GL_RG32UI, GL_RG_INTEGER, GL_UNSIGNED_INT);
+ setTextureFormat(TextureFormat::RGBA32, GL_RGBA32UI, GL_RGBA_INTEGER, GL_UNSIGNED_INT);
+ }
+
if (s_extension[Extension::EXT_texture_format_BGRA8888 ].m_supported
|| s_extension[Extension::EXT_bgra ].m_supported
|| s_extension[Extension::IMG_texture_format_BGRA8888 ].m_supported
@@ -3140,7 +3199,7 @@ namespace bgfx
if (0 == msaaQuality)
{
GL_CHECK(glRenderbufferStorage(GL_RENDERBUFFER
- , s_textureFormat[m_textureFormat].m_internalFmt
+ , s_rboFormat[m_textureFormat]
, _width
, _height
) );
@@ -3149,7 +3208,7 @@ namespace bgfx
{
GL_CHECK(glRenderbufferStorageMultisample(GL_RENDERBUFFER
, msaaQuality
- , s_textureFormat[m_textureFormat].m_internalFmt
+ , s_rboFormat[m_textureFormat]
, _width
, _height
) );
diff --git a/3rdparty/bgfx/src/renderer_gl.h b/3rdparty/bgfx/src/renderer_gl.h
index 626b85343a2..b65a8499670 100644
--- a/3rdparty/bgfx/src/renderer_gl.h
+++ b/3rdparty/bgfx/src/renderer_gl.h
@@ -143,6 +143,10 @@ typedef uint64_t GLuint64;
# define GL_RG16 0x822C
#endif // GL_RG16
+#ifndef GL_RG16UI
+# define GL_RG16UI 0x823A
+#endif // GL_RG16UI
+
#ifndef GL_RG16F
# define GL_RG16F 0x822F
#endif // GL_RG16F
@@ -183,6 +187,10 @@ typedef uint64_t GLuint64;
# define GL_RG 0x8227
#endif // GL_RG
+#ifndef GL_RG_INTEGER
+# define GL_RG_INTEGER 0x8228
+#endif // GL_RG_INTEGER
+
#ifndef GL_GREEN
# define GL_GREEN 0x1904
#endif // GL_GREEN
diff --git a/3rdparty/bx/3rdparty/CL/cl_platform.h b/3rdparty/bx/3rdparty/CL/cl_platform.h
index cf2b7210ac8..46b3d9dcdc3 100644
--- a/3rdparty/bx/3rdparty/CL/cl_platform.h
+++ b/3rdparty/bx/3rdparty/CL/cl_platform.h
@@ -92,7 +92,7 @@ extern "C" {
#define CL_EXT_SUFFIX__VERSION_1_1_DEPRECATED __attribute__((deprecated))
#define CL_EXT_PREFIX__VERSION_1_1_DEPRECATED
#endif
- #elif _WIN32
+ #elif defined(_WIN32)
#ifdef CL_USE_DEPRECATED_OPENCL_1_0_APIS
#define CL_EXT_SUFFIX__VERSION_1_0_DEPRECATED
#define CL_EXT_PREFIX__VERSION_1_0_DEPRECATED
diff --git a/3rdparty/bx/include/bx/uint32_t.h b/3rdparty/bx/include/bx/uint32_t.h
index c979d7fdb25..ce04e047721 100644
--- a/3rdparty/bx/include/bx/uint32_t.h
+++ b/3rdparty/bx/include/bx/uint32_t.h
@@ -669,7 +669,7 @@ namespace bx
inline uint64_t uint64_cnttz(uint64_t _val)
{
#if BX_COMPILER_GCC || BX_COMPILER_CLANG
- return __builtin_ctz(_val);
+ return __builtin_ctzl(_val);
#elif BX_COMPILER_MSVC && BX_PLATFORM_WINDOWS && BX_ARCH_64BIT
unsigned long index;
_BitScanForward64(&index, _val);
diff --git a/3rdparty/bx/tools/bin/darwin/genie b/3rdparty/bx/tools/bin/darwin/genie
index 865e7d8cf47..06223fe5d47 100644
--- a/3rdparty/bx/tools/bin/darwin/genie
+++ b/3rdparty/bx/tools/bin/darwin/genie
Binary files differ
diff --git a/3rdparty/bx/tools/bin/linux/genie b/3rdparty/bx/tools/bin/linux/genie
index b8cf8cc08e3..2be4634fac3 100644
--- a/3rdparty/bx/tools/bin/linux/genie
+++ b/3rdparty/bx/tools/bin/linux/genie
Binary files differ
diff --git a/3rdparty/bx/tools/bin/windows/genie.exe b/3rdparty/bx/tools/bin/windows/genie.exe
index 6b03902d33c..f14714e3760 100644
--- a/3rdparty/bx/tools/bin/windows/genie.exe
+++ b/3rdparty/bx/tools/bin/windows/genie.exe
Binary files differ
diff --git a/3rdparty/genie/README.md b/3rdparty/genie/README.md
index 509e23c02a5..5f26ab8a49d 100644
--- a/3rdparty/genie/README.md
+++ b/3rdparty/genie/README.md
@@ -14,7 +14,7 @@ Supported project generators:
Download (stable)
-----------------
- version 181 (commit 6b59593a0a812fea6c5caaf6a50772076a6e5637)
+ version 197 (commit 2b34cf0f0831d265b274d8e11a24bf6320d73d6e)
Linux:
https://github.com/bkaradzic/bx/raw/master/tools/bin/linux/genie
@@ -35,7 +35,7 @@ Building (dev)
Documentation
-------------
-[Scripting Reference](https://github.com/bkaradzic/genie/blob/master/scripting-reference.md)
+[Scripting Reference](https://github.com/bkaradzic/genie/blob/master/docs/scripting-reference.md#scripting-reference)
History
-------
diff --git a/3rdparty/genie/docs/scripting-reference.md b/3rdparty/genie/docs/scripting-reference.md
new file mode 100644
index 00000000000..02a8fb4b653
--- /dev/null
+++ b/3rdparty/genie/docs/scripting-reference.md
@@ -0,0 +1,1945 @@
+# Scripting Reference
+
+## Table of Contents
+
+* Predefined Variables
+ * [_ACTION](#_action)
+ * [_ARGS](#_args)
+ * [_OPTIONS](#_options)
+ * [_PREMAKE_COMMAND](#_premake_command)
+ * [_PREMAKE_VERSION](#_premake_version)
+ * [_SCRIPT](#_script)
+ * [_WORKING_DIR](#_working_dir)
+* Script Functions
+ * [buildaction](#buildactionaction)
+ * [buildoptions](#buildoptionsoptions)
+ * [configuration](#configurationkeywords)
+ * [configurations](#configurationsnames)
+ * [debugargs](#debugargsargs)
+ * [debugdir](#debugdirpath)
+ * [defines](#definessymbols)
+ * [deploymentoptions](#deploymentoptionsoptions)
+ * [excludes](#excludesfiles)
+ * [files](#filesfiles)
+ * [flags](#flagsflags)
+ * [framework](#frameworkversion)
+ * [iif](#iifcondition-trueval-falseval)
+ * [imageoptions](#imageoptionsoptions)
+ * [imagepath](#imagepathpath)
+ * [implibdir](#implibdir)
+ * [implibextension](#implibextensionextension)
+ * [implibname](#implibnamename)
+ * [implibprefix](#implibprefixprefix)
+ * [implibsuffix](#implibsuffixsuffix)
+ * [include](#includedirectory)
+ * [includedirs](#includedirspaths)
+ * [kind](#kindkind)
+ * [language](#languagelang)
+ * [libdirs](#libdirspaths)
+ * [linkoptions](#linkoptionsoptions)
+ * [links](#linksreferences)
+ * [location](#locationpath)
+ * [newaction](#newactiondescription)
+ * [newoption](#newoptionsdescription)
+ * [objdir](#objdirpath)
+ * [os.chdir](#oschdirpath)
+ * [os.copyfile](#oscopyfilesource-destination)
+ * [os.findlib](#osfindliblibname)
+ * [os.get](#osget)
+ * [os.getcwd](#osgetcwd)
+ * [os.getversion](#osgetversion)
+ * [os.is](#osisid)
+ * [os.is64bit](#osis64bit)
+ * [os.isdir](#osisdirpath)
+ * [os.isfile](#osisfilepath)
+ * [os.matchdirs](#osmatchdirspattern)
+ * [os.matchfiles](#osmatchfilespatterns)
+ * [os.mkdir](#osmkdirpath)
+ * [os.outputof](#osoutputofcommand)
+ * [os.pathsearch](#ospathsearchfname-paths)
+ * [os.rmdir](#osrmdirpath)
+ * [os.stat](#osstatpath)
+ * [os.uuid](#osuuid)
+ * [path.getabsolute](#pathgetabsolutepath)
+ * [path.getbasename](#pathgetbasenamepath)
+ * [path.getdirectory](#pathgetdirectorypath)
+ * [path.getdrive](#pathgetdrivepath)
+ * [path.getextension](#pathgetextension)
+ * [path.getname](#pathgetnamepath)
+ * [path.getrelative](#pathgetrelativesrc-dest)
+ * [path.isabsolute](#pathisabsolutepath)
+ * [path.iscfile](#pathiscfilepath)
+ * [path.iscppfile](#pathiscppfilepath)
+ * [path.isresourcefile](#pathisresourcefilepath)
+ * [path.join](#pathjoinleading-trailing)
+ * [path.rebase](#pathrebasepath-oldbase-newbase)
+ * [path.translate](#pathtranslatepath-newsep)
+ * [pchheader](#pchheaderfile)
+ * [pchsource](#pchsourcefile)
+ * [platforms](#platformsidentifiers)
+ * [postbuildcommands](#postbuildcommandscommands)
+ * [prebuildcommands](#prebuildcommandscommands)
+ * [prelinkcommands](#prelinkcommandscommands)
+ * [printf](#printfformat-args)
+ * [project](#projectname)
+ * [resdefines](#resdefinessymbols)
+ * [resincludedirs](#resincludedirspaths)
+ * [resoptions](#resoptionsoptions)
+ * [solution](#solutionname)
+ * [string.endswith](#stringendswithhaystack-needle)
+ * [string.explode](#stringexplodestr-pattern)
+ * [string.findlast](#stringfindlaststr-pattern-plain)
+ * [string.startswith](#stringstartswithhaystack-needle)
+ * [table.contains](#tablecontainsarray-value)
+ * [table.implode](#tableimplodearray-before-after-between)
+ * [targetdir](#targetdirpath)
+ * [targetextension](#targetextensionext)
+ * [targetname](#targetnamename)
+ * [targetprefix](#targetprefixprefix)
+ * [targetsuffix](#targetsuffixsuffix)
+ * [uuid](#uuidprojectuuid)
+ * [vpaths](#vpathsgroup--pattern)
+* Additional Information
+ * [Wildcards](#wildcards)
+
+---
+
+## Predefined Variables
+
+Each of the following variables is available for use in any GENie script.
+
+### _ACTION
+
+Name of the action to be performed on this execution run.
+
+`$ genie vs2005`
+
+produces
+
+`_ACTION: "vs2005"`
+
+[Back to top](#table-of-contents)
+
+---
+### _ARGS
+
+Any arguments to the current action.
+
+`$ genie vs2015 alpha beta`
+
+produces
+
+`_ARGS[0]: "alpha"`
+`_ARGS[1]: "beta"`
+
+[Back to top](#table-of-contents)
+
+---
+### _OPTIONS
+
+Current set of command line options and their values, if any.
+
+`$ genie vs2015 --gfxapi=directx`
+
+produces
+
+`_OPTIONS['gfxapi']: "directx"`
+
+**Note:** Options may be registered with [newoption](#newoption) to fully integrate them into the CLI.
+
+[Back to top](#table-of-contents)
+
+---
+### _PREMAKE_COMMAND
+
+Full path to the GENie (Premake) executable.
+
+[Back to top](#table-of-contents)
+
+---
+### _PREMAKE_VERSION
+
+GENie (Premake) version.
+
+[Back to top](#table-of-contents)
+
+---
+### _SCRIPT
+
+Full path to the currently executing script.
+
+[Back to top](#table-of-contents)
+
+---
+### _WORKING_DIR
+
+Current working directory.
+
+[Back to top](#table-of-contents)
+
+---
+
+## Script Functions
+
+### buildaction(_action_)
+Specifies what action should be performed on a set of files during compilation. Usually paired with a configuration filter to select a file set. If no build action is specified for a file, a default action will be used (chosen based on the file's extension).
+
+**Scope:** solutions, projects, configurations
+
+**Note:** only supported for .NET projects, and not for C or C++.
+
+#### Arguments
+_action_ - the action to be performed. One of:
+* "Compile" - treat the file as source code: compile and run it
+* "Embed" - embed the file into the target binary as a resource
+* "Copy" - copy the file to the target directory
+* "None" - do nothing with this file
+
+#### Examples
+Embed all PNGs into the target binary
+```lua
+configuration "**.png"
+ buildaction "Embed"
+```
+[Back to top](#table-of-contents)
+
+---
+### buildoptions({_options_...})
+Passes arguments direction to the compiler command line. Multiple calls in a project will be concatenated in order.
+
+**Scope:** solutions, projects, configurations
+
+#### Arguments
+_options_ - list of compiler flags
+
+#### Examples
+Add some GCC-specific options
+```lua
+configuration {"linux", "gmake"}
+ buildoptions {"-ansi", "-pedantic"}
+```
+[Back to top](#table-of-contents)
+
+---
+### configuration({_keywords_...})
+Limits subsequent build settings to a particular environment. Acts as a filter, only applying settings that appear after this function if the environment matches the keywords.
+
+#### Arguments
+_keywords_ - list of identifiers to compare to the current runtime environment
+
+Possible values:
+* Configuration names - configuration names passed to [configurations](#configurations)
+* Action names - "vs2015", "gmake", etc.
+* Operating system names - "windows", "macosx", etc.
+* Platform names - "ps3", "xbox360", etc.
+* Command-line options - either built-in or custom
+* File names - very limited, but some settings can be applied to specific files
+
+You may also use "*" and "**" wildcards, as well as "not" and "or".
+
+#### Return
+Current configuration object with the following fields:
+* _buildaction_ - build action.
+* _buildoptions_ - list of compiler options.
+* _defines_ - list of compiler symbols.
+* _excludes_ - list of excluded files.
+* _files_ - list of files.
+* _flags_ - list of build flags.
+* _implibdir_ - import library directory.
+* _implibextension_ - import library file extension.
+* _implibname_ - import library base file name.
+* _implibprefix_ - import library file name prefix.
+* _implibsuffix_ - import library file name suffix.
+* _includedirs_ - list of include file search directories.
+* _keywords_ - list of keywords associated with the block.
+* _kind_ - target kind.
+* _libdirs_ - list of library search directories.
+* _linkoptions_ - list of linker options.
+* _links_ - list of libraries or assemblies to link against.
+* _objdir_ - objects and intermediate files directory.
+* _pchheader_ - target file name for precompiled header support.
+* _pchsource_ - target source file name for precompiled header support.
+* _prebuildcommands_ - list of pre-build commands.
+* _prelinkcommands_ - list of pre-link commands.
+* _postbuildcommands_ - list of post-build commands.
+* _resdefines_ - list of symbols for the resource compiler.
+* _resincludedirs_ - list of include file search paths for the resource compiler.
+* _resoptions_ - list of resource compiler options.
+* _targetdir_ - target output directory.
+* _targetextension_ - target file extension.
+* _targetname_ - target base file name.
+* _targetprefix_ - target file name prefix.
+* _targetsuffix_ - target file name suffix.
+* _terms_ - filter terms passed to the configuration function to create the block (i.e. "Debug").
+
+#### Examples
+Define debug symbol for debug configurations
+```lua
+configuration "Debug"
+ defines { "DEBUG" }
+```
+
+Define a symbol based on a wildcard
+```lua
+configuration "vs*"
+ defines { "VISUAL_STUDIO_2005" }
+```
+
+Define a symbol based on an "or"
+```lua
+configuration "linux or macosx"
+ defines { "LINUX_OR_MACOSX" }
+```
+
+Define a symbol based on a "not"
+```lua
+configuration "not windows"
+ defines { "NOT_WINDOWS" }
+```
+
+Reset the configuration filter
+```lua
+configuration {}
+```
+[Back to top](#table-of-contents)
+
+---
+### configurations({_names_...})
+Defines a set of build configurations, such as "Debug" and "Release". Must be specified before any projects are defined, so can't be called after a project has been defined.
+
+**Scope:** solutions
+
+#### Arguments
+_names_ - list of configuration names
+
+#### Return Value
+When called with no arguments - list of current configuration names
+
+#### Examples
+Specify configurations for a solution
+```lua
+solution "MySolution"
+ configurations { "Debug", "Release" }
+```
+
+Add additional configurations
+```lua
+configurations{ "Debug", "Release", "DebugDLL", "ReleaseDLL" }
+```
+
+Retrieve current list of configurations
+```lua
+local cfgs = configurations()
+```
+[Back to top](#table-of-contents)
+
+---
+### debugargs({_args_...})
+Specifies a list of arguments to pas to the application when run under the debugger.
+
+**Note:** Not implemented for Xcode 3, where it must be configured in a per-user config file.
+
+**Note:** In Visual Studio, this can be overridden by a per-user config file (e.g. ProjectName.vcxproj.MYDOMAIN-MYUSERNAME.user). Removing this file (`genie clean`) will restore the default settings.
+
+**Scope:** solutions, projects, configurations
+
+#### Arguments
+_args_ - list of arguments to pas to the executable while debugging
+
+#### Examples
+```lua
+configuration "Debug"
+ debugargs { "--append", "somefile.txt" }
+```
+[Back to top](#table-of-contents)
+
+---
+### debugdir(_path_)
+Sets the working directory for the integrated debugger.
+
+**Note:** Not implemented for Xcode 3, where it must be configured in a per-user config file.
+
+**Note:** In Visual Studio, this can be overridden by a per-user config file (e.g. ProjectName.vcxproj.MYDOMAIN-MYUSERNAME.user). Removing this file (`genie clean`) will restore the default settings.
+
+**Scope:** solutions, projects, configurations
+
+#### Arguments
+_path_ - path to the working directory, relative to the currently-executing script file
+
+#### Examples
+```lua
+configuration "Debug"
+ debugdir "bin/debug"
+```
+[Back to top](#table-of-contents)
+
+---
+### defines({_symbols_...})
+Adds preprocessor or compiler symbols to the project. Multiple calls are concatenated.
+
+**Scope:** solutions, projects, configurations
+
+#### Arguments
+_symbols_ - list of symbols
+
+#### Examples
+Define two new symbols
+```lua
+defines { "DEBUG", "TRACE" }
+```
+
+Assign a symbol value
+```lua
+defines { "CALLSPEC=__dllexport" }
+```
+[Back to top](#table-of-contents)
+
+---
+### deploymentoptions({_options_...})
+Passes arguments directly to the deployment tool command line. Multiple calls are concatenated.
+
+**Note:** Currently only supported for Xbox 360 targets.
+
+**Scope:** solutions, projects, configurations
+
+#### Arguments
+_options_ - list of arguments
+
+[Back to top](#table-of-contents)
+
+---
+### excludes({_files_...})
+Removes files added with the [`files`](#files) function. Multiple calls are concatenated.
+
+**Note:** May be set on the solution, project, or configuration, but only project-level file lists are currently supported.
+
+**Scope:** solutions, projects, configurations
+
+#### Arguments
+_files_ - List of files to exclude. Paths should be relative to the currently-executing script file and may contain [wildcards](#wildcards).
+
+#### Examples
+Add all c files in a directory, then exclude a specific file
+```lua
+files { "*.c" }
+excludes { "a_file.c" }
+```
+
+Add an entire directory of C files, then exclude one directory
+```lua
+files { "*.c" }
+excludes { "tests/*.c" }
+```
+[Back to top](#table-of-contents)
+
+---
+### files({_files_...})
+Adds files to a project. Multiple calls are concatenated.
+
+**Note:** May be set on the solution, project, or configuration, but only project-level file lists are currently supported.
+
+**Scope:** solutions, projects, configurations
+
+#### Arguments
+_files_ - List of files to include. Paths should be relative to the currently-executing script file and may contain [wildcards](#wildcards).
+
+#### Examples
+Add two files to the current project
+```lua
+files { "hello.cpp", "goodbye.cpp" }
+```
+
+Add all C++ files from the "src/" directory to the project
+```lua
+files { "src/*.cpp" }
+```
+
+Add all C++ files from the "src/" directory and any subdirectories
+```lua
+files { "src/**.cpp" }
+```
+[Back to top](#table-of-contents)
+
+---
+### flags({_flags_...})
+Specifies build flags to modify the compiling or linking process. Multiple calls are concatenated.
+
+**Scope:** solutions, projects, configurations
+
+#### Arguments
+_flags_ - List of flag names from list below. Names are case-insensitive and ignored if not supported on a platform.
+
+* _EnableSSE, EnableSSE2_ - Enable SSE instruction sets
+* _ExtraWarnings_ - Sets compiler's max warning level.
+* _FatalWarnings_ - Treat warnings as errors.
+* _FloatFast_ - Enable floating point optimizations at the expense of accuracy.
+* _FloatStrict_ - Improve floating point consistency at the expense of performance.
+* _Managed_ - Enable Managed C++ (.NET).
+* _MFC_ - Enable support for Microsoft Foundation Classes.
+* _NativeWChar, NoNativeWChar_ - Toggle support for the wchar data type.
+* _No64BitChecks_ - Disable 64-bit portability warnings.
+* _NoEditAndContinue_ - Disable support for Visual Studio's Edit-and-Continue feature.
+* _NoExceptions_ - Disable C++ exception support.
+* _NoFramePointer_ - Disable the generation of stack frame pointers.
+* _NoIncrementalLink_ - Disable support for Visual Studio's incremental linking feature.
+* _NoImportLib_ - Prevent the generation of an import library for a Windows DLL.
+* _NoManifest_ - Prevent the generation of a manifest for Windows executables and shared libraries.
+* _NoMinimalRebuild_ - Disable Visual Studio's minimal rebuild feature.
+* _NoPCH_ - Disable precompiled headers.
+* _NoRTTI_ - Disable C++ runtime type information.
+* _Optimize_ - Perform a balanced set of optimizations.
+* _OptimizeSize_ - Optimize for the smallest file size.
+* _OptimizeSpeed_ - Optimize for the best performance.
+* _SEH_ - Enable structured exception handling.
+* _StaticRuntime_ - Perform a static link against the standard runtime libraries.
+* _Symbols_ - Generate debugging information.
+* _Unicode_ - Enable Unicode strings. If not specified, the default toolset behavior is used.
+* _Unsafe_ - Enable the use of unsafe code in .NET applications.
+* _WinMain_ - Use WinMain() as the entry point for Windows applications, rather than main().
+
+**Note:** When not set, options will default to the tool default.
+
+Additional tool-specific arguments can be passed with [`buildoptions`](#buildoptions) or [`linkoptions`](#linkoptions)
+
+#### Examples
+Enable debugging symbols in the Debug configuration and optimize the Release configuration
+```lua
+configuration "Debug"
+ flags { "Symbols" }
+
+configuration "Release"
+ flags { "OptimizeSpeed", "No64BitChecks" }
+```
+[Back to top](#table-of-contents)
+
+---
+### framework(_version_)
+Specifies a .NET framework version.
+
+**Note:** Currently only applied to Visual Studio 2005+ and GNU Makefiles using Mono.
+
+**Scope:** solutions, projects
+
+#### Arguments
+_version_ - one of the following:
+
+* 1.0
+* 1.1
+* 2.0
+* 3.0
+* 3.5
+* 4.0
+
+#### Examples
+Use the .NET 3.0 framework
+```lua
+framework "3.0"
+```
+[Back to top](#table-of-contents)
+
+---
+### iif(_condition_, _trueval_, _falseval_)
+Implements an immediate `if` clause, returning one of two possible values.
+
+#### Arguments
+_condition_ - logical condition to test
+_trueval_ - value to return if _condition_ evaluates to `true`
+_falseval_ - value to return if _condition_ evaluates to `false`
+
+#### Examples
+```lua
+result = iif(os.is("windows"), "is windows", "is not windows")
+```
+
+Note that all expressions are evaluated before the condition is checked. The following expression cannot be implemented with an `iif` because it may try to concatenate a string value.
+```lua
+result = iif(x -= nil, "x is " .. x, "x is nil")
+```
+[Back to top](#table-of-contents)
+
+---
+### imageoptions({_options_...})
+Passes arguments directly to the image tool command line without translation. Multiple calls are concatenated.
+
+**Scope:** solutions, project, configurations
+
+#### Arguments
+_options_ - list of image tools flags and options
+
+[Back to top](#table-of-contents)
+
+---
+### imagepath(_path_)
+Sets the file name of the deployment image produced by the build
+
+**Scope:** solutions, projects, configurations
+
+#### Arguments
+_path_ - the full path for the image file, relative to the currently-executing script
+
+[Back to top](#table-of-contents)
+
+---
+### implibdir(_path_)
+Specifies the import library output directory. Import libraries are generated for Windows DLL projects. By default, the generated files will place the import library in the same directory as the compiled binary.
+
+**Scope:** solutions, projects, configurations
+
+#### Arguments
+_path_ - the output directory for the library, relative to the currently-executing script file
+
+#### Examples
+```lua
+implibdir "../Libraries"
+```
+[Back to top](#table-of-contents)
+
+---
+### implibextension(_extension_)
+Specifies the import library file extension. Import libraries are generated for Windows DLL projects. By default, the toolset static library file extension will be used (`.lib` with Windows tools, `.a` with GNU tools).
+
+**Scope:** solutions, projects, configurations
+
+#### Arguments
+_extension_ - the extension, including the leading dot
+
+[Back to top](#table-of-contents)
+
+---
+### implibname(_name_)
+Specifies the import library base file name. Import libraries are generated for Windows DLL projects. By default the target name will be used as the import library file name.
+
+**Scope:** solutions, projects, configurations
+
+#### Arguments
+_name_ - new base file name
+
+[Back to top](#table-of-contents)
+
+---
+### implibprefix(_prefix_)
+Specifies the import library file name prefix. Import libraries are generated for Windows DLL projects. By default the system naming convention will be used (no prefix on Windows, `lib` prefix on other systems).
+
+**Scope:** solutions, projects, configurations
+
+#### Arguments
+_prefix_ - new file name prefix
+
+#### Examples
+```lua
+implibprefix "plugin"
+```
+
+The prefix may also be set to an empty string for no prefix
+```lua
+implibprefix ""
+```
+[Back to top](#table-of-contents)
+
+---
+### implibsuffix(_suffix_)
+Specifies the file name suffix for the import library base file name. Import libraries are generated for Windows DLL projects.
+
+**Scope:** solutions, projects, configurations
+
+#### Arguments
+_suffix_ - the new filename suffix
+
+#### Examples
+```lua
+-- Add "-d" to debug versions of files
+configuration "Debug"
+ implibsuffix "-d"
+```
+[Back to top](#table-of-contents)
+
+---
+### include(_directory_)
+Includes a file named `premake4.lua` from the specified directory. This allows you to specify each project in its own file, and easily include them into a solution.
+
+#### Arguments
+_directory_ - path to the included directory, relative to the currently-executing script file.
+
+#### Return Value
+Any values returned by the script are passed through to the caller
+
+#### Examples
+```lua
+-- runs "src/MyApplication/premake4.lua"
+include "src/MyApplication"
+
+-- runs "src/MyLibrary/premake4.lua"
+include "src/MyLibrary"
+```
+[Back to top](#table-of-contents)
+
+---
+### includedirs({_paths_...})
+Specifies include file search paths. Multiple calls are concatenated.
+
+**Scope:** solutions, projects, configurations
+
+#### Arguments
+_paths_ - list of include file search directories, relative to the currently-executing script file.
+
+#### Examples
+Define two include file search paths
+```lua
+includedirs { "../lua/include", "../zlib" }
+```
+You can also use [wildcards](#wildcards) to match multiple directories.
+```lua
+includedirs { "../includes/**" }
+```
+[Back to top](#table-of-contents)
+
+---
+### kind(_kind_)
+Sets the kind of binary object being created by the project, such as a console or windowed application.
+
+**Scope:** solutions, projects, configurations
+
+#### Arguments
+_kind_ - project kind identifier. One of:
+
+* _ConsoleApp_ - console executable
+* _WindowedApp_ - application that runs in a desktop window. Does not apply on Linux.
+* _SharedLib_ - shared library or DLL
+* _StaticLib_ - static library
+
+#### Examples
+```lua
+kind "ConsoleApp"
+```
+You can also set different kinds for each configuration. **Not supported by XCode.**
+```lua
+solution "MySolution"
+ configurations { "DebugLib", "ReleaseLib", "DebugDLL", "ReleaseDLL" }
+
+project "MyProject"
+ configuration "*Lib"
+ kind "StaticLib"
+
+ configuration "*DLL"
+ kind "SharedLib"
+```
+[Back to top](#table-of-contents)
+
+---
+### language(_lang_)
+Sets the programming language used by a project. GENie currently supports C, C++, and C#. Not all languages are supported by all of the generators. For instance, SharpDevelop does not currently support C or C++ development, and Code::Blocks does not support the .NET languages (C#, managed C++).
+
+**Scope:** solutions, projects
+
+#### Arguments
+_lang_ - language identifier string ("C", "C++", or "C#"). Case insensitive.
+
+#### Examples
+```lua
+language "C++"
+```
+[Back to top](#table-of-contents)
+
+---
+### libdirs({_paths_...})
+Specifies the library search paths. Library search directories are not well supported by the .NET tools. Visual Studio will change relative paths to absolute, making it difficult to share the generated project. MonoDevelop and SharpDevelop do not support search directories at all, using only the GAC. In general, it is better to include the full (relative) path to the assembly in links instead. C/C++ projects do not have this limitation.
+
+Multiple calls are concatenated.
+
+**Scope:** solutions, projects, configurations
+
+#### Arguments
+_paths_ - list of library search directories, relative to the currently-executing script file
+
+#### Examples
+```lua
+libdirs { "../lua/libs", "../zlib" }
+```
+You can also use [wildcards](#wildcards) to match multiple directories.
+```lua
+libdirs { "../libs/**" }
+```
+[Back to top](#table-of-contents)
+
+---
+### linkoptions({_options_...})
+Passes arguments to the linker command line. Multiple calls are concatenated.
+
+**Scope:** solutions, projects, configurations
+
+#### Arguments
+_options_ - list of flags and options to pass
+
+#### Examples
+Use `pkg-config`-style configuration when building on Linux with GCC.
+```lua
+configuration { "linux", "gmake" }
+ linkoptions { "`wx-config --libs`"}
+```
+[Back to top](#table-of-contents)
+
+---
+### links({_references_...})
+Specifies a list of libraries and projects to link against. Multiple calls are concatenated.
+
+**Scope:** solutions, projects, configurations
+
+#### Arguments
+_references_ - list of library and project names
+
+When linking against another project in the same solution, specify the project name here, rather than the library name. GENie will figure out the correct library to link against for the current configuration and will also create a dependency between the projects to ensure proper build order.
+
+When linking against system libraries, do not include any prefix or file extension. GENie will use the appropriate naming conventions for the current platform.
+
+#### Examples
+Link against some system libraries
+```lua
+configuration "windows"
+ links { "user32", "gdi32" }
+
+configuration "linux"
+ links { "m", "png" }
+
+configuration "macosx"
+--- OS X frameworks need the extension to be handled properly
+ links { "Cocoa.framework", "png" }
+```
+In a solution with two projects, link the library into the executable. Note that the project name is used to specify the link. GENie will automatically figure out the correect library file name and directory and create a project dependency.
+```lua
+solution "MySolution"
+ configurations { "Debug", "Release" }
+ language "C++"
+
+ project "MyExecutable"
+ kind "ConsoleApp"
+ files "**.cpp"
+ links { "MyLibrary" }
+
+ project "MyLibrary"
+ kind "SharedLib"
+ files "**.cpp"
+```
+You may also create links between non-library projects. In this case, GENie will generate a build dependency (the linked project will build first) but not an actual link. In this example, MyProject uses a build dependency to ensure that MyTool gets built first. It then uses MyTool as part of its build process
+```lua
+solution "MySolution"
+ configurations { "Debug", "Release" }
+ language "C++"
+
+ project "MyProject"
+ kind "ConsoleApp"
+ files "**.cpp"
+ links { "MyTool" }
+ prebuildcommands { "MyTool --dosomething" }
+
+ project "MyTool"
+ kind "ConsoleApp"
+ files "**.cpp"
+```
+[Back to top](#table-of-contents)
+
+---
+### location(_path_)
+Sets the destination directory for a generated solution or project file. By default, project files are generated into the same directory as the script that defines them.
+
+**Note:** Does not automatically propagate to the contained projects. Projects will use their default location unless explicitly overridden.
+
+**Scope:** solutions, projects
+
+#### Arguments
+_path_ - directory into which files should be generated, relative to the currently-executing script file.
+
+#### Examples
+```lua
+solution "MySolution"
+ 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 global variable contains the current toolset identifier, as specified on the command line. Note that Lua sytax requires parentheses around the function parameters in this case.
+```lua
+location ("../build/" .. _ACTION)
+```
+[Back to top](#table-of-contents)
+
+---
+### newaction(_description_)
+Registers a new command-line action argument.
+
+#### Arguments
+_description_ - a table describing the new action with the following fields:
+
+* _trigger_ - string identifier of the action; what the user would type on the command line
+* _description_ - short description of the action, to be displayed in the help text
+* _execute_ - Function to be executed when the action is fired
+
+#### Examples
+```lua
+newaction {
+ trigger = "install",
+ description = "Install the software",
+ execute = function()
+ os.copyfile("bin/debug/myprogram", "/usr/local/bin/myprogram")
+ end
+}
+```
+[Back to top](#table-of-contents)
+
+---
+### newoption(_description_)
+Registers a new command-line option argument.
+
+**Scope:** solutions, projects, configurations
+
+#### Arguments
+_description_ - a table describing the new option with the following fields:
+
+* _trigger_ - string identifier of the option; what the user would type on the command line
+* _description_ - short description of the option, to be displayed in the help text
+* _value_ - (optional) provides a hint to the user as to what type of data is expected
+* _allowed_ - (optional) list of key-value pairs listing the allowed values for the option
+
+#### Examples
+```lua
+newoption {
+ trigger = "gfxapi",
+ value = "API",
+ description = "Choose a particular 3D API for rendering",
+ allowed = {
+ { "opengl", "OpenGL" },
+ { "direct3d", "Direct3D (Windows only)"},
+ { "software", "Software Renderer" }
+ }
+}
+```
+[Back to top](#table-of-contents)
+
+---
+### objdir(_path_)
+Sets an object and intermediate file directory for a project. By default, object and intermediate files are stored in a directory named "obj" in the same directory as the project.
+
+**Scope:** solutions, projects, configurations
+
+#### Arguments
+_path_ - directory where the object and intermediate files should be stored, relative to the currently-executing script file.
+
+#### Examples
+```lua
+project "MyProject"
+ objdir "objects"
+```
+Set object directories per configuration
+```lua
+configuration "Debug"
+ objdir "../obj_debug"
+
+configuration "Release"
+ objdir "../obj_release"
+```
+[Back to top](#table-of-contents)
+
+---
+### os.chdir(_path_)
+Changes the working directory
+
+#### Arguments
+_path_ - path to the new working directory
+
+#### Return Value
+`true` if successful, otherwise `nil` and an error message
+
+[Back to top](#table-of-contents)
+
+---
+### os.copyfile(_source_, _destination_)
+Copies a file from one location to another.
+
+#### Arguments
+_source_ - file system path to the file to be copied
+_destination_ - path to the copy location
+
+#### Return Value
+`true` if successful, otherwise `nil` and an error message
+
+[Back to top](#table-of-contents)
+
+---
+### os.findlib(_libname_)
+Scans the well-known system locations looking for a binary file.
+
+#### Arguments
+_libname_ - name of the library to locate. May be specified with (libX11.so) or without (X11) system-specified decorations.
+
+#### Return Value
+The path containing the library file, if found. Otherwise, `nil`.
+
+[Back to top](#table-of-contents)
+
+---
+### os.get()
+Identifies the currently-targeted operating system.
+
+#### Return Value
+One of "bsd", "linux", "macosx", "solaris", or "windows"
+
+**Note:** This function returns the OS being targeted, which is not necessarily the same as the OS on which GENie is being run.
+
+#### Example
+```lua
+if os.get() == "windows" then
+ -- do something windows-specific
+end
+```
+[Back to top](#table-of-contents)
+
+---
+### os.getcwd()
+Gets the current working directory.
+
+#### Return Value
+The current working directory
+
+[Back to top](#table-of-contents)
+
+---
+### os.getversion()
+Retrieves version information for the host operating system
+
+**Note:** Not implemented for all platforms. On unimplemented platforms, will return `0` for all version numbers, and the platform name as the description.
+
+#### Return Value
+Table containing the following key-value pairs:
+
+| Key | Value |
+| ------------ | -------------------------------------------- |
+| majorversion | major version number |
+| minorversion | minor version number |
+| revision | bug fix release or service pack number |
+| description | human-readable description of the OS version |
+
+#### Examples
+```lua
+local ver = os.getversion()
+print(string.format(" %d.%d.%d (%s)",
+ ver.majorversion, ver.minorversion, ver.revision,
+ ver.description))
+
+-- On Windows XP: "5.1.3 (Windows XP)"
+-- On OSX: "10.6.6 (Mac OS X Snow Leopard)"
+```
+[Back to top](#table-of-contents)
+
+---
+### os.is(_id_)
+Checks the current operating system identifier against a particular value
+
+#### Arguments
+_id_ - one of "bsd", "linux", "macosx", "solaris", or "windows"
+
+**Note:** This function returns the OS being targeted, which is not necessarily the same as the OS on which GENie is being run.
+
+#### Return Value
+`true` if the supplied _id_ matches the current operating system identifer, `false` otherwise.
+
+[Back to top](#table-of-contents)
+
+---
+### os.is64bit()
+Determines if the host is using a 64-bit processor.
+
+#### Return Value
+`true` if the host system has a 64-bit processor
+`false` otherwise
+
+#### Examples
+```lua
+if os.is64bit() then
+ print("This is a 64-bit system")
+else
+ print("This is NOT a 64-bit system")
+end
+```
+[Back to top](#table-of-contents)
+
+---
+### os.isdir(_path_)
+Checks for the existence of a directory.
+
+#### Arguments
+_path_ - the file system path to check
+
+#### Return Value
+`true` if a matching directory is found
+`false` if there is no such file system path, or if the path points to a file
+
+[Back to top](#table-of-contents)
+
+---
+### os.isfile(_path_)
+Checks for the existence of a file.
+
+#### Arguments
+_path_ - the file system path to check
+
+#### Return Value
+`true` if a matching file is found
+`false` if there is no such file system path or if the path points to a directory instead of a file
+[Back to top](#table-of-contents)
+
+---
+### os.matchdirs(_pattern_)
+Performs a wildcard match to locate one or more directories.
+
+#### Arguments
+_pattern_ - file system path to search. May [wildcard](#wildcard) patterns.
+
+#### Return Value
+List of directories which match the specified pattern. May be empty.
+
+#### Examples
+```lua
+matches = os.matchdirs("src/*") -- non-recursive match
+matches = os.matchdirs("src/**") -- recursive match
+matches = os.matchdirs("src/test*") -- may also match partial name
+```
+[Back to top](#table-of-contents)
+
+---
+### os.matchfiles(_patterns_)
+Performs a wildcard match to locate one or more directories.
+
+#### Arguments
+_pattern_ - file system path to search. May contain [wildcard](#wildcard) patterns.
+
+#### Return Value
+List of files which match the specified pattern. May be empty.
+
+#### Examples
+```lua
+matches = os.matchfiles("src/*.c") -- non-recursive match
+matches = os.matchfiles("src/**.c") -- recursive match
+```
+[Back to top](#table-of-contents)
+
+---
+### os.mkdir(_path_)
+Creates a new directory.
+
+#### Arguments
+_path_ - path to be created
+
+#### Return Value
+`true` if successful
+`nil` and an error message otherwise
+
+[Back to top](#table-of-contents)
+
+---
+### os.outputof(_command_)
+Runs a shell command and returns the output.
+
+#### Arguments
+_command_ - shell command to run
+
+#### Return Value
+The output of the command
+
+#### Examples
+```lua
+-- Get the ID for the host processor architecture
+local proc = os.outputof("uname -p")
+```
+[Back to top](#table-of-contents)
+
+---
+### os.pathsearch(_fname_, _paths..._)
+description
+
+**Scope:** solutions, projects, configurations
+
+#### Arguments
+_fname_ - name of the file being searched, followed by one or more path sets to be searched
+
+_paths_ - the match format of the PATH environment variable: a colon-delimited list of path. On Windows, you may use a semicolon-delimited list if drive letters might be included
+
+#### Return Value
+Path to the directory which contains the file, if found
+`nil` otherwise
+
+#### Examples
+```lua
+local p = os.pathsearch("mysystem.config", "./config:/usr/local/etc:/etc")
+```
+[Back to top](#table-of-contents)
+
+---
+### os.rmdir(_path_)
+Removes an existing directory as well as any files or subdirectories it contains.
+
+#### Arguments
+_path_ - file system path to be removed
+
+#### Return Value
+`true` if successful
+`nil` and an error message otherwise
+
+[Back to top](#table-of-contents)
+
+---
+### os.stat(_path_)
+Retrieves information about a file.
+
+#### Arguments
+_path_ - path to file for which to retrieve information
+
+#### Return Value
+Table of values:
+
+| Key | Value |
+| ----- | ----------------------- |
+| mtime | Last modified timestamp |
+| size | File size in bytes |
+
+[Back to top](#table-of-contents)
+
+---
+### os.uuid()
+Returns a Universally Unique Identifier
+
+#### Return Value
+A new UUID, a string value with the format `xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx`
+
+[Back to top](#table-of-contents)
+
+---
+### path.getabsolute(_path_)
+Converts relative path to absolute path
+
+#### Arguments
+_path_ - the relative path to be converted
+
+#### Return Value
+new absolute path, calculated from the current working directory
+
+[Back to top](#table-of-contents)
+
+---
+### path.getbasename(_path_)
+Extracts base file portion of a path, with the directory and extension removed.
+
+#### Arguments
+_path_ - path to be split
+
+#### Return Value
+Base name portion of the path
+
+[Back to top](#table-of-contents)
+
+---
+### path.getdirectory(_path_)
+Extracts directory portion of a path, with file name removed
+
+#### Arguments
+_path_ - path to be split
+
+#### Return Value
+Directory portion of the path
+
+[Back to top](#table-of-contents)
+
+---
+### path.getdrive(_path_)
+Returns drive letter portion of a path
+
+#### Arguments
+_path_ - path to be split
+
+#### Return Value
+Drive letter portion of the path, or `nil`
+
+[Back to top](#table-of-contents)
+
+---
+### path.getextension(_path_)
+Returns file extension portion of a path
+
+#### Arguments
+_path_ - path to be split
+
+#### Return Value
+File extension portion of the path, or an empty string
+
+[Back to top](#table-of-contents)
+
+---
+### path.getname(_path_)
+Returns file name and extension, removes directory information.
+
+#### Arguments
+_path_ - path to be split
+
+#### Return Value
+File name and extension without directory information
+
+[Back to top](#table-of-contents)
+
+---
+### path.getrelative(_src_, _dest_)
+Computes relative path from one directory to another.
+
+#### Arguments
+_src_ - originating directory
+_dest_ - target directory
+
+#### Return Value
+Relative path from _src_ to _dest_
+
+[Back to top](#table-of-contents)
+
+---
+### path.isabsolute(_path_)
+Returns whether or not a path is absolute.
+
+#### Arguments
+_path_ - path to check
+
+#### Return Value
+`true` if path is absolute
+`false` otherwise
+
+[Back to top](#table-of-contents)
+
+---
+### path.iscfile(_path_)
+Determines whether file is a C source code file, based on extension.
+
+#### Arguments
+_path_ - path to check
+
+#### Return Value
+`true` if path uses a C file extension
+`false` otherwise
+
+[Back to top](#table-of-contents)
+
+---
+### path.iscppfile(_path_)
+Determines whether a file is a C++ source code file, based on extension.
+
+#### Arguments
+_path_ - path to check
+
+#### Return Value
+`true` if path uses a C++ file extension
+`false` otherwise
+
+[Back to top](#table-of-contents)
+
+---
+### path.isresourcefile(_path_)
+Determines whether a path represends a Windows resource file, based on extension.
+
+#### Arguments
+_path_ - path to check
+
+#### Return Value
+`true` if path uses a well-known Windows resource file extension
+`false` otherwise
+
+[Back to top](#table-of-contents)
+
+---
+### path.join(_leading_, _trailing_)
+Joins two path portions together into a single path.
+
+**Note:** if _trailing_ is an absolute path, then _leading_ is ignored and the absolute path is returned.
+
+#### Arguments
+_leading_ - beginning portion of the path
+_trailing_ - ending portion of the path
+
+#### Return Value
+Merged path
+
+#### Examples
+```lua
+-- returns "MySolution/MyProject"
+p = path.join("MySolution", "MyProject")
+
+-- returns "/usr/bin", because the trailing path is absolute
+p = path.join("MySolution", "/usr/bin")
+
+-- tokens are assumed to be absolute. This returns `${ProjectDir}`
+p = path.join("MySolution", "$(ProjectDir)")
+```
+[Back to top](#table-of-contents)
+
+---
+### path.rebase(_path_, _oldbase_, _newbase_)
+Takes a relative path and makes it relative to a different location.
+
+#### Arguments
+_path_ - path to be modified
+_oldbase_ - original base directory, from which _path_ is relative
+_newbase_ - the new base directory, from where the resulting path should be relative
+
+#### Return Value
+Rebased path
+
+[Back to top](#table-of-contents)
+
+---
+### path.translate(_path_, _newsep_)
+Converts the separators in a path.
+
+#### Arguments
+_path_ - path to modify
+_newsep_ - new path separator. Defaults to current environment default.
+
+#### Return Value
+Modified path
+[Back to top](#table-of-contents)
+
+---
+### pchheader(_file_)
+Sets the main header file for precompiled header support.
+
+**Scope:** projects
+
+#### Arguments
+_file_ - name of the header file, as it is specified in your `#include` statements
+
+#### Examples
+```lua
+pchheader "afxwin.h"
+pchsource "afxwin.cpp"
+```
+[Back to top](#table-of-contents)
+
+---
+### pchsource(_file_)
+Sets the main source file for precompiled header support. Only used by Visual Studio.
+
+**Scope:** projects
+
+#### Arguments
+_file_ - name of the source file, relative to the currently-executing script file
+
+#### Examples
+```lua
+pchheader "afxwin.h"
+pchsource "afxwin.cpp"
+```
+[Back to top](#table-of-contents)
+
+---
+### platforms({_identifiers_...})
+Specifies a set of target hardware platforms for a solution.
+
+_Platform support is a new, experimental feature. The syntax and behavior described here might change as we sort out the details_
+
+**Scope:** solutions
+
+#### Arguments
+_identifiers_ - list of hardware platform specifiers from this list:
+
+* _Native_ - general build not targeting any particular platform. If your project can be built in a generic fashion, you should include this as the first platform option
+* _x32_ - 32-bit environment
+* _x64_ - 64-bit environment
+* _Universal_ - OS X universal binary, target both 32- and 64-bit versions of x86 and PPC. Automated dependency generation must be turned off, and always do a clean build. Not supported by Visual Studio.
+* _Universal32_ - like _Universal_ above, but targeting only 32-bit platforms
+* _Universal64_ - like _Universal_ above, but targeting only 64-bit platforms
+* _PS3_ - Playstation 3
+* _Xbox360_ - Xbox 360 compiler and linker under Visual Studio
+
+#### Return Value
+Current list of target platforms for the active solution
+
+#### Examples
+Generic build, as well as OS X Universal build
+```lua
+solution "MySolution"
+ configurations { "Debug", "Release" }
+ platforms { "native", "universal" }
+```
+Prove 32- and 64-bit specific build targets. No generic build is provided so one of these two platforms must always be used. Do this only if your software requires knowledge of the underlying architecture at build time; otherwise, include _native_ to provide a generic build.
+```lua
+solution "MySolution"
+ configurations { "Debug", "Release" }
+ platforms { "x32", "x64" }
+```
+
+You can retrieve the current list of platforms by calling the function with no parameters
+```lua
+local p = platforms()
+```
+
+Once you have defined a list of platforms, you may use those identifiers to set up configuration filters and apply platform-specific settings.
+```lua
+configuration "x64"
+ defines "IS_64BIT"
+
+-- You can also mix platforms with other configuration selectors
+configuration { "Debug", "x64" }
+ defines "IS_64BIT_DEBUG"
+```
+[Back to top](#table-of-contents)
+
+---
+### postbuildcommands({_commands_...})
+Specifies shell commands to run after build is finished
+
+**Scope:** solutions, projects, configurations
+
+#### Arguments
+_commands_ - one or more shell commands
+
+#### Examples
+```lua
+configuration "windows"
+ postbuildcommands { "copy default.config bin\\project.config" }
+
+configuration "not windows"
+ postbuildcommands { "cp default.config bin/project.config" }
+```
+[Back to top](#table-of-contents)
+
+---
+### prebuildcommands({_commands_...})
+Specifies shell commands to run before each build
+
+**Scope:** solutions, projects, configurations
+
+#### Arguments
+_commands_ - one or more shell commands
+
+#### Examples
+```lua
+configuration "windows"
+ prebuildcommands { "copy default.config bin\\project.config" }
+
+configuration "not windows"
+ prebuildcommands { "cp default.config bin/project.config" }
+```
+[Back to top](#table-of-contents)
+
+---
+### prelinkcommands({_commands_...})
+Specifies shell commands to run after source files have been compiled, but before the link step
+
+**Scope:** solutions, projects, configurations
+
+#### Arguments
+_commands_ - one or more shell commands
+
+#### Examples
+```lua
+configuration "windows"
+ prelinkcommands { "copy default.config bin\\project.config" }
+
+configuration "not windows"
+ prelinkcommands { "cp default.config bin/project.config" }
+```
+[Back to top](#table-of-contents)
+
+---
+### printf(_format_, _args_...)
+Prints a formatted string
+
+#### Arguments
+_format_ - formatting string, containing C `printf()` formatting codes
+_args_ - arguments to be substituted into the format string
+
+[Back to top](#table-of-contents)
+
+---
+### project(_name_)
+Creates a new project and makes it active. 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.
+
+#### Arguments
+_name_ - a unique name for the project. If a project with the given name already exists, it is made active and returned. The project name will be used as the file name of the generated solution file.
+
+#### Return Value
+The active project object.
+
+#### The `project` Object
+Every project is represented in Lua as a table of key-value pairs. You should treat this object as read-only and use the GENie API to make any changes.
+
+* _basedir_ - directory where the project was originally defined. Root for relative paths.
+* _blocks_ - list of configuration blocks
+* _language_ - project language, if set
+* _location_ - output directory for generated project file
+* _name_ - name of the project
+* _solution_ - solution which contains the project
+* _uuid_ - unique identifier
+
+#### 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"
+```
+
+You can retrieve the currently active project by calling `project` with no parameters.
+```lua
+local prj = project()
+```
+
+You can retrieve the list of projects associated with a solution using the `projects` field of the solution object, which may then be iterated over.
+```lua
+local prjs = solution().projects
+for i, prj in ipairs(prjs) do
+ print(prj.name)
+end
+```
+[Back to top](#table-of-contents)
+
+---
+### resdefines({_symbols_...})
+Specifies preprocessor symbols for the resource compiler. Multiple calls are concatenated.
+
+**Scope:** solutions, projects, configurations
+
+#### Arguments
+_symbols_ - list of symbols to be defined
+
+#### Examples
+```lua
+resdefines { "DEBUG", "TRACE" }
+```
+
+```lua
+resdefines { "CALLSPEC=__dllexport" }
+```
+[Back to top](#table-of-contents)
+
+---
+### resincludedirs({_paths_...})
+Specifies the include file search paths for the resource compiler. Multiple calls are concatenated.
+
+**Scope:** solutions, projects, configurations
+
+#### Arguments
+_paths_ - list of include file search directories, relative to the currently executing script file
+
+#### Examples
+```lua
+resincludedirs { "../lua/include", "../zlib" }
+```
+
+May use wildcards
+```lua
+resincludedirs { "../includes/**" }
+```
+[Back to top](#table-of-contents)
+
+---
+### resoptions({_options_...})
+Passes arguments directly to the resource compiler. Multiple calls are concatenated.
+
+**Scope:** solutions, projects, configurations
+
+#### Arguments
+_options_ - list of resource compiler flags and options
+
+#### Examples
+```lua
+configuration { "linux", "gmake" }
+ resoptions { "`wx-config --cxxflags`", "-ansi", "-pedantic" }
+```
+[Back to top](#table-of-contents)
+
+---
+### solution(_name_)
+Creates a new solution and makes it active. Solutions are the top-level opjects in a GENie build script, and are synonymous with a Visual Studio solution. Each solution contains one or more projects, which in turn contain the settings to generate a single binary target.
+
+#### Arguments
+_name_ - unique name for the solution. If a solution with the given name already exists, it is made active and returned. This value will be used as the file name of the generated solution file.
+
+#### Return Value
+The active `solution` object.
+
+#### The `solution` Object
+Represented as a Lua table key-value pairs, containing the following values. You should treat this object as read-only and use the GENie API to make any changes.
+
+* _basedir_ - directory where the original project was defined; acts as a root for relative paths
+* _configurations_ - list of valid configuration names
+* _blocks_ - list of configuration blocks
+* _language_ - solution language, if set
+* _location_ - output directory for the generated solution file
+* _name_ - name of the solution
+* _platforms_ - list of target platforms
+* _projects_ - list of projects contained by the solution
+
+#### Examples
+```lua
+solution "MySolution"
+```
+
+You can retrieve the currently active solution object by calling `solution` with no parameters.
+```lua
+local sln = solution()
+```
+
+You can use the global variable `_SOLUTIONS` to list out all of the currently defined solutions.
+```lua
+for i, sln in ipairs(_SOLUTIONS) do
+ print(sln.name)
+end
+```
+[Back to top](#table-of-contents)
+
+---
+### string.endswith(_haystack_, _needle_)
+Checks if the given _haystack_ string ends with _needle_.
+
+#### Arguments
+_haystack_ - string to search within
+_needle_ - string to check ending of _haystack_ against
+
+#### Return Value
+`true` - _haystack_ ends with _needle_
+`false` - _haystack_ does not end with _needle_
+
+[Back to top](#table-of-contents)
+
+---
+### string.explode(_str_, _pattern_)
+Breaks a string into an array of strings, formed by splitting _str_ on _pattern_.
+
+#### Arguments
+_str_ - string to be split
+_pattern_ - separator pattern at which to split; may use Lua's pattern matching syntax
+
+#### Return Value
+List of substrings
+
+[Back to top](#table-of-contents)
+
+---
+### string.findlast(_str_, _pattern_, _plain_)
+Finds the last instance of a pattern within a string.
+
+#### Arguments
+_str_ - string to be searched
+_pattern_ - pattern to search for; may use Lua's pattern matching syntax
+_plain_ - whether or not plain string comparison should be used (rather than pattern-matching)
+
+#### Return Value
+The matching pattern, if found, or `nil`
+
+[Back to top](#table-of-contents)
+
+---
+### string.startswith(_haystack_, _needle_)
+Checks if the given _haystack_ starts with _needle_.
+
+#### Arguments
+_haystack_ - string to search within
+_needle_ - string to check start of _haystack_ against
+
+#### Return Value
+`true` - _haystack_ starts with _needle_
+`false` - _haystack_ does not start with _needle_
+
+[Back to top](#table-of-contents)
+
+---
+### table.contains(_array_, _value_)
+Determines if a _array_ contains _value_.
+
+#### Arguments
+_array_ - table to test for _value_
+_value_ - _value_ being tested for
+
+#### Return Value
+`true` - _array_ contains _value_
+`false` - _array_ does not contain _value_
+
+[Back to top](#table-of-contents)
+
+---
+### table.implode(_array_, _before_, _after_, _between_)
+Merges an array of items into a single formatted string.
+
+#### Arguments
+_array_ - table to be converted into a string
+_before_ - string to be inserted before each item
+_after_ - string to be inserted after each item
+_between_ - string to be inserted between each item
+
+#### Return Value
+Formatted string
+
+[Back to top](#table-of-contents)
+
+---
+### targetdir(_path_)
+Sets the destination directory for the compiled binary target. By default, generated project files will place their compiled output in the same directory as the script.
+
+**Scope:** solutions, projects, configurations
+
+#### Arguments
+_path_ - file system path to the directory where the compiled target file should be stored, relative to the currently executing script file.
+
+#### Examples
+```lua
+project "MyProject"
+
+ configuration "Debug"
+ targetdir "bin/debug"
+
+ configuration "Release"
+ targetdir "bin/release"
+```
+[Back to top](#table-of-contents)
+
+---
+### targetextension(_ext_)
+Specifies the file extension for the compiled binary target. By default, the project will use the system's normal naming conventions: ".exe" for Windows executables, ".so" for Linux shared libraries, etc.
+
+**Scope:** solutions, projects, configurations
+
+#### Arguments
+_ext_ - new file extension, including leading dot
+
+#### Examples
+```lua
+targetextension ".zmf"
+```
+[Back to top](#table-of-contents)
+
+---
+### targetname(_name_)
+Specifies the base file name for the compiled binary target. By default, the project name will be used as the file name of the compiled binary target.
+
+**Scope:** solutions, projects, configurations
+
+#### Arguments
+_name_ - new base file name
+
+#### Examples
+```lua
+targetname "mytarget"
+```
+[Back to top](#table-of-contents)
+
+---
+### targetprefix(_prefix_)
+Specifies the file name prefix for the compiled binary target. By default, system naming conventions will be used: "lib" for POSIX libraries (e.g. "libMyProject.so") and no prefix elsewhere.
+
+**Scope:** solutions, projects, configurations
+
+#### Arguments
+_prefix_ - new file name prefix
+
+#### Examples
+```lua
+targetprefix "plugin"
+```
+
+The prefix may also be set to an empty string for no prefix
+```lua
+targetprefix ""
+```
+[Back to top](#table-of-contents)
+
+---
+### targetsuffix(_suffix_)
+Specifies a file name suffix for the compiled binary target.
+
+**Scope:** solutions, projects, configurations
+
+#### Arguments
+_suffix_ - new filename suffix
+
+#### Examples
+```lua
+--- Add "-d" to debug versions of files
+configuration "Debug"
+ targetsuffix "-d"
+```
+[Back to top](#table-of-contents)
+
+---
+### uuid(_projectuuid_)
+Sets the UUID for a project. GENie automatically assigns a UUID to each project, which is used by the Visual Studio generators to identify the project within a solution. This UUID is essentially random and will change each time the project file is generated. If you are storing the generated Visual Studio project files in a version control system, this will create a lot of unnecessary deltas. Using the `uuid` function, you can assign a fixed UUID to each project which never changes.
+
+**Scope:** projects
+
+#### Arguments
+_projectuuid_ - UUID for the current project
+
+### Return Value
+Current project UUID or `nil` if no UUID has been set
+
+#### Examples
+```lua
+uuid "XXXXXXXX-XXXX-XXXX-XXXXXXXXXXXX"
+```
+[Back to top](#table-of-contents)
+
+---
+### vpaths({[_group_] = {_pattern_...}})
+Places files into groups for "virtual paths", rather than mirroring the filesystem. This allows you to, for instance, put all header files in a group called "Headers", no matter where they appeared in the source tree.
+
+**Note:** May be set on the solution, project, or configuration, but only project-level file lists are currently supported.
+
+**Scope:** solutions, projects, configurations
+
+#### Arguments
+Table of values, where keys (_groups_) are strings and values (_pattern_) are lists of file system patterns.
+
+_group_ - name for the new group
+_pattern_ - file system pattern for matching file names
+
+#### Examples
+
+Place all header files into a virtual path called "Headers". Any directory information is removed, "src/lua/lua.h" will appear in the IDE as "Headers/lua.h"
+```lua
+vpaths { ["Headers"] = "**.h" }
+```
+
+You may specify multiple file patterns using table syntax
+```lua
+vpaths {
+ ["Headers"] = { "**.h", "**.hxx", "**.hpp" }
+}
+```
+
+It is also possible to include the file's path in the virtual group. Using this rule, "src/lua/lua.h" will appear in the IDE as "Headers/src/lua/lua.h".
+```lua
+vpaths { ["Headers/*"] = "**.h" }
+```
+
+Any directory information explicitly provided in the pattern will be remvoed from the replacement. Using this rule, "src/lua/lua.h" will appear in the IDE as "Headers/lua/lua.h".
+```lua
+vpaths { ["Headers/*"] = "src/**.h" }
+```
+
+You can also use virtual paths to remove extra directories from the IDE. Using this rule, "src/lua/lua.h" will appear in the IDE as "lua/lua.h".
+```lua
+vpaths { ["*"] = "src" }
+```
+
+You may specify more than one rule at a time
+```lua
+vpaths {
+ ["Headers"] = "**.h",
+ ["Sources/*"] = {"**.c", "**.cpp"},
+ ["Docs"] = "**.txt"
+}
+```
+[Back to top](#table-of-contents)
+
+---
+
+## Additional Information
+
+### Wildcards
+
+In some places, wildcards may be used in string values passed to a function. Usually, these strings represent paths. There are two types of wildcards:
+
+* `*` - matches files within a single directory
+* `**` - matches files recursively in any child directory \ No newline at end of file
diff --git a/3rdparty/genie/scripting-reference.md b/3rdparty/genie/scripting-reference.md
deleted file mode 100644
index a8bc9433073..00000000000
--- a/3rdparty/genie/scripting-reference.md
+++ /dev/null
@@ -1,2436 +0,0 @@
-# Scripting Reference
-
-This section describes the functions and variables available to Premake
-scripts.
-
-Premake is built on Lua, so everything in the [Lua Reference Manual][1] applies
-to a Premake script. Premake adds the ability to define solutions, projects,
-and configurations, as well as functions useful for build configuration tasks.
-
-You may also want to check out [LuaForge][2] for a wide assortment of Lua
-add-on modules.
-
-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...
-
-
- $ premake4 vs2005
-
-
-...then `_ACTION` will be set to "vs2005". If there is no action (for instance,
-if the command was `premake4 /help`) this variable will be nil.
-
-The `_ARGS` global variable stores any arguments to the current action. As an
-example, if this command line was used to launch Premake...
-
-
- $ premake4 vs2005 alpha beta
-
-
-...then `_ARGS[1]` will be set to "alpha" and `_ARGS[2]` to "beta". If there
-are no arguments this array will be empty.
-
-The **_OPTIONS** global variable lists the current set of command line options
-and their values, if any. For more information, see [Command Line
-Arguments][3].
-
-The `_PREMAKE_COMMAND` global variable stores the full path to the Premake
-executable.
-
-Introduced in Premake 4.4.
-
-The `_GENIE_VERSION` global variable stores the current GENie version, i.e.
-62.
-
-The `_GENIE_VERSION_STR` global variable stores the current GENie version with
-git commit hash.
-
-The `_SCRIPT` global variable stores the full path of the currently executing
-script.
-
-The `_WORKING_DIR` global variable stores the current working directory at the
-time Premake was launched.
-
-Introduced in Premake 4.4.
-
-The **buildaction** function specifies how a file or set of files should be
-treated during the compilation process. It is usually paired with a
-configuration filter to select a file set. If no build action is specified for
-a file a default action will be used, based on the file's extension.
-
-Build actions are currently only supported for .NET projects, and not for C or
-C++.
-
-**Updated information is [available on the new Premake wiki][4]**.
-
-### Applies To
-
-Solutions, projects, and configurations.
-
-### Parameters
-
-_action_ is one of:
-
-Compile : Treat the file as source code; compile and link it.
-
-Embed : Embed the file into the target binary as a resource.
-
-Copy : Copy the file to the target directory.
-
-None : Do nothing with this file.
-
-### Examples
-
-Embed all PNG image files into the target binary.
-
-
- configuration "**.png" buildaction "Embed"
-
-The **buildoptions** function passes arguments directly to the compiler command
-line without translation.
-
-
- buildoptions { "options" }
-
-If a project includes multiple calls to **buildoptions** the lists are
-concatenated, in the order in which they appear in the script.
-
-### Applies To
-
-Solutions, projects, and configurations.
-
-### Parameters
-
-_options_ is a list of compiler flags and options, specific to a particular
-compiler.
-
-### Examples
-
-Use `pkg-config` style configuration when building on Linux with GCC. Build
-options are always compiler specific and should be targeted to a particular
-toolset.
-
-
- configuration { "linux", "gmake" } buildoptions { "`wx-config --cxxflags`",
- "-ansi", "-pedantic" }
-
-The **configuration** function limits the subsequent build settings to a
-particular environment.
-
-
- configuration { "keywords" }
-
-The **configuration** functions acts as a filter. Any settings that appear
-after this function in the script will be applied only in those environments
-that match all of the listed keywords. See below for some usage examples.
-
-### Parameters
-
-_keywords_ is a list of identifiers (see below). If all of these identifiers
-are present in the current runtime environment, then the settings following the
-**configuration** call will be applied. If any of the identifiers is not the
-current environment the settings will be ignored.
-
-The following table lists the available sources for keywords. Keywords are not
-case-sensitive.
-
-Configuration names : Any of the configuration names supplied to the
-[configurations][5] function.
-
-Action names : Any action name, such as **vs2005** or **gmake**. See the [Quick
-Start][6] for a complete list.
-
-Operating system names : Any of the operating system identifiers, such as
-**windows** or **macosx**, as returned by [os.get][7].
-
-Platform names : Any of the platform identifiers, such as **ps3** or
-**xbox360**. See [platforms][8] for a complete list.
-
-Command-line options : Any of the available command-line options or the option
-values, whether built-in or custom to the project.
-
-File names : Although currently very limited, some settings can be applied to
-specific files.
-
-In addition to the terms listed above, you may use the ***** and ******
-wildcards to match more than one term or file. You may also use the modifiers
-**not** and **or** to build more complex conditions. See the examples below for
-more information.
-
-### Return Value
-
-The function returns the current configuration object; see [The Configuration
-Block][9] below for more information on the structure of this object.
-
-### Examples
-
-Define a new symbol which applies only to debug builds; assumes a configuration
-named "Debug" was defined as part of the solution.
-
-
- configuration "Debug" defines { "_DEBUG" }
-
-Define a symbol only when targeting Visual Studio 2005.
-
-
- configuration "vs2005" defines { "VISUAL_STUDIO_2005" }
-
-Wildcards can be used to match multiple terms. Define a symbol for all versions
-of Visual Studio.
-
-
- configuration "vs*" defines { "VISUAL_STUDIO_2005" }
-
-Although support is currently quite limited (only [buildaction][10] works so
-far), you may also apply settings to a particular file or set of files. This
-example sets the build action for all PNG image files.
-
-
- configuration "*.png" buildaction "Embed"
-
-In the case of files you may also use the ****** wildcard, which will recurse
-into subdirectories.
-
-
- configuration "**.png" buildaction "Embed"
-
-If multiple keywords are specified, they will be treated as a logical AND. All
-terms must be present for the block to be applied. This example will apply the
-symbol only for debug builds on Mac OS X.
-
-
- configuration { "debug", "macosx" } defines { "DEBUG_MACOSX" }
-
-Multiple terms must use Lua's curly bracket list syntax.
-
-You can use the **or** modifier to match against multiple, specific terms.
-
-
- configuration "linux or macosx" defines { "LINUX_OR_MACOSX" }
-
-You can also use **not** to apply the settings to all environments where the
-identifier is not set.
-
-
- configuration "not windows" defines { "NOT_WINDOWS" }
-
-Finally, you can reset the configuration filter and remove all active keywords
-by passing the function an empty table.
-
-### The Configuration Block
-
-Each call to **configuration** function creates a new configuration block
-object. Unless you really know what you are doing, you should treat this object
-as read-only and use the Premake API to make any changes. The configuration
-block object contains the following values:
-
-buildaction : A build action.
-
-buildoptions : A list of compiler options.
-
-defines : A list of compiler symbols.
-
-excludes : A list of excluded files.
-
-files : A list of files.
-
-flags : A list of build flags.
-
-implibdir : The import library directory.
-
-implibextension : The import library file extension.
-
-implibname : The import library base file name.
-
-implibprefix : The import library file name prefix.
-
-implibsuffix : The import library file name suffix.
-
-includedirs : A list of include file search directories.
-
-keywords : A list of keywords associated with the block.
-
-kind : The target kind.
-
-libdirs : A list of library search directories.
-
-linkoptions : A list of linker options.
-
-links : A list of libraries or assemblies to link against.
-
-objdir : The objects and intermediate files directory.
-
-pchheader : The target file name for precompiled header support.
-
-pchsource : The target source file name for precompiled header support.
-
-prebuildcommands : A list of pre-build commands.
-
-prelinkcommands : A list of pre-link commands.
-
-postbuildcommands : A list of post-build commands.
-
-resdefines : A list of symbols for the resource compiler.
-
-resincludedirs : A list of include file search paths for the resource compiler.
-
-resoptions : A list of resource compiler options.
-
-startproject : The default startup project (for VS2005+)
-
-targetdir : The target output directory.
-
-targetextension : The target file extension.
-
-targetname : The target base file name.
-
-targetprefix : The target file name prefix.
-
-targetsuffix : The target file name suffix.
-
-terms : The filter terms passed to the configuration function to create the
-block (i.e. "Debug").
-
-The **configurations** function specifies the set of build configurations, such
-as "Debug" and "Release", for a solution.
-
-
- configurations { "names" }
-
-A configuration encapsulates a collection of build settings, allowing the
-developer to easily switch between them. "Debug" and "Release" are the most
-common configurations, the former providing debugging information, and the
-latter providing optimizations.
-
-The list of configurations must be specified before any projects are defined,
-and once a project has been defined the configuration list may no longer be
-changed.
-
-**Updated information is [available on the new Premake wiki][11].**
-
-### Applies To
-
-Solutions only.
-
-### Parameters
-
-_names_ is a list of configuration names. Spaces are allowed, but may make
-using certain Premake features, such as a command-line configuration selection,
-more difficult.
-
-### Return Value
-
-The function returns the current list of configuration names for the active
-solution.
-
-### Examples
-
-Specify debug and release configurations for a solution.
-
-
- solution "MySolution" configurations { "Debug", "Release" }
-
-Add additional configurations for a dynamic link library version.
-
-
- configurations { "Debug", "Release", "DebugDLL", "ReleaseDLL" }
-
-You can retrieve the current list of configurations by calling the function
-with no parameters.
-
-
- local cfgs = configurations()
-
-The **debugargs** function specifies a list of arguments to pass to the
-application when run under the debugger.
-
-Note that this settings is not implemented for Xcode 3, which requires a
-per-user configuration file in order to make it work.
-
-In Visual Studio, this file can be overridden by a per-user configuration file
-(such as **ProjectName.vcproj.MYDOMAIN-MYUSERNAME.user**). Removing this file
-(which is done by Premake's clean action) will restore the default settings.
-
-Added in Premake 4.4.
-
-### Applies To
-
-Solutions, projects, and configurations.
-
-### Parameters
-
-_args_ is a Lua list of arguments to provide to the executable while debugging.
-
-### Examples
-
-
- configuration "Debug" debugargs { "--append", "somefile.txt" }
-
-The **debugdir** function sets the working directory for the integrated
-debugger.
-
-Note that this settings is not implemented for Xcode 3, which requires a
-per-user configuration file in order to make it work.
-
-In Visual Studio, this file can be overridden by a per-user configuration file
-(such as **ProjectName.vcproj.MYDOMAIN-MYUSERNAME.user**). Removing this file
-(which is done by Premake's clean action) will restore the default settings.
-
-Added in Premake 4.4.
-
-### Applies To
-
-Solutions, projects, and configurations.
-
-### Parameters
-
-_path_ is the path to the working directory, relative to the currently
-executing script file.
-
-### Examples
-
-
- configuration "Debug" debugdir "bin/debug"
-
-The **defines** function adds preprocessor or compiler symbols to a project.
-
-If a project includes multiple calls to **defines** the lists are concatenated,
-in the order in which they appear in the script.
-
-### Applies To
-
-Solutions, projects, and configurations.
-
-### Parameters
-
-_symbols_ specifies a list of symbols to be defined.
-
-### Examples
-
-Define two new symbols in the current project.
-
-
- defines { "DEBUG", "TRACE" }
-
-Symbols may also assign values.
-
-
- defines { "CALLSPEC=__dllexport" }
-
-The **deploymentoptions** function passes arguments directly to the deployment
-tool command line without translation.
-
-
- deploymentoptions { "options" }
-
-If a project includes multiple calls to **deploymentoptions** the lists are
-concatenated, in the order in which they appear in the script.
-
-Deployment options are currently only supported for Xbox 360 targets.
-
-### Applies To
-
-Solutions, projects, and configurations.
-
-### Parameters
-
-_options_ is a list of deployment tools flags and options.
-
-The **excludes** function removes files, added with the [files][12] function,
-from a project.
-
-If a project includes multiple calls to **excludes** the lists are
-concatenated.
-
-### Applies To
-
-Files may be set on the solution, project, and configuration level. However,
-only project-level file lists are currently supported.
-
-### Parameters
-
-_file_list_ specifies one or more file patterns, separated by commas. File
-paths should be specified relative to the location of the script file. File
-patterns may contain the ***** wildcard to match against files in the current
-directory, or the ****** wildcard to perform a recursive match.
-
-### Examples
-
-Add all C files in a directory, and then exclude a specific file.
-
-
- files { "*.c" } excludes { "a_file.c" }
-
-Add an entire directory tree of C files, and then exclude one particular
-directory.
-
-
- files { "**.c" } excludes { "tests/*.c" }
-
-The **files** function adds files to a project.
-
-If a project includes multiple calls to **files** the lists are concatenated,
-in the order in which they appear in the script.
-
-### Applies To
-
-Files may be set on the solution, project, and configuration level. However,
-only project-level file lists are currently supported.
-
-### Parameters
-
-_file_list_ specifies one or more file patterns, separated by commas. File
-paths should be specified relative to the location of the script file. File
-patterns may contain the ***** wildcard to match against files in the current
-directory, or the ****** wildcard to perform a recursive match.
-
-If a wildcard matches more files than you would like, you may filter the list
-using the [excludes][13] function.
-
-### Examples
-
-Add two files to the current project.
-
-
- files { "hello.cpp", "goodbye.cpp" }
-
-Add all C++ files from the **src/** directory to the project.
-
-Add all C++ files from the **src/** directory, and any subdirectories.
-
-The **flags** function specifies build flags to modify the compiling or linking
-process.
-
-If a project includes multiple calls to **flags** the lists are concatenated,
-in the order in which they appear in the script.
-
-**Updated information is [available on the new Premake wiki][14]**.
-
-### Applies To
-
-Solutions, projects, and configurations.
-
-### Parameters
-
-_flags_list_ is a list of string flag names; see below for a list of valid
-flags. The flag values are **not** case-sensitive. Flags that are not supported
-by a particular platform or toolset are ignored.
-
-EnableSSE, EnableSSE2 : Use the SSE instruction sets for floating point math.
-
-EnableMinimalRebuild : Enable Visual Studio's [minimal rebuild feature][15]. This will also disable multiprocessor compilation.
-
-ExtraWarnings : Sets the compiler's maximum warning level.
-
-FatalWarnings : Treat warnings as errors.
-
-FloatFast : Enable floating point optimizations at the expense of accuracy.
-
-FloatStrict : Improve floating point consistency at the expense of performance.
-
-Managed : Enable Managed C++ (.NET).
-
-MFC : Enable support for Microsoft Foundation Classes.
-
-NativeWChar, NoNativeWChar : Enable or disable support for the **wchar** data
-type. If no flag is specified, the toolset default will be used.
-
-No64BitChecks : Disable 64-bit portability warnings.
-
-NoEditAndContinue : Disable support for Visual Studio's Edit-and-Continue
-feature.
-
-NoExceptions : Disable C++ exception support.
-
-NoFramePointer : Disable the generation of stack frame pointers.
-
-NoIncrementalLink : Disable support for Visual Studio's incremental linking
-feature.
-
-NoImportLib : Prevent the generation of an import library for a Windows DLL.
-
-NoManifest : Prevent the generation of a manifest for Windows executables and
-shared libraries.
-
-NoMultiProcessorCompilation : Disable multiprocessor compilation in Visual Studio.
-
-NoPCH : Disable precompiled header support. If not specified, the toolset
-default behavior will be used. Also see [pchheader][16] and [pchsource][17].
-
-NoRTTI : Disable C++ runtime type information.
-
-Optimize : Perform a balanced set of optimizations.
-
-OptimizeSize : Optimize for the smallest file size.
-
-OptimizeSpeed : Optimize for the best performance.
-
-SEH : Enable [structured exception handling][18].
-
-StaticRuntime : Perform a static link against the standard runtime libraries.
-
-Symbols : Generate debugging information.
-
-Unicode : Enable Unicode strings. If not specified, the default toolset
-behavior is used.
-
-Unsafe : Enable the use of unsafe code in .NET applications.
-
-UnsignedChar : Force char type to be unsigned.
-
-WinMain : Use **WinMain()** as the program entry point for Windows
-applications, rather than the default **main()**.
-
-If the existing flags are not sufficient, you can also pass tool-specific
-arguments directly to the compiler or linker using [buildoptions][19] and
-[linkoptions][20].
-
-### Examples
-
-A common configuration: enable debugging symbols in the Debug configuration,
-and optimize the Release configuration.
-
-
- configuration "Debug" flags { "Symbols" } &nbsp; configuration "Release"
- flags { "Optimize" }
-
-You can specify multiple flags.
-
-
- flags { "Symbols", "ExtraWarnings", "FatalWarnings" }
-
-The **framework** function selects a .NET framework version.
-
-This value currently is only applied to Visual Studio 2005 or later, and GNU
-makefiles using Mono. If no framework is specified the toolset default is used.
-
-### Applies To
-
-Solutions and projects.
-
-### Parameters
-
-_version_ is one of:
-
-### Examples
-
-Use the .NET 3.0 Framework.
-
-The **iif** function implements an immediate "if" clause, returning one of two
-possible values.
-
-
- result = iif(condition, trueval, falseval)
-
-### Parameters
-
-_condition_ is the logical condition to test. _trueval_ is the value to return
-if the condition evaluates to true, _falseval_ if the condition evaluates
-false.
-
-### Return Value
-
-_trueval_ is the condition evaluates true, _falseval_ otherwise.
-
-### Examples
-
-
- result = iif(os.is("windows"), "is windows", "is not windows")
-
-Note that all expressions are evaluated before the condition is checked; the
-following expression can not be implemented with an immediate if because it may
-try to concatenate a string value.
-
-
- result = iif(x ~= nil, "x is " .. x, "x is nil")
-
-The **imageoptions** function passes arguments directly to the image tool
-command line without translation.
-
-
- imageoptions { "options" }
-
-If a project includes multiple calls to **imageoptions** the lists are
-concatenated, in the order in which they appear in the script.
-
-Image options are currently only supported for Xbox 360 targets.
-
-### Applies To
-
-Solutions, projects, and configurations.
-
-### Parameters
-
-_options_ is a list of image tools flags and options.
-
-The **imagepath** function sets the file name of the deployment image produced
-by the build.
-
-This value is currently only used by the Xbox 360.
-
-### Applies To
-
-Solutions, projects, and configurations.
-
-### Parameters
-
-_path_ is the full path for the image file, relative to the currently executing
-script file.
-
-### See Also
-
-[imageoptions][21]
-
-The **implibdir** function specifies the import library output directory.
-Import libraries are generated for Windows DLL projects.
-
-By default, the generated project files will place the import library in the
-same directory as the compiled binary. The **implibdir** function allows you to
-change this location.
-
-### Applies To
-
-Solutions, projects, and configurations.
-
-### Parameters
-
-_path_ is the output directory for the library, relative to the currently
-executing script file.
-
-### See Also
-
-[implibname][22] [implibextension][23] [implibprefix][24] [implibsuffix][25]
-
-### Examples
-
-The **implibextension** function specifies the import library file extension.
-Import libraries are generated for Windows DLL projects.
-
-By default, the toolset static library file extension will be used (**.lib**
-with Windows tools, **.a** with GNU tools). The **implibextension** function
-allows you to change this default.
-
-### Applies To
-
-Solutions, projects, and configurations.
-
-### Parameters
-
-_ext_ is the new file extension, including the leading dot.
-
-### See Also
-
-[implibname][22] [implibdir][26] [implibprefix][24] [implibsuffix][25]
-
-### Examples
-
-The **implibname** function specifies the import library base file name. Import
-libraries are generated for Windows DLL projects.
-
-By default, the [target name][27] will be used as the import library file name.
-The **implibname** function allows you to change this default.
-
-### Applies To
-
-Solutions, projects, and configurations.
-
-### Parameters
-
-_name_ is the new base file name.
-
-### See Also
-
-[implibdir][26] [implibextension][23] [implibprefix][24] [implibsuffix][25]
-
-### Examples
-
-The **implibprefix** function specifies the import library file name prefix.
-Import libraries are generated for Windows DLL projects.
-
-By default, the system naming convention will be used: no prefix on Windows, a
-prefix of "lib" (as in **libMyProject.a**) on other systems. The
-**implibprefix** function allows you to change this default.
-
-### Applies To
-
-Solutions, projects, and configurations.
-
-### Parameters
-
-_prefix_ is the new file name prefix.
-
-### See Also
-
-[implibname][22] [implibdir][26] [implibextension][23] [implibsuffix][25]
-
-### Examples
-
-The prefix may also be set to an empty string for no prefix.
-
-The **implibsuffix** function specifies a file name suffix for the import
-library base file name. Import libraries are generated for Windows DLL
-projects.
-
-### Applies To
-
-Solutions, projects, and configurations.
-
-### Parameters
-
-_suffix_ is the new filename suffix.
-
-### See Also
-
-[implibname][22] [implibdir][26] [implibprefix][24] [implibextension][23]
-
-### Examples
-
-
- -- Add "-d" to debug versions of files configuration "Debug" implibsuffix
- "-d"
-
-The **include** function looks for a file named **premake4.lua** in a specified
-directory, and includes it in the current script.
-
-This is equivalent to:
-
-
- dofile "directory/premake4.lua"
-
-This allows you to specify each project in its own **premake4.lua** file, and
-then easily include them into a solution, or multiple solutions.
-
-### Parameters
-
-_directory_ is the path to the included directory, relative to the currently
-executing script file. The directory must contain a **premake4.lua** file, or
-an error will occur. If you wish to call a file other than **premake4.lua**,
-use the [dofile][28] function instead.
-
-### Return Value
-
-Any values returned by the included script are passed through to the caller.
-
-### Examples
-
-
- -- runs "src/MyApplication/premake4.lua" include "src/MyApplication" &nbsp;
- -- runs "src/MyLibrary/premake4.lua" include "src/MyLibrary"
-
-The **includedirs** function specifies the include file search paths.
-
-If a project includes multiple calls to **includedirs** the lists are
-concatenated, in the order in which they appear in the script.
-
-### Applies To
-
-Solutions, projects, and configurations.
-
-### Parameters
-
-_paths_ specifies a list of include file search directories. Paths should be
-specified relative to the currently running script file.
-
-### Examples
-
-Define two include file search paths.
-
-
- includedirs { "../lua/include", "../zlib" }
-
-You can also use wildcards to match multiple directories. The ***** will match
-against a single directory, ****** will recurse into subdirectories as well.
-
-
- includedirs { "../includes/**" }
-
-The **kind** function sets the kind of binary object being created by the
-project, such as a console or windowed application, or a shared or static
-library.
-
-**Updated information is [available on the new Premake wiki][29]**.
-
-### Applies To
-
-Solutions, projects, and configurations.
-
-### Parameters
-
-_kind_ is the project kind identifier, and must be one of:
-
-ConsoleApp : A console, or command-line, executable.
-
-WindowedApp : An application that runs in a desktop window. This distinction
-does not apply on Linux, but is important on Windows and Mac OS X.
-
-SharedLib : A shared library, or DLL.
-
-StaticLib : A static library.
-
-### Examples
-
-Set the project to generate a console executable.
-
-Set the project to generate a shared library (DLL).
-
-You can also set different kinds for each configuration. **This is not
-supported by Xcode.**
-
-
- solution "MySolution" configurations { "DebugLib", "ReleaseLib",
- "DebugDLL", "ReleaseDLL" } &nbsp; project "MyProject" configuration "*Lib"
- kind "StaticLib" &nbsp; configuration "*DLL" kind "SharedLib"
-
-The **language** function sets the programming language used by a project.
-
-Premake currently supports **C**, **C++**, and **C#**. Not all languages are
-supported by all of the generators; for instance, SharpDevelop does not
-(currently) support C or C++ development, and Code::Blocks does not support the
-.NET languages (C#, Managed C++).
-
-### Applies To
-
-Solutions and projects.
-
-### Parameters
-
-_lang_ is the language identifier. This is a string value, set to one of **C**,
-**C++**, or **C#**. The value is not case sensitive.
-
-### Examples
-
-Set the project language to C++.
-
-Set the project language to C#
-
-The **libdirs** function specifies the library search paths.
-
-Library search directories are not well supported by the .NET tools. Visual
-Studio will change relative paths to absolute, making it difficult to share the
-generated project. MonoDevelop and SharpDevelop do not support search
-directories at all, using only the GAC. In general, it is better to include the
-full (relative) path to the assembly in [links][30] instead. C/C++ projects do
-not have this limitation.
-
-If a project includes multiple calls to **libdirs** the lists are concatenated,
-in the order in which they appear in the script.
-
-### Applies To
-
-Solutions, projects, and configurations.
-
-### Parameters
-
-_paths_ specifies a list of library search directories. Paths should be
-specified relative to the currently running script file.
-
-### Examples
-
-Define two library file search paths.
-
-
- libdirs { "../lua/libs", "../zlib" }
-
-You can also use wildcards to match multiple directories. The ***** will match
-against a single directory, ****** will recurse into subdirectories as well.
-
-The **linkoptions** function passes arguments directly to the linker command
-line without translation.
-
-
- linkoptions { "options" }
-
-If a project includes multiple calls to **linkoptions** the lists are
-concatenated, in the order in which they appear in the script.
-
-### Applies To
-
-Solutions, projects, and configurations.
-
-### Parameters
-
-_options_ is a list of linker flags and options, specific to a particular
-linker.
-
-### Examples
-
-Use `pkg-config` style configuration when building on Linux with GCC. Build
-options are always linker specific and should be targeted to a particular
-toolset.
-
-
- configuration { "linux", "gmake" } linkoptions { "`wx-config --libs`" }
-
-The **links** function specifies a list of libraries and projects to link
-against.
-
-If a project includes multiple calls to **links** the lists are concatenated,
-in the order in which they appear in the script.
-
-### Applies To
-
-Solutions, projects, and configurations.
-
-### Parameters
-
-_references_ is a list of library and project names.
-
-When linking against another project in the same solution, specify the project
-name here, rather than the library name. Premake will figure out the correct
-library to link against for the current configuration, and will also create a
-dependency between the projects to ensure a proper build order.
-
-When linking against system libraries, do not include any prefix or file
-extension. Premake will use the appropriate naming conventions for the current
-platform.
-
-### Examples
-
-Link against some system libraries.
-
-
- configuration "windows" links { "user32", "gdi32" } &nbsp; configuration
- "linux" links { "m", "png" } &nbsp; configuration "macosx" -- OS X
- frameworks need the extension to be handled properly links {
- "Cocoa.framework", "png" }
-
-In a solution with two projects, link the library into the executable. Note
-that the project name is used to specify the link; Premake will automatically
-figure out the correct library file name and directory and create a project
-dependency.
-
-
- solution "MySolution" configurations { "Debug", "Release" } language "C++"
- &nbsp; project "MyExecutable" kind "ConsoleApp" files "**.cpp" links {
- "MyLibrary" } &nbsp; project "MyLibrary" kind "SharedLib" files "**.cpp"
-
-You may also create links between non-library projects. In this case, Premake
-will generate a build dependency (the linked project will build first), but not
-an actual link. In this example, MyProject uses a build dependency to ensure
-that MyTool gets built first. It then uses MyTool as part of its build process.
-
-
- solution "MySolution" configurations { "Debug", "Release" } language "C++"
- &nbsp; project "MyProject" kind "ConsoleApp" files "**.cpp" links {
- "MyTool" } prebuildcommands { "MyTool --dosomething" } &nbsp; project
- "MyTool" kind "ConsoleApp" files "**.cpp"
-
-The **location** function sets the destination directory for a generated
-solution or project file.
-
-By default, solution and project files are generated into the same directory as
-the script that defines them. The **location** function allows you to change
-this location.
-
-Note that unlike other values, **location** does not automatically propagate to
-the contained projects. Projects will use their default location unless
-explicitly overridden.
-
-### Applies To
-
-Solutions and projects.
-
-### Parameters
-
-_path_ is the directory where the generated files should be stored, specified
-relative to the currently executing script file.
-
-### Examples
-
-Set the destination directory for a solution. Setting the location for a
-project works the same way.
-
-
- solution "MySolution" 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][31] 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.
-
-
- location ("../build/" .. _ACTION)
-
-The **newaction** function registers a new command-line action argument. For
-more information, see [Command Line Arguments][3].
-
-### Parameters
-
-_description_ is a table describing the new action. It may contain the
-following fields:
-
-trigger : The string identifier of the action; what the user would type on the
-command line.
-
-description : A short description of the action, to be displayed in the help
-text.
-
-execute : A function to be executed when the action is fired.
-
-### See Also
-
-[Command Line Arguments][3]
-
-### Examples
-
-Register a new action to install the software project.
-
-
- newaction { trigger = "install", description = "Install the software",
- execute = function () os.copyfile("bin/debug/myprogram",
- "/usr/local/bin/myprogram") end }
-
-The **newoption** function registers a new command-line option argument. For
-more information, see [Command Line Arguments][3].
-
-### Parameters
-
-_description_ is a table describing the new option. It may contain the
-following fields:
-
-trigger : The string identifier of the option; what the user would type on the
-command line.
-
-description : A short description of the option, to be displayed in the help
-text.
-
-value : Optional. If the option needs a value, provides a hint to the user what
-type of data is expected.
-
-allowed : Optional. A list of key-value pairs listing the allowed values for
-the option.
-
-### See Also
-
-[Command Line Arguments][3]
-
-### Examples
-
-Register a new option to select a rendering API for a 3D application.
-
-
- newoption { trigger = "gfxapi", value = "API", description =
- "Choose a particular 3D API for rendering", allowed = { { "opengl",
- "OpenGL" }, { "direct3d", "Direct3D (Windows only)" }, { "software",
- "Software Renderer" } } }
-
-The **objdir** function sets object and intermediate file directory for a
-project.
-
-By default, object and intermediate files are stored in a directory named "obj"
-in the same directory as the project. The **objdir** function allows you to
-change this location.
-
-**Updated information is [available on the new Premake wiki][32]**.
-
-### Applies To
-
-Solutions, projects, and configurations.
-
-### Parameters
-
-_path_ is the directory where the object and intermediate files should be
-stored, specified relative to the currently executing script file.
-
-### Examples
-
-Set an object directory for a project.
-
-
- project "MyProject" objdir "objects"
-
-Set object directories per configuration.
-
-
- configuration "Debug" objdir "../obj_debug" &nbsp; configuration "Release"
- objdir "../obj_release"
-
-The **os.chdir** function changes the current working directory.
-
-### Parameters
-
-_path_ is the file system path to the new working directory.
-
-### Return Value
-
-**True** if successful, otherwise **nil** and an error message.
-
-The **os.copyfile** function copies a file from one location to another.
-
-
- os.copyfile("source", "destination")
-
-### Parameters
-
-_Source_ is the file system path to the file to be copied. _Destination_ is the
-path to the copy location.
-
-### Return Value
-
-**True** if successful, otherwise **nil** and an error message.
-
-The **os.findlib** function scans the well-known system locations looking for a
-library file.
-
-
- p = os.findlib("libname")
-
-### Parameters
-
-_libname_ is name of the library to locate. It may be specified with
-(libX11.so) or without (X11) system-specific decorations.
-
-### Return Value
-
-The path containing the library file, if found. Otherwise, nil.
-
-The **os.get** function identifies the currently targeted operating system.
-
-### Parameters
-
-None.
-
-### Return Value
-
-An operating system identifier, one of **bsd**, **linux**, **macosx**,
-**solaris**, or **windows**.
-
-Note that this function returns the OS being targeted, which is not necessarily
-the same as the OS on which Premake is being run. If you are running on Mac OS
-X and generating Visual Studio project files, the identifier is "Windows",
-since that is the OS being targeted by the Visual Studio action.
-
-### Example
-
-
- if os.get() == "windows" then -- do something Windows-specific end
-
-The **os.getcwd** function gets the current working directory.
-
-### Parameters
-
-None.
-
-### Return Value
-
-The current working directory.
-
-Retrieve version information for the host operating system.
-
-Introduced in **Premake 4.4**, this function has not yet been implemented for
-all platforms. On platforms where this has not been implemented, it will return
-zero for all version numbers, and the platform name as the description.
-
-### Return Value
-
-A table, containing the following key-value pairs:
-
-majorversion The major version number
-
-minorversion The minor version number
-
-revision The bug fix release or service pack number
-
-description A human-readable description of the OS version
-
-### Examples
-
-
- local ver = os.getversion() print(string.format(" %d.%d.%d (%s)",
- ver.majorversion, ver.minorversion, ver.revision, ver.description)) &nbsp;
- -- On Windows XP: "5.1.3 (Windows XP)" -- On OS X,: "10.6.6 (Mac OS X Snow
- Leopard)"
-
-The **os.is** function checks the current operating system identifier against a
-particular value.
-
-### Parameters
-
-_id_ is one of the operating system identifiers **bsd**, **linux**, **macosx**,
-**solaris**, or **windows**.
-
-Note that this function tests against the OS being targeted, which is not
-necessarily the same as the OS on which Premake is being run. If you are
-running on Mac OS X and generating Visual Studio project files, the identifier
-is "Windows", since that is the OS being targeted by the Visual Studio action.
-
-### Return Value
-
-True if the supplied ID matches the current operating system identifier, false
-otherwise.
-
-The **os.is64bit** function determines if the host is using a 64-bit processor.
-
-Introduced in **Premake 4.4**.
-
-### Return Value
-
-**True** if the host system has a 64-bit processor, **false** otherwise.
-
-### Examples
-
-
- if os.is64bit() then print("This is a 64-bit system") else print("This is
- NOT a 64-bit system") end
-
-The **os.isdir** function checks for the existence of directory.
-
-### Parameters
-
-_Path_ is the file system path to check.
-
-### Return Value
-
-**True** if a matching directory is found; **false** is there is no such file
-system path, or if the path points to a file instead of a directory.
-
-The **os.isfile** function checks for the existence of file.
-
-### Parameters
-
-_Path_ is the file system path to check.
-
-### Return Value
-
-**True** if a matching file is found; **false** is there is no such file system
-path, or if the path points to a directory instead of a file.
-
-The **os.matchdirs** function performs a wildcard match to locate one or more
-directories.
-
-
- matches = os.matchdirs("pattern")
-
-### Parameters
-
-_patterm_ is the file system path to search. It may contain single
-(non-recursive) or double (recursive) asterisk wildcard patterns.
-
-### Return Value
-
-A list of directories which match the specified pattern. May be empty.
-
-### Example
-
-
- matches = os.matchdirs("src/*") -- non-recursive match matches =
- os.matchdirs("src/**") -- recursive match &nbsp; matches =
- os.matchdirs("src/test*") -- may also match partial names
-
-The **os.matchdirs** function performs a wildcard match to locate one or more
-directories.
-
-
- matches = os.matchfiles("pattern")
-
-### Parameters
-
-_patterm_ is the file system path to search. It may contain single
-(non-recursive) or double (recursive) asterisk wildcard patterns.
-
-### Return Value
-
-A list of files which match the specified pattern. May be empty.
-
-### Example
-
-
- matches = os.matchfiles("src/*.c") -- non-recursive match matches =
- os.matchfiles("src/**.c") -- recursive match
-
-The **os.mkdir** function creates a new directory.
-
-### Parameters
-
-_Path_ is the file system path to be created.
-
-### Return Value
-
-**True** if successful, otherwise **nil** and an error message.
-
-The **os.outputof** function runs a shell command and returns the output.
-
-
- result = os.outputof("command")
-
-### Parameters
-
-_command_ is a shell command to run.
-
-### Return Value
-
-The output of the command.
-
-### Examples
-
-
- -- Get the ID for the host processor architecture local proc =
- os.outputof("uname -p")
-
-The **os.pathsearch** function searches a collection of paths for a particular
-file.
-
-
- p = os.pathsearch("fname", "path1", ...)
-
-### Parameters
-
-_fname_ is the name of the file being searched. This is followed by one or more
-path sets to be searched.
-
-Path sets match the format of the PATH environment variable: a colon-delimited
-list of paths. On Windows, you may use a semicolon-delimited list if drive
-letters might be included.
-
-### Return Value
-
-The path to the directory which contains the file, if found. Otherwise, nil.
-
-### Examples
-
-
- local p = os.pathsearch("mysystem.config", "./config:/usr/local/etc:/etc")
-
-The **os.rmdir** function removes an existing directory as well as any files or
-subdirectories it contains.
-
-### Parameters
-
-_path_ is the file system path to be removed.
-
-### Return Value
-
-**True** if successful, otherwise **nil** and an error message.
-
-The **os.stat** function retrieves information about a file.
-
-Added in Premake 4.4.
-
-### Parameters
-
-_path_ is the filesystem path to file for which to retrieve information.
-
-### Return Value
-
-A table of values:
-
-mtime : Last modified timestamp
-
-size : The file size in bytes
-
-The **os.uuid** function returns a [Universally Unique Identifier][33].
-
-### Parameters
-
-None.
-
-### Return Value
-
-A new UUID, a string value with the format
-**74CFC033-FA4D-4B1E-A871-7DC48FA36769**.
-
-The **path.getabsolute** function converts a relative path an absolute path.
-
-
- p = path.getabsolute("path")
-
-### Parameters
-
-_path_ is the relative path to be converted. It does not need to actually exist
-on the file system.
-
-### Return Value
-
-A new absolute path, calculated from the current working directory.
-
-The **path.getbasename** function returns the base file portion of a path, with
-the directory and file extension removed.
-
-
- p = path.getbasename("path")
-
-### Parameters
-
-_path_ is the file system path to be split.
-
-### Return Value
-
-The base name portion of the supplied path, with any directory and file
-extension removed.
-
-The **path.getdirectory** function returns the directory portion of a path,
-with any file name removed.
-
-
- p = path.getdirectory("path")
-
-### Parameters
-
-_path_ is the file system path to be split.
-
-### Return Value
-
-The directory portion of the path, with any file name removed. If the path does
-not include any directory information, the "." (single dot) current directory
-is returned.
-
-The **path.getdrive** function returns the drive letter portion of a path, if
-present.
-
-
- p = path.getdrive("path")
-
-### Parameters
-
-_path_ is the file system path to be split.
-
-### Return Value
-
-The drive letter portion of the path, if one is specified. Otherwise, nil.
-
-The **path.getextension** function returns the file extension portion of a
-path.
-
-
- p = path.getextension("path")
-
-### Parameters
-
-_path_ is the file system path to be split.
-
-### Return Value
-
-The file extension portion of the path, or an empty string if no extension is
-present.
-
-The **path.getname** function returns the file name and extension, with any
-directory information removed.
-
-### Parameters
-
-_path_ is the file system path to be split.
-
-### Return Value
-
-The file name and extension, with no directory information.
-
-The **path.getrelative** function computes a relative path from one directory
-to another.
-
-
- p = path.getrelative("src", "dest")
-
-### Parameters
-
-_src_ is the originating directory, _dest_ is the target directory. Both may be
-specified as absolute or relative.
-
-### Return Value
-
-A relative path from _src_ to _dest_.
-
-The **path.isabsolute** function returns true if the specified path is an
-absolute path.
-
-### Parameters
-
-_path_ is the file system path to check.
-
-### Return Value
-
-**True** if the specified path is absolute, **false** otherwise.
-
-The **path.iscfile** function returns true if the specified path represents a C
-source code file, based on its file extension.
-
-### Parameters
-
-_path_ is the file system path to check.
-
-### Return Value
-
-**True** if the path matches a well-known C file extension, **false**
-otherwise.
-
-The **path.iscppfile** function returns true if the specified path represents a
-C++ source code file, based on its file extension.
-
-### Parameters
-
-_path_ is the file system path to check.
-
-### Return Value
-
-**True** if the path matches a well-known C++ file extension, **false**
-otherwise.
-
-The **path.isresourcefile** function returns true if the specified path
-represents a Windows resource file, based on its file extension.
-
-
- path.isresourcefile("path")
-
-### Parameters
-
-_path_ is the file system path to check.
-
-### Return Value
-
-**True** if the path matches a well-known Windows resource file extension,
-**false** otherwise.
-
-The **path.join** function joins two path portions together into a single path.
-
-
- path.join("leading", "trailing")
-
-If _trailing_ is an absolute path, then the leading portion is ignored, and the
-absolute path is returned instead (see below for examples).
-
-### Parameters
-
-_leading_ is the beginning portion of the path; _trailing_ is the ending
-portion.
-
-### Return Value
-
-A merged path.
-
-### Examples
-
-
- -- returns "MySolution/MyProject" p = path.join("MySolution", "MyProject")
- &nbsp; -- returns "/usr/bin", because the trailing path is absolute p =
- path.join("MySolution", "/usr/bin") &nbsp; -- tokens are assumed to be
- absolute; this returns "$(ProjectDir)" p = path.join("MySolution",
- "$(ProjectDir)")
-
-The **path.rebase** function takes a relative path and makes it relative to a
-different location.
-
-
- path.rebase("path", "oldbase", "newbase")
-
-### Parameters
-
-_path_ is the relative path to conver. _oldbase_ is the original base
-directory, from with _path_ is relative. _newbase_ is the new base directory,
-from where the resulting path should be relative.
-
-### Return Value
-
-The rebased path.
-
-The **path.translate** function converts the file separators in a path.
-
-
- path.translate("path", "newsep")
-
-### Parameters
-
-_path_ is the file system path to translate. _newsep_ is the new path
-separator.
-
-If _newsep_ is nil, the native path separator for the current environment will
-be used.
-
-### Return Value
-
-The translated path.
-
-The **pchheader** function sets the main header file for precompiled header
-support.
-
-If no header file is set, the toolset default settings will be used.
-
-**Updated information is [available on the new Premake wiki][34]**.
-
-### Applies To
-
-Projects only.
-
-### Parameters
-
-_file_ is the name of the header file, as it is specified in your source file
-**#include** statements.
-
-### See Also
-
-[pchsource][17]
-
-### Examples
-
-
- pchheader "afxwin.h" pchsource "afxwin.cpp"
-
-The **pchsource** function sets the main source file for precompiled header
-support. This is only used by Visual Studio.
-
-If no source file is set, the toolset default settings will be used.
-
-**Updated information is [available on the new Premake wiki][35]**.
-
-### Applies To
-
-Projects only.
-
-### Parameters
-
-_file_ is the name of the source file, specified relative to the currently
-executing script file.
-
-### See Also
-
-[pchheader][16]
-
-### Examples
-
-
- pchheader "afxwin.h" pchsource "afxwin.cpp"
-
-_Platform support is a new, experimental feature which will be introduced in
-**Premake 4.1**. The syntax and behavior described here might change as we sort
-out the details._
-
-The **platforms** function specifies a set of target hardware platforms for a
-solution. This is an optional setting; if it is not provided the toolset's
-default behavior will be used.
-
-
- platforms { "identifiers" }
-
-Please see the [Platforms section of the user guide][36] for a lot more
-information on platforms and how they are used by Premake.
-
-**Updated information is [available on the new Premake wiki][37].**
-
-### Applies To
-
-Solutions only.
-
-### Parameters
-
-_identifiers_ is a list of hardware platform identifiers, and may include any
-of the following.
-
-Native : A general build not targeting any particular platform; uses the
-default build behavior of the compiler. If your project can be built in a
-generic fashion, you should include this as the first platform option.
-
-x32 : Target a 32-bit environment.
-
-x64 : Target a 64-bit environment
-
-Universal : Create a Mac OS X universal binary, targeting both 32- and 64-bit
-versions of x86 and PPC. Note that in order to target multiple architectures,
-automated dependency generation must be turned off. You should always do a
-clean build when creating a universal target. Universal builds are not
-supported by Visual Studio.
-
-Universal32 : Like Universal above, but targeting only 32-bit platforms.
-
-Universal64 : Like Universal above, but targeting only 64-bit platforms.
-
-PS3 : Target the Playstation 3.
-
-Xbox360 : Target the Xbox 360 compiler and linker under Visual Studio; ignored
-elsewhere.
-
-Not all platforms are supported on all systems, unsupported platforms will be
-silently ignored. Some targets require extra configuration of the build tools
-on the client machine in order to support cross-compilation.
-
-### Return Value
-
-The function returns the current list of target platforms for the active
-solution.
-
-### Examples
-
-Provide a generic build that will work anywhere, as well as a Mac OS X
-Universal build.
-
-
- solution "MySolution" configurations { "Debug", "Release" } platforms {
- "native", "universal" }
-
-Provide 32- and 64-bit specific build targets. No generic build is provided, so
-one of these two platforms must always be used. Do this only if your software
-requires knowledge of the underlying architecture at build time, otherwise
-include "native" to provide a generic build.
-
-
- solution "MySolution" configurations { "Debug", "Release" } platforms {
- "x32", "x64" }
-
-You can retrieve the current list of platforms by calling the function with no
-parameters.
-
-Once you have defined a list of platforms, you may use those identifiers to set
-up [configuration filters][38] and apply platform-specific settings.
-
-
- configuration "x64" defines "IS_64BIT" &nbsp; -- You can also mix platforms
- with other configuration selectors configuration { "Debug", "x64" } defines
- "IS_64BIT_DEBUG"
-
-The **postbuildcommands** function specifies shell commands to run after build
-is finished.
-
-
- postbuildcommands { "commands" }
-
-### Applies To
-
-Solutions, projects, and configurations.
-
-### Parameters
-
-_commands_ is one or more shell commands. These commands will be passed to the
-shell exactly as entered, including path separators and the like.
-
-### See Also
-
-[prebuildcommands][39] [prelinkcommands][40]
-
-### Examples
-
-
- configuration "windows" postbuildcommands { "copy default.config
- bin\project.config" } &nbsp; configuration "not windows" postbuildcommands
- { "cp default.config bin/project.config" }
-
-The **prebuildcommands** function specifies shell commands to run before each
-build.
-
-
- prebuildcommands { "commands" }
-
-### Applies To
-
-Solutions, projects, and configurations.
-
-### Parameters
-
-_commands_ is one or more shell commands. These commands will be passed to the
-shell exactly as entered, including path separators and the like.
-
-### See Also
-
-[prelinkcommands][40] [postbuildcommands][41]
-
-### Examples
-
-
- configuration "windows" prebuildcommands { "copy default.config
- bin\project.config" } &nbsp; configuration "not windows" prebuildcommands {
- "cp default.config bin/project.config" }
-
-The **prelinkcommands** function specifies shell commands to run after the
-source files have been compiled, but before the link step.
-
-
- prelinkcommands { "commands" }
-
-### Applies To
-
-Solutions, projects, and configurations.
-
-### Parameters
-
-_commands_ is one or more shell commands. These commands will be passed to the
-shell exactly as entered, including path separators and the like.
-
-### See Also
-
-[prebuildcommands][39] [postbuildcommands][41]
-
-### Examples
-
-
- configuration "windows" prelinkcommands { "copy default.config
- bin\project.config" } &nbsp; configuration "not windows" prelinkcommands {
- "cp default.config bin/project.config" }
-
-The **printf** performs like its C counterpart, printing a formatted string.
-
-It is equivalent to this Lua code:
-
-
- print(string.format(format, unpack(arg))
-
-### Parameters
-
-_format_ is a formatting string containing C **printf()** style formatting
-codes. It is followed by a list of arguments to be substituted into the format
-string.
-
-### Return Value
-
-None.
-
-The **project** function creates a new project and makes it active.
-
-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 a unique name for the project. If a project with the given name
-already exists, it is made active and returned. The project name will be used
-as the file name of the generated solution file.
-
-### Return Value
-
-The function returns the active project object; see [The Project Object][42]
-below for more information on the structure of this object.
-
-### See Also
-
-[solution][43]
-
-### 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.
-
-
- solution "MySolution" configurations { "Debug", "Release" } &nbsp; project
- "MyProject"
-
-You can retrieve the currently active project object by calling **project**
-with no parameters.
-
-You can retrieve the list of projects associated with a solution using the
-**projects** field on the solution object, which may then be iterated over.
-
-
- local prjs = solution().projects for i, prj in ipairs(prjs) do
- print(prj.name) end
-
-### The Project Object
-
-Each project is represented in Lua as a table of key-value pairs. Unless you
-really know what you are doing, you should treat this object as read-only, and
-use the Premake API to make any changes.
-
-The project object contains the following values.
-
-basedir : The directory where the project was original defined; acts as a root
-for relative paths.
-
-blocks : A list of configuration blocks.
-
-language : The project language, if set.
-
-location : The output directory for the generated project file.
-
-name : The name of the project.
-
-solution : The solution which contains the project.
-
-uuid : The project's unique identifier.
-
-The **resdefines** function specifies preprocessor symbols for the resource
-compiler.
-
-If a project includes multiple calls to **resdefines** the lists are
-concatenated, in the order in which they appear in the script.
-
-### Applies To
-
-Solutions, projects, and configurations.
-
-### Parameters
-
-_symbols_ specifies a list of symbols to be defined.
-
-### Examples
-
-Define two new symbols in the current project.
-
-
- resdefines { "DEBUG", "TRACE" }
-
-Symbols may also assign values.
-
-
- resdefines { "CALLSPEC=__dllexport" }
-
-The **resincludedirs** function specifies the include file search paths for the
-resource compiler.
-
-
- resincludedirs { "paths" }
-
-If a project includes multiple calls to **resincludedirs** the lists are
-concatenated, in the order in which they appear in the script.
-
-### Applies To
-
-Solutions, projects, and configurations.
-
-### Parameters
-
-_paths_ specifies a list of include file search directories. Paths should be
-specified relative to the currently running script file.
-
-### Examples
-
-Define two include file search paths.
-
-
- resincludedirs { "../lua/include", "../zlib" }
-
-You can also use wildcards to match multiple directories. The ***** will match
-against a single directory, ****** will recurse into subdirectories as well.
-
-
- resincludedirs { "../includes/**" }
-
-The **resoptions** function passes arguments directly to the resource compiler
-command line without translation.
-
-If a project includes multiple calls to **resoptions** the lists are
-concatenated, in the order in which they appear in the script.
-
-### Applies To
-
-Solutions, projects, configurations
-
-### Parameters
-
-_options_ is a list of resource compiler flags and options, specific to a
-particular compiler.
-
-### Examples
-
-Use `pkg-config` style configuration when building on Linux with GCC. Build
-options are always compiler specific and should be targeted to a particular
-toolset.
-
-
- configuration { "linux", "gmake" } resoptions { "`wx-config --cxxflags`",
- "-ansi", "-pedantic" }
-
-The **solution** function creates a new solution and makes it active.
-
-Solutions are the top-level objects in a Premake build script, and are
-synonymous with a Visual Studio solution. Each solution contains one or more
-projects, which it turn contain the settings to generate a single binary
-target.
-
-### Parameters
-
-_name_ is a unique name for the solution. If a solution with the given name
-already exists, it is made active and returned. The solution name will be used
-as the file name of the generated solution file.
-
-### Return Value
-
-The function returns the active solution object; see [The Solution Object][42]
-below for more information on the structure of this object.
-
-### Examples
-
-Create a new solution named "MySolution".
-
-You can retrieve the currently active solution object by calling **solution**
-with no parameters.
-
-You can the global variable **_SOLUTIONS** to list out all of the currently
-defined solutions.
-
-
- for i, sln in ipairs(_SOLUTIONS) do print(sln.name) end
-
-### The Solution Object
-
-Each solution is represented in Lua as a table of key-value pairs. Unless you
-really know what you are doing, you should treat this object as read-only, and
-use the Premake API to make any changes.
-
-The solution object contains the following values.
-
-basedir : The directory where the project was original defined; acts as a root
-for relative paths.
-
-configurations : The list of valid configuration names.
-
-blocks : A list of configuration blocks.
-
-language : The solution language, if set.
-
-location : The output directory for the generated solution file.
-
-name : The name of the solution.
-
-platforms : A list of target platforms.
-
-projects : A list of projects contained by the solution.
-
-The **string.endswith** function returns true if the given string ends with the
-provided sequence.
-
-
- string.endswith("haystack", "needle")
-
-### Parameters
-
-_haystack_ is the string to check. _needle_ is the ending sequence to check
-against.
-
-### Return Value
-
-**True** if _haystack_ ends with _needle_.
-
-The **string.explode** function returns an array of strings, each of which is a
-substring of _s_ formed by splitting on boundaries formed by _pattern_.
-
-
- string.explode("str", "pattern")
-
-### Parameters
-
-_str_ is the string to be split. _pattern_ is the separator pattern at which to
-split; it may use Lua's pattern matching syntax.
-
-### Return Value
-
-A list of substrings.
-
-The **string.findlast** function finds the last instance of a pattern within a
-string.
-
-
- string.endswith("str", "pattern", plain)
-
-### Parameters
-
-_str_ is the string to be searched. _pattern_ is the pattern to search for; it
-may use Lua's pattern matching syntax. If _plain_ is true, no pattern matching
-will be performed (faster).
-
-### Return Value
-
-The matching pattern, if found, or nil if there were no matches.
-
-The **string.startswith** function returns true if the given string starts with
-the provided sequence.
-
-
- string.startswith("haystack", "needle")
-
-### Parameters
-
-_haystack_ is the string to check. _needle_ is the starting sequence to check
-against.
-
-### Return Value
-
-**True** if _haystack_ starts with _needle_.
-
-The **table.contains** function determines if an array contains a particular
-value.
-
-
- table.contains(arr, value)
-
-### Parameters
-
-_arr_ is the array to test; _value_ is the value being tested for.
-
-### Return Value
-
-True if the array contains the value, false otherwise.
-
-The **table.implode** function merges an array of items into a single,
-formatted string.
-
-
- table.implode(arr, "before", "after", "between")
-
-### Parameters
-
-_arr_ is the array to be converted into a string. _before_ is a string to be
-inserted before each item. _after_ is a string to be inserted after each item.
-_between_ is a string to be inserted between items.
-
-### Return Value
-
-The formatted string.
-
-The **targetdir** function sets the destination directory for the compiled
-binary target.
-
-By default, the generated project files will place their compiled output in the
-same directory as the script. The **targetdir** function allows you to change
-this location.
-
-### Applies To
-
-Solutions, projects, and configurations.
-
-### Parameters
-
-_path_ is the file system path to the directory where the compiled target file
-should be stored. It is specified relative to the currently executing script
-file.
-
-### See Also
-
-[targetname][27] [targetextension][44] [targetprefix][45]
-
-### Examples
-
-This project separates its compiled output by configuration type.
-
-
- project "MyProject" &nbsp; configuration "Debug" targetdir "bin/debug"
- &nbsp; configuration "Release" targetdir "bin/release"
-
-The **targetextension** function specifies the file extension for the compiled
-binary target.
-
-By default, the project will use the system's normal naming conventions:
-**.exe** for Windows executables, **.so** for Linux shared libraries, and so
-on. The **targetextension** function allows you to change this default.
-
-### Applies To
-
-Solutions, projects, and configurations.
-
-### Parameters
-
-_ext_ is the new file extension, including the leading dot.
-
-### See Also
-
-[targetname][27] [targetdir][46] [targetprefix][45] [targetsuffix][47]
-
-### Examples
-
-The **targetname** function specifies the base file name for the compiled
-binary target.
-
-By default, the project name will be used as the file name of the compiled
-binary target. A Windows executable project named "MyProject" will produce a
-binary named **MyProject.exe**. The **targetname** function allows you to
-change this default.
-
-### Applies To
-
-Solutions, projects, and configurations.
-
-### Parameters
-
-_name_ is the new base file name.
-
-### See Also
-
-[targetdir][46] [targetextension][44] [targetprefix][45] [targetsuffix][47]
-
-### Examples
-
-The **targetprefix** function specifies the file name prefix for the compiled
-binary target.
-
-By default, the system naming convention will be used: a "lib" prefix for POSIX
-libraries (as in **libMyProject.so**), and no prefix elsewhere. The
-**targetprefix** function allows you to change this default.
-
-### Applies To
-
-Solutions, projects, and configurations.
-
-### Parameters
-
-_prefix_ is the new file name prefix.
-
-### See Also
-
-[targetname][27] [targetdir][46] [targetextension][44] [targetsuffix][47]
-
-### Examples
-
-The prefix may also be set to an empty string for no prefix.
-
-The **targetsuffix** function specifies a file name suffix for the compiled
-binary target.
-
-### Applies To
-
-Solutions, projects, and configurations.
-
-### Parameters
-
-_suffix_ is the new filename suffix.
-
-### See Also
-
-[targetname][27] [targetdir][46] [targetprefix][45] [targetextension][44]
-
-### Examples
-
-
- -- Add "-d" to debug versions of files configuration "Debug" targetsuffix
- "-d"
-
-The **uuid** function sets the [Universally Unique Identifier][33] (UUID) for a
-project.
-
-UUIDs are synonymous (for Premake's purposes) with [Globally Unique
-Identifiers][48] (GUID).
-
-Premake automatically assigns a UUID to each project, which is used by the
-Visual Studio generators to identify the project within a solution. This UUID
-is essentially random and will change each time the project file is generated.
-If you are storing the generated Visual Studio project files in a version
-control system, this will create a lot of unnecessary deltas. Using the
-**uuid** function, you can assign a fixed UUID to each project which never
-changes, removing the randomness from the generated projects.
-
-### Applies To
-
-Projects only.
-
-### Parameters
-
-_project_uuid_ is the UUID for the current project. It should take the form
-"01234567-ABCD-ABCD-ABCD-0123456789AB" (see the examples below for some real
-UUID values). You can use the Visual Studio [guidgen][49] tool to create new
-UUIDs, or [this website][50], or run Premake once to generate Visual Studio
-files and copy the assigned UUIDs.
-
-### Returns
-
-The current project UUID, or **nil** if no UUID has been set.
-
-### Examples
-
-Set the UUID for a current project.
-
-
- uuid "BE2461B7-236F-4278-81D3-F0D476F9A4C0"
-
-The **vpaths** function places files into groups or "virtual paths", rather
-than the default behavior of mirroring the filesystem in IDE-based projects. So
-you could, for instance, put all header files in a group called "Headers", no
-matter where they appeared in the source tree.
-
-
- vpaths { ["group"] = "pattern(s)" }
-
-Note that _Lua tables do not maintain any ordering between key-value pairs_, so
-there is no precedence between the supplied rules. That is, you can't write a
-rule that rewrites the results of an earlier rule, since there is no guarantee
-in which order the rules will run.
-
-Added in Premake 4.4.
-
-### Applies To
-
-Virtual paths, like files, may be set on the solution, project, and
-configuration level. However, only project-level file lists are currently
-supported.
-
-### Parameters
-
-A list of key/value pairs, specified with Lua's standard syntax, which map file
-patterns to the group in which they should appear. See the examples below for a
-more complete explanation.
-
-### Examples
-
-Place all header files into a virtual path called "Headers". Any directory
-information is removed, so a path such as **src/lua/lua.h** will appear in the
-IDE as **Headers/lua.h**.
-
-
- vpaths { ["Headers"] = "**.h" }
-
-You may also specify multiple file patterns using the table syntax.
-
-
- vpaths { ["Headers"] = { "**.h", "**.hxx", "**.hpp" } }
-
-It is also possible to include the file's path in the virtual group. Using the
-same example as above, this rule will appear in the IDE as
-**Headers/src/lua/lua.h**.
-
-
- vpaths { ["Headers/*"] = "**.h" }
-
-Any directory information explicitly provided in the pattern will be removed
-from the replacement. This rule will appear in the IDE as
-**Headers/lua/lua.h**.
-
-
- vpaths { ["Headers/*"] = "src/**.h" }
-
-You can also use virtual paths to remove extra directories from the IDE. For
-instance, this rule will cause the previous example to appear as **lua/lua.h**,
-removing the **src** part of the path from _all_ files.
-
-And of course, you can specify more than one rule at a time.
-
-
- vpaths { ["Headers"] = "**.h", ["Sources/*"] = {"**.c", "**.cpp"}, ["Docs"]
- = "**.txt" }
-
-[1]: http://www.lua.org/manual/5.1/
-[2]: http://luaforge.net/
-[3]: http://industriousone.com/command-line-arguments
-[4]: https://bitbucket.org/premake/premake-stable/wiki/buildaction
-[5]: http://industriousone.com/configurations
-[6]: http://industriousone.com/premake/quick-start
-[7]: http://industriousone.com/osget
-[8]: http://industriousone.com/platforms-0
-[9]: http://industriousone.com#block
-[10]: http://industriousone.com/buildaction
-[11]: https://bitbucket.org/premake/premake-dev/wiki/configurations
-[12]: http://industriousone.com/files
-[13]: http://industriousone.com/excludes
-[14]: https://bitbucket.org/premake/premake-stable/wiki/flags
-[15]: http://msdn.microsoft.com/en-us/library/kfz8ad09(VS.80).aspx
-[16]: http://industriousone.com/pchheader
-[17]: http://industriousone.com/pchsource
-[18]: http://www.microsoft.com/msj/0197/exception/exception.aspx
-[19]: http://industriousone.com/buildoptions
-[20]: http://industriousone.com/linkoptions
-[21]: http://industriousone.com/imageoptions
-[22]: http://industriousone.com/implibname
-[23]: http://industriousone.com/implibextension
-[24]: http://industriousone.com/implibprefix
-[25]: http://industriousone.com/implibsuffix
-[26]: http://industriousone.com/implibdir
-[27]: http://industriousone.com/targetname
-[28]: http://www.lua.org/manual/5.1/manual.html#pdf-dofile
-[29]: https://bitbucket.org/premake/premake-stable/wiki/kind
-[30]: http://industriousone.com/links
-[31]: http://industriousone.com/action
-[32]: https://bitbucket.org/premake/premake-dev/wiki/objdir
-[33]: http://en.wikipedia.org/wiki/UUID
-[34]: https://bitbucket.org/premake/premake-stable/wiki/pchheader
-[35]: https://bitbucket.org/premake/premake-stable/wiki/pchsource
-[36]: http://industriousone.com/platforms
-[37]: https://bitbucket.org/premake/premake-dev/wiki/platforms
-[38]: http://industriousone.com/configuration
-[39]: http://industriousone.com/prebuildcommands
-[40]: http://industriousone.com/prelinkcommands
-[41]: http://industriousone.com/postbuildcommands
-[42]: http://industriousone.com#object
-[43]: http://industriousone.com/solution
-[44]: http://industriousone.com/targetextension
-[45]: http://industriousone.com/targetprefix
-[46]: http://industriousone.com/targetdir
-[47]: http://industriousone.com/targetsuffix
-[48]: http://en.wikipedia.org/wiki/Globally_Unique_Identifier
-[49]: http://msdn2.microsoft.com/en-us/library/ms241442(VS.80).aspx
-[50]: http://www.famkruithof.net/uuid/uuidgen
diff --git a/3rdparty/genie/src/actions/make/make_cpp.lua b/3rdparty/genie/src/actions/make/make_cpp.lua
index 9ae28a8e714..ce8279ee0fa 100644
--- a/3rdparty/genie/src/actions/make/make_cpp.lua
+++ b/3rdparty/genie/src/actions/make/make_cpp.lua
@@ -326,6 +326,7 @@
_p(' ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH)%s', make.list(table.join(cc.getcflags(cfg), cfg.buildoptions, cfg.buildoptions_c)))
_p(' ALL_CXXFLAGS += $(CXXFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH)%s', make.list(table.join(cc.getcxxflags(cfg), cfg.buildoptions, cfg.buildoptions_cpp)))
+ _p(' ALL_OBJCFLAGS += $(CXXFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH)%s', make.list(table.join(cc.getcxxflags(cfg), cfg.buildoptions, cfg.buildoptions_objc)))
_p(' ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES)%s',
make.list(table.join(cc.getdefines(cfg.resdefines),
@@ -435,12 +436,18 @@
, _MAKE.esc(path.trimdots(path.removeext(file)))
, _MAKE.esc(file)
)
- if prj.msgcompile then
+ if (path.isobjcfile(file) and prj.msgcompile_objc) then
+ _p('\t@echo ' .. prj.msgcompile_objc)
+ elseif prj.msgcompile then
_p('\t@echo ' .. prj.msgcompile)
else
_p('\t@echo $(notdir $<)')
end
- cpp.buildcommand(path.iscfile(file) and not prj.options.ForceCPP, "o")
+ if (path.isobjcfile(file)) then
+ _p('\t$(SILENT) $(CXX) $(ALL_OBJCFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%%.o=%%.d) -c "$<"')
+ else
+ cpp.buildcommand(path.iscfile(file) and not prj.options.ForceCPP, "o")
+ end
_p('')
elseif (path.getextension(file) == ".rc") then
_p('$(OBJDIR)/%s.res: %s', _MAKE.esc(path.getbasename(file)), _MAKE.esc(file))
diff --git a/3rdparty/genie/src/base/api.lua b/3rdparty/genie/src/base/api.lua
index c46567a0631..86665e4f928 100644
--- a/3rdparty/genie/src/base/api.lua
+++ b/3rdparty/genie/src/base/api.lua
@@ -53,7 +53,13 @@
kind = "list",
scope = "config",
},
-
+
+ buildoptions_objc =
+ {
+ kind = "list",
+ scope = "config",
+ },
+
configurations =
{
kind = "list",
@@ -337,6 +343,12 @@
scope = "config",
},
+ msgcompile_objc =
+ {
+ kind = "string",
+ scope = "config",
+ },
+
msgresource =
{
kind = "string",
@@ -523,7 +535,8 @@
--
-
+ premake.check_paths = false
+
--
-- Check to see if a value exists in a list of values, using a
-- case-insensitive match. If the value does exist, the canonical
@@ -649,7 +662,11 @@
end
elseif type(value) == "string" then
if value:find("*") then
- makeabsolute(matchfunc(value), depth + 1)
+ local arr = matchfunc(value);
+ if (premake.check_paths) and (#arr == 0) then
+ error("Can't find matching files for pattern :" .. value)
+ end
+ makeabsolute(arr, depth + 1)
else
table.insert(result, path.getabsolute(value))
end
diff --git a/3rdparty/genie/src/base/path.lua b/3rdparty/genie/src/base/path.lua
index 6753dbaee4d..92346db644d 100644
--- a/3rdparty/genie/src/base/path.lua
+++ b/3rdparty/genie/src/base/path.lua
@@ -210,6 +210,12 @@
return table.contains(extensions, ext)
end
+ function path.isobjcfile(fname)
+ local extensions = { ".m", ".mm" }
+ local ext = path.getextension(fname):lower()
+ return table.contains(extensions, ext)
+ end
+
function path.iscppheader(fname)
local extensions = { ".h", ".hh", ".hpp", ".hxx" }
local ext = path.getextension(fname):lower()
diff --git a/3rdparty/genie/src/host/scripts.c b/3rdparty/genie/src/host/scripts.c
index 837d46e8d07..d2108413138 100644
--- a/3rdparty/genie/src/host/scripts.c
+++ b/3rdparty/genie/src/host/scripts.c
@@ -13,9 +13,9 @@ const char* builtin_scripts[] = {
/* base/path.lua */
"function path.getabsolute(p)\np = path.translate(p, \"/\")\nif (p == \"\") then p = \".\" end\nlocal result = iif (path.isabsolute(p), nil, os.getcwd())\nfor n, part in ipairs(p:explode(\"/\", true)) do\nif (part == \"\" and n == 1) then\nresult = \"/\"\nelseif (part == \"..\") then\nresult = path.getdirectory(result)\nelseif (part ~= \".\") then\nif (part:startswith(\"$\") and n > 1) then\nresult = result .. \"/\" .. part\nelse\nresult = path.join(result, part)\nend\nend\nend\nresult = iif(result:endswith(\"/\"), result:sub(1, -2), result)\nreturn result\nend\nfunction path.getbasename(p)\nlocal name = path.getname(p)\nlocal i = name:findlast(\".\", true)\nif (i) then\nreturn name:sub(1, i - 1)\nelse\nreturn name\nend\nend\nfunction path.removeext(name)\nlocal i = name:findlast(\".\", true)\nif (i) then\nreturn name:sub(1, i - 1)\nelse\nreturn name\nend\nend\nfunction path.getdirectory(p)\nlocal i = p:findlast(\"/\", true)\nif (i) then\nif i > 1 then i = i - 1 end\nreturn p:sub(1, i)\nelse\nreturn \".\"\nend"
"\nend\nfunction path.getdrive(p)\nlocal ch1 = p:sub(1,1)\nlocal ch2 = p:sub(2,2)\nif ch2 == \":\" then\nreturn ch1\nend\nend\nfunction path.getextension(p)\nlocal i = p:findlast(\".\", true)\nif (i) then\nreturn p:sub(i)\nelse\nreturn \"\"\nend\nend\nfunction path.getname(p)\nlocal i = p:findlast(\"[/\\\\]\")\nif (i) then\nreturn p:sub(i + 1)\nelse\nreturn p\nend\nend\nfunction path.getrelative(src, dst)\nsrc = path.getabsolute(src)\ndst = path.getabsolute(dst)\nif (src == dst) then\nreturn \".\"\nend\nif dst:startswith(\"$\") then\nreturn dst\nend\nsrc = src .. \"/\"\ndst = dst .. \"/\"\nlocal idx = 0\nwhile (true) do\nlocal tst = src:find(\"/\", idx + 1, true)\nif tst then\nif src:sub(1,tst) == dst:sub(1,tst) then\nidx = tst\nelse\nbreak\nend\nelse\nbreak\nend\nend\nlocal first = src:find(\"/\", 0, true)\nif idx <= first then\nreturn dst:sub(1, -2)\nend\nsrc = src:sub(idx + 1)\ndst = dst:sub(idx + 1)\nlocal result = \"\"\nidx = src:find(\"/\")\nwhile (idx) do\nresult = result .. \"../\"\nidx = src:find(\"/\""
- ", idx + 1)\nend\nresult = result .. dst\nreturn result:sub(1, -2)\nend\nfunction path.iscfile(fname)\nlocal extensions = { \".c\", \".s\", \".m\" }\nlocal ext = path.getextension(fname):lower()\nreturn table.contains(extensions, ext)\nend\nfunction path.iscppfile(fname)\nlocal extensions = { \".cc\", \".cpp\", \".cxx\", \".c\", \".s\", \".m\", \".mm\" }\nlocal ext = path.getextension(fname):lower()\nreturn table.contains(extensions, ext)\nend\nfunction path.iscppheader(fname)\nlocal extensions = { \".h\", \".hh\", \".hpp\", \".hxx\" }\nlocal ext = path.getextension(fname):lower()\nreturn table.contains(extensions, ext)\nend\nfunction path.isresourcefile(fname)\nlocal extensions = { \".rc\" }\nlocal ext = path.getextension(fname):lower()\nreturn table.contains(extensions, ext)\nend\nfunction path.join(...)\nlocal arg={...}\nlocal numargs = select(\"#\", ...)\nif numargs == 0 then\nreturn \"\";\nend\nlocal allparts = {}\nfor i = numargs, 1, -1 do\nlocal part = select(i, ...)\nif part and #part > 0 and part ~= \""
- ".\" then\nwhile part:endswith(\"/\") do\npart = part:sub(1, -2)\nend\ntable.insert(allparts, 1, part)\nif path.isabsolute(part) then\nbreak\nend\nend\nend\nreturn table.concat(allparts, \"/\")\nend\nfunction path.rebase(p, oldbase, newbase)\np = path.getabsolute(path.join(oldbase, p))\np = path.getrelative(newbase, p)\nreturn p\nend\nfunction path.translate(p, sep)\nif (type(p) == \"table\") then\nlocal result = { }\nfor _, value in ipairs(p) do\ntable.insert(result, path.translate(value))\nend\nreturn result\nelse\nif (not sep) then\nif (os.is(\"windows\")) then\nsep = \"\\\\\"\nelse\nsep = \"/\"\nend\nend\nlocal result = p:gsub(\"[/\\\\]\", sep)\nreturn result\nend\nend\nfunction path.wildcards(pattern)\npattern = pattern:gsub(\"([%+%.%-%^%$%(%)%%])\", \"%%%1\")\npattern = pattern:gsub(\"%*%*\", \"\\001\")\npattern = pattern:gsub(\"%*\", \"\\002\")\npattern = pattern:gsub(\"\\001\", \".*\")\npattern = pattern:gsub(\"\\002\", \"[^/]*\")\nreturn pattern\nend\nfunction path.trimdots(p)\nlocal changed\nrepeat\nc"
- "hanged = true\nif p:startswith(\"./\") then\np = p:sub(3)\nelseif p:startswith(\"../\") then\np = p:sub(4)\nelse\nchanged = false\nend\nuntil not changed\nreturn p\nend\n",
+ ", idx + 1)\nend\nresult = result .. dst\nreturn result:sub(1, -2)\nend\nfunction path.iscfile(fname)\nlocal extensions = { \".c\", \".s\", \".m\" }\nlocal ext = path.getextension(fname):lower()\nreturn table.contains(extensions, ext)\nend\nfunction path.iscppfile(fname)\nlocal extensions = { \".cc\", \".cpp\", \".cxx\", \".c\", \".s\", \".m\", \".mm\" }\nlocal ext = path.getextension(fname):lower()\nreturn table.contains(extensions, ext)\nend\nfunction path.isobjcfile(fname)\nlocal extensions = { \".m\", \".mm\" }\nlocal ext = path.getextension(fname):lower()\nreturn table.contains(extensions, ext)\nend\nfunction path.iscppheader(fname)\nlocal extensions = { \".h\", \".hh\", \".hpp\", \".hxx\" }\nlocal ext = path.getextension(fname):lower()\nreturn table.contains(extensions, ext)\nend\nfunction path.isresourcefile(fname)\nlocal extensions = { \".rc\" }\nlocal ext = path.getextension(fname):lower()\nreturn table.contains(extensions, ext)\nend\nfunction path.join(...)\nlocal arg={...}\nlocal numargs = select(\"#"
+ "\", ...)\nif numargs == 0 then\nreturn \"\";\nend\nlocal allparts = {}\nfor i = numargs, 1, -1 do\nlocal part = select(i, ...)\nif part and #part > 0 and part ~= \".\" then\nwhile part:endswith(\"/\") do\npart = part:sub(1, -2)\nend\ntable.insert(allparts, 1, part)\nif path.isabsolute(part) then\nbreak\nend\nend\nend\nreturn table.concat(allparts, \"/\")\nend\nfunction path.rebase(p, oldbase, newbase)\np = path.getabsolute(path.join(oldbase, p))\np = path.getrelative(newbase, p)\nreturn p\nend\nfunction path.translate(p, sep)\nif (type(p) == \"table\") then\nlocal result = { }\nfor _, value in ipairs(p) do\ntable.insert(result, path.translate(value))\nend\nreturn result\nelse\nif (not sep) then\nif (os.is(\"windows\")) then\nsep = \"\\\\\"\nelse\nsep = \"/\"\nend\nend\nlocal result = p:gsub(\"[/\\\\]\", sep)\nreturn result\nend\nend\nfunction path.wildcards(pattern)\npattern = pattern:gsub(\"([%+%.%-%^%$%(%)%%])\", \"%%%1\")\npattern = pattern:gsub(\"%*%*\", \"\\001\")\npattern = pattern:gsub(\"%*\", \"\\002\""
+ ")\npattern = pattern:gsub(\"\\001\", \".*\")\npattern = pattern:gsub(\"\\002\", \"[^/]*\")\nreturn pattern\nend\nfunction path.trimdots(p)\nlocal changed\nrepeat\nchanged = true\nif p:startswith(\"./\") then\np = p:sub(3)\nelseif p:startswith(\"../\") then\np = p:sub(4)\nelse\nchanged = false\nend\nuntil not changed\nreturn p\nend\n",
/* base/string.lua */
"function string.explode(s, pattern, plain)\nif (pattern == '') then return false end\nlocal pos = 0\nlocal arr = { }\nfor st,sp in function() return s:find(pattern, pos, plain) end do\ntable.insert(arr, s:sub(pos, st-1))\npos = sp + 1\nend\ntable.insert(arr, s:sub(pos))\nreturn arr\nend\nfunction string.findlast(s, pattern, plain)\nlocal curr = 0\nrepeat\nlocal next = s:find(pattern, curr + 1, plain)\nif (next) then curr = next end\nuntil (not next)\nif (curr > 0) then\nreturn curr\nend\nend\nfunction string.startswith(haystack, needle)\nreturn (haystack:find(needle, 1, true) == 1)\nend\n",
@@ -80,22 +80,22 @@ const char* builtin_scripts[] = {
"l platform = premake.platforms[cfg.platform]\nif platform.iscrosscompiler then\ncfg.system = cfg.platform\nelse\ncfg.system = os.get()\nend\nif cfg.kind == \"SharedLib\" and platform.nosharedlibs then\ncfg.kind = \"StaticLib\"\nend\nlocal files = { }\nfor _, fname in ipairs(cfg.files) do\nlocal excluded = false\nfor _, exclude in ipairs(cfg.excludes) do\nexcluded = (fname == exclude)\nif (excluded) then break end\nend\nif (not excluded) then\ntable.insert(files, fname)\nend\nend\ncfg.files = files\nfor name, field in pairs(premake.fields) do\nif field.isflags then\nlocal values = cfg[name]\nfor _, flag in ipairs(values) do values[flag] = true end\nend\nend\ncfg.__fileconfigs = { }\nfor _, fname in ipairs(cfg.files) do\ncfg.terms.required = fname:lower()\nlocal fcfg = {}\nfor _, blk in ipairs(cfg.project.blocks) do\nif (premake.iskeywordsmatch(blk.keywords, cfg.terms)) then\nmergeobject(fcfg, blk)\nend\nend\nfcfg.name = fname\ncfg.__fileconfigs[fname] = fcfg\ntable.insert(cfg.__fileconfigs, fcfg)\nend\nend\n",
/* base/api.lua */
- "premake.fields =\n{\narchivesplit_size =\n{\nkind = \"string\",\nscope = \"config\",\n},\nbasedir =\n{\nkind = \"path\",\nscope = \"container\",\n},\nbuildaction =\n{\nkind = \"string\",\nscope = \"config\",\nallowed = {\n\"Compile\",\n\"Copy\",\n\"Embed\",\n\"None\"\n}\n},\nbuildoptions =\n{\nkind = \"list\",\nscope = \"config\",\n},\nbuildoptions_c =\n{\nkind = \"list\",\nscope = \"config\",\n},\nbuildoptions_cpp =\n{\nkind = \"list\",\nscope = \"config\",\n},\nconfigurations =\n{\nkind = \"list\",\nscope = \"solution\",\n},\ndebugargs =\n{\nkind = \"list\",\nscope = \"config\",\n},\ndebugdir =\n{\nkind = \"path\",\nscope = \"config\",\n},\ndebugenvs =\n{\nkind = \"list\",\nscope = \"config\",\n},\ndefines =\n{\nkind = \"list\",\nscope = \"config\",\n},\ndeploymentoptions =\n{\nkind = \"list\",\nscope = \"config\",\nusagecopy = true,\n},\nexcludes =\n{\nkind = \"filelist\",\nscope = \"config\",\n},\nfiles =\n{\nkind = \"filelist\",\nscope = \"config\",\n},\nflags =\n{\nkind = \"list\",\nscope = "
- "\"config\",\nisflags = true,\nusagecopy = true,\nallowed = function(value)\nlocal allowed_flags = {\nATL = 1,\nDebugEnvsDontMerge = 1,\nDebugEnvsInherit = 1,\nEnableMinimalRebuild = 1,\nEnableSSE = 1,\nEnableSSE2 = 1,\nExtraWarnings = 1,\nFatalWarnings = 1,\nFloatFast = 1,\nFloatStrict = 1,\nManaged = 1,\nMFC = 1,\nNativeWChar = 1,\nNo64BitChecks = 1,\nNoEditAndContinue = 1,\nNoExceptions = 1,\nNoFramePointer = 1,\nNoImportLib = 1,\nNoIncrementalLink = 1,\nNoManifest = 1,\nNoMultiProcessorCompilation = 1,\nNoNativeWChar = 1,\nNoPCH = 1,\nNoRTTI = 1,\nSingleOutputDir = 1,\nOptimize = 1,\nOptimizeSize = 1,\nOptimizeSpeed = 1,\nSEH = 1,\nStaticATL = 1,\nStaticRuntime = 1,\nSymbols = 1,\nUnicode = 1,\nUnsafe = 1,\nUnsignedChar = 1,\nWinMain = 1,\n}\nlocal englishToAmericanSpelling =\n{\noptimise = 'optimize',\noptimisesize = 'optimizesize',\noptimisespeed = 'optimizespeed',\n}\nlocal lowervalue = value:lower()\nlowervalue = englishToAmericanSpelling[lowervalue] or lowervalue\nfor v, _ in pairs(allowed_flags) do\ni"
- "f v:lower() == lowervalue then\nreturn v\nend\nend\nreturn nil, \"invalid flag\"\nend,\n},\nframework =\n{\nkind = \"string\",\nscope = \"container\",\nallowed = {\n\"1.0\",\n\"1.1\",\n\"2.0\",\n\"3.0\",\n\"3.5\",\n\"4.0\",\n\"4.5\",\n}\n},\nforcedincludes = \n{\nkind = \"absolutefilelist\",\nscope = \"config\",\n},\nimagepath =\n{\nkind = \"path\",\nscope = \"config\",\n},\nimageoptions =\n{\nkind = \"list\",\nscope = \"config\",\n},\nimplibdir =\n{\nkind = \"path\",\nscope = \"config\",\n},\nimplibextension =\n{\nkind = \"string\",\nscope = \"config\",\n},\nimplibname =\n{\nkind = \"string\",\nscope = \"config\",\n},\nimplibprefix =\n{\nkind = \"string\",\nscope = \"config\",\n},\nimplibsuffix =\n{\nkind = \"string\",\nscope = \"config\",\n},\nincludedirs =\n{\nkind = \"dirlist\",\nscope = \"config\",\nusagecopy = true,\n},\nkind =\n{\nkind = \"string\",\nscope = \"config\",\nallowed = {\n\"ConsoleApp\",\n\"WindowedApp\",\n\"StaticLib\",\n\"SharedLib\"\n}\n},\nlanguage =\n{\nkind = \"string\",\nsco"
- "pe = \"container\",\nallowed = {\n\"C\",\n\"C++\",\n\"C#\"\n}\n},\nlibdirs =\n{\nkind = \"dirlist\",\nscope = \"config\",\nlinkagecopy = true,\n},\nlinkoptions =\n{\nkind = \"list\",\nscope = \"config\",\n},\nlinks =\n{\nkind = \"list\",\nscope = \"config\",\nallowed = function(value)\nif value:find('/', nil, true) then\nvalue = path.getabsolute(value)\nend\nreturn value\nend,\nlinkagecopy = true,\n},\nlocation =\n{\nkind = \"path\",\nscope = \"container\",\n},\nmakesettings =\n{\nkind = \"list\",\nscope = \"config\",\n},\nmessageskip =\n{\nkind = \"list\",\nscope = \"solution\",\nisflags = true,\nusagecopy = true,\nallowed = function(value)\nlocal allowed_messages = {\nSkipCreatingMessage = 1,\nSkipBuildingMessage = 1,\nSkipCleaningMessage = 1,\n}\nlocal lowervalue = value:lower()\nfor v, _ in pairs(allowed_messages) do\nif v:lower() == lowervalue then\nreturn v\nend\nend\nreturn nil, \"invalid message to skip\"\nend,\n},\nmsgarchiving =\n{\nkind = \"string\",\nscope = \"config\",\n},\nmsgcompile =\n{\n"
- "kind = \"string\",\nscope = \"config\",\n},\nmsgresource =\n{\nkind = \"string\",\nscope = \"config\",\n},\nmsglinking =\n{\nkind = \"string\",\nscope = \"config\",\n},\nobjdir =\n{\nkind = \"path\",\nscope = \"config\",\n},\noptions =\n{\nkind = \"list\",\nscope = \"container\",\nisflags = true,\nusagecopy = true,\nallowed = function(value)\nlocal allowed_options = {\nForceCPP = 1,\nArchiveSplit = 1\n}\nlocal lowervalue = value:lower()\nfor v, _ in pairs(allowed_options) do\nif v:lower() == lowervalue then\nreturn v\nend\nend\nreturn nil, \"invalid option\"\nend,\n},\npchheader =\n{\nkind = \"string\",\nscope = \"config\",\n},\npchsource =\n{\nkind = \"path\",\nscope = \"config\",\n},\nplatforms =\n{\nkind = \"list\",\nscope = \"solution\",\nallowed = table.keys(premake.platforms),\n},\npostbuildcommands =\n{\nkind = \"list\",\nscope = \"config\",\n},\nprebuildcommands =\n{\nkind = \"list\",\nscope = \"config\",\n},\nprelinkcommands =\n{\nkind = \"list\",\nscope = \"config\",\n},\nresdefines =\n{\n"
- "kind = \"list\",\nscope = \"config\",\n},\nresincludedirs =\n{\nkind = \"dirlist\",\nscope = \"config\",\n},\nresoptions =\n{\nkind = \"list\",\nscope = \"config\",\n},\nstartproject =\n{\nkind = \"string\",\nscope = \"solution\",\n},\ntargetdir =\n{\nkind = \"path\",\nscope = \"config\",\n},\ntargetsubdir =\n{\nkind = \"string\",\nscope = \"config\",\n},\ntargetextension =\n{\nkind = \"string\",\nscope = \"config\",\n},\ntargetname =\n{\nkind = \"string\",\nscope = \"config\",\n},\ntargetprefix =\n{\nkind = \"string\",\nscope = \"config\",\n},\ntargetsuffix =\n{\nkind = \"string\",\nscope = \"config\",\n},\ntrimpaths =\n{\nkind = \"dirlist\",\nscope = \"config\",\n},\nuuid =\n{\nkind = \"string\",\nscope = \"container\",\nallowed = function(value)\nlocal ok = true\nif (#value ~= 36) then ok = false end\nfor i=1,36 do\nlocal ch = value:sub(i,i)\nif (not ch:find(\"[ABCDEFabcdef0123456789-]\")) then ok = false end\nend\nif (value:sub(9,9) ~= \"-\") then ok = false end\nif (value:sub(14,14) ~= \"-\")"
- " then ok = false end\nif (value:sub(19,19) ~= \"-\") then ok = false end\nif (value:sub(24,24) ~= \"-\") then ok = false end\nif (not ok) then\nreturn nil, \"invalid UUID\"\nend\nreturn value:upper()\nend\n},\nuses =\n{\nkind = \"list\",\nscope = \"config\",\n},\nvpaths =\n{\nkind = \"keypath\",\nscope = \"container\",\n},\n}\nfunction premake.checkvalue(value, allowed)\nif (allowed) then\nif (type(allowed) == \"function\") then\nreturn allowed(value)\nelse\nfor _,v in ipairs(allowed) do\nif (value:lower() == v:lower()) then\nreturn v\nend\nend\nreturn nil, \"invalid value '\" .. value .. \"'\"\nend\nelse\nreturn value\nend\nend\nfunction premake.getobject(t)\nlocal container\nif (t == \"container\" or t == \"solution\") then\ncontainer = premake.CurrentContainer\nelse\ncontainer = premake.CurrentConfiguration\nend\nif t == \"solution\" then\nif type(container) == \"project\" then\ncontainer = container.solution\nend\nif type(container) ~= \"solution\" then\ncontainer = nil\nend\nend\nlocal msg\nif (not conta"
- "iner) then\nif (t == \"container\") then\nmsg = \"no active solution or project\"\nelseif (t == \"solution\") then\nmsg = \"no active solution\"\nelse\nmsg = \"no active solution, project, or configuration\"\nend\nend\nreturn container, msg\nend\nfunction premake.setarray(obj, fieldname, value, allowed)\nobj[fieldname] = obj[fieldname] or {}\nlocal function add(value, depth)\nif type(value) == \"table\" then\nfor _,v in ipairs(value) do\nadd(v, depth + 1)\nend\nelse\nvalue, err = premake.checkvalue(value, allowed)\nif not value then\nerror(err, depth)\nend\ntable.insert(obj[fieldname], value)\nend\nend\nif value then\nadd(value, 5)\nend\nreturn obj[fieldname]\nend\nlocal function domatchedarray(ctype, fieldname, value, matchfunc)\nlocal result = { }\nfunction makeabsolute(value, depth)\nif (type(value) == \"table\") then\nfor _, item in ipairs(value) do\nmakeabsolute(item, depth + 1)\nend\nelseif type(value) == \"string\" then\nif value:find(\"*\") then\nmakeabsolute(matchfunc(value), depth + 1)\nelse\ntable.i"
- "nsert(result, path.getabsolute(value))\nend\nelse\nerror(\"Invalid value in list: expected string, got \" .. type(value), depth)\nend\nend\nmakeabsolute(value, 3)\nreturn premake.setarray(ctype, fieldname, result)\nend\nfunction premake.setdirarray(ctype, fieldname, value)\nreturn domatchedarray(ctype, fieldname, value, os.matchdirs)\nend\nfunction premake.setfilearray(ctype, fieldname, value)\nreturn domatchedarray(ctype, fieldname, value, os.matchfiles)\nend\nfunction premake.setkeyvalue(ctype, fieldname, values)\nlocal container, err = premake.getobject(ctype)\nif not container then\nerror(err, 4)\nend\nif not container[fieldname] then\ncontainer[fieldname] = {}\nend\nif type(values) ~= \"table\" then\nerror(\"invalid value; table expected\", 4)\nend\nlocal field = container[fieldname]\nfor key,value in pairs(values) do\nif not field[key] then\nfield[key] = {}\nend\ntable.insertflat(field[key], value)\nend\nreturn field\nend\nfunction premake.setstring(ctype, fieldname, value, allowed)\nlocal container, err"
- " = premake.getobject(ctype)\nif (not container) then\nerror(err, 4)\nend\nif (value) then\nvalue, err = premake.checkvalue(value, allowed)\nif (not value) then\nerror(err, 4)\nend\ncontainer[fieldname] = value\nend\nreturn container[fieldname]\nend\nfunction premake.remove(fieldname, value)\nlocal cfg = premake.CurrentConfiguration\ncfg.removes = cfg.removes or {}\ncfg.removes[fieldname] = premake.setarray(cfg.removes, fieldname, value)\nend\nlocal function accessor(name, value)\nlocal kind = premake.fields[name].kind\nlocal scope = premake.fields[name].scope\nlocal allowed = premake.fields[name].allowed\nif (kind == \"string\" or kind == \"path\") and value then\nif type(value) ~= \"string\" then\nerror(\"string value expected\", 3)\nend\nend\nlocal container, err = premake.getobject(scope)\nif (not container) then\nerror(err, 3)\nend\nif kind == \"string\" then\nreturn premake.setstring(scope, name, value, allowed)\nelseif kind == \"path\" then\nif value then value = path.getabsolute(value) end\nreturn "
- "premake.setstring(scope, name, value)\nelseif kind == \"list\" then\nreturn premake.setarray(container, name, value, allowed)\nelseif kind == \"dirlist\" then\nreturn premake.setdirarray(container, name, value)\nelseif kind == \"filelist\" or kind == \"absolutefilelist\" then\nreturn premake.setfilearray(container, name, value)\nelseif kind == \"keyvalue\" or kind == \"keypath\" then\nreturn premake.setkeyvalue(scope, name, value)\nend\nend\nfor name, info in pairs(premake.fields) do\n_G[name] = function(value)\nreturn accessor(name, value)\nend\nif info.kind == \"list\" or \n info.kind == \"dirlist\" or \n info.kind == \"filelist\" or\n info.kind == \"absolutefilelist\" \nthen\n_G[\"remove\"..name] = function(value)\npremake.remove(name, value)\nend\nend\nend\nfunction configuration(terms)\nif not terms then\nreturn premake.CurrentConfiguration\nend\nlocal container, err = premake.getobject(\"container\")\nif (not container) then\nerror(err, 2)\nend\nlocal cfg = { }\ncfg.terms = table.flatten({terms})\n"
- "table.insert(container.blocks, cfg)\npremake.CurrentConfiguration = cfg\ncfg.keywords = { }\nfor _, word in ipairs(cfg.terms) do\ntable.insert(cfg.keywords, path.wildcards(word):lower())\nend\nfor name, field in pairs(premake.fields) do\nif (field.kind ~= \"string\" and field.kind ~= \"path\") then\ncfg[name] = { }\nend\nend\nreturn cfg\nend\nlocal function creategroup(name, sln, parent, inpath)\nlocal group = {}\nsetmetatable(group, {\n__type = \"group\"\n})\ntable.insert(sln.groups, group)\nsln.groups[inpath] = group\ngroup.solution = sln\ngroup.name = name\ngroup.uuid = os.uuid(group.name)\ngroup.parent = parent\nreturn group\nend\nlocal function creategroupsfrompath(inpath, sln)\nif inpath == nil then return nil end\ninpath = path.translate(inpath, \"/\")\nlocal groups = string.explode(inpath, \"/\")\nlocal curpath = \"\"\nlocal lastgroup = nil\nfor i, v in ipairs(groups) do\ncurpath = curpath .. \"/\" .. v:lower()\nlocal group = sln.groups[curpath]\nif group == nil then\ngroup = creategroup(v, sln, lastgr"
- "oup, curpath)\nend\nlastgroup = group\nend\nreturn lastgroup\nend\nlocal function createproject(name, sln, isUsage)\nlocal prj = {}\nsetmetatable(prj, {\n__type = \"project\",\n})\ntable.insert(sln.projects, prj)\nif(isUsage) then\nif(sln.projects[name]) then\nsln.projects[name].usageProj = prj;\nelse\nsln.projects[name] = prj\nend\nelse\nif(sln.projects[name]) then\nprj.usageProj = sln.projects[name];\nend\nsln.projects[name] = prj\nend\nlocal group = creategroupsfrompath(premake.CurrentGroup, sln)\nprj.solution = sln\nprj.name = name\nprj.basedir = os.getcwd()\nprj.uuid = os.uuid(prj.name)\nprj.blocks = { }\nprj.usage = isUsage\nprj.group = group\nreturn prj;\nend\nfunction usage(name)\nif (not name) then\nif(type(premake.CurrentContainer) ~= \"project\") then return nil end\nif(not premake.CurrentContainer.usage) then return nil end\nreturn premake.CurrentContainer\nend\nlocal sln\nif (type(premake.CurrentContainer) == \"project\") then\nsln = premake.Curr"
- "entContainer.solution\nelse\nsln = premake.CurrentContainer\nend\nif (type(sln) ~= \"solution\") then\nerror(\"no active solution\", 2)\nend\n -- if this is a new project, or the project in that slot doesn't have a usage, create it\n if((not sln.projects[name]) or\n ((not sln.projects[name].usage) and (not sln.projects[name].usageProj))) then\n premake.CurrentContainer = createproject(name, sln, true)\n else\n premake.CurrentContainer = iff(sln.projects[name].usage,\n sln.projects[name], sln.projects[name].usageProj)\n end\n -- add an empty, global configuration to the project\n configuration { }\n return premake.CurrentContainer\n end\n function project(name)\n if (not name) then\n --Only return non-usage projects\n if(type(premake.CurrentContainer) ~= \"project\") then return nil end\n if(premake.CurrentContainer.usage) then return nil end\n return premake.CurrentContainer\nend\n -- identify the parent solution\n local sln\n if (type(premake.CurrentContainer) == \"project\") then\n sln "
- "= premake.CurrentContainer.solution\n else\n sln = premake.CurrentContainer\n end\n if (type(sln) ~= \"solution\") then\n error(\"no active solution\", 2)\n end\n -- if this is a new project, or the old project is a usage project, create it\n if((not sln.projects[name]) or sln.projects[name].usage) then\n premake.CurrentContainer = createproject(name, sln)\n else\n premake.CurrentContainer = sln.projects[name];\n end\nconfiguration { }\nreturn premake.CurrentContainer\nend\nfunction solution(name)\nif not name then\nif type(premake.CurrentContainer) == \"project\" then\nreturn premake.CurrentContainer.solution\nelse\nreturn premake.CurrentContainer\nend\nend\npremake.CurrentContainer = premake.solution.get(name)\nif (not premake.CurrentContainer) then\npremake.CurrentContainer = premake.solution.new(name)\nend\nconfiguration { }\nreturn premake.CurrentContainer\nend\nfunction group(name)\nif not name then \nreturn premake.CurrentGroup\nend\npremake.CurrentGroup = name\nreturn premake.CurrentGroup\n"
- "end\nfunction newaction(a)\npremake.action.add(a)\nend\nfunction newoption(opt)\npremake.option.add(opt)\nend\n",
+ "premake.fields =\n{\narchivesplit_size =\n{\nkind = \"string\",\nscope = \"config\",\n},\nbasedir =\n{\nkind = \"path\",\nscope = \"container\",\n},\nbuildaction =\n{\nkind = \"string\",\nscope = \"config\",\nallowed = {\n\"Compile\",\n\"Copy\",\n\"Embed\",\n\"None\"\n}\n},\nbuildoptions =\n{\nkind = \"list\",\nscope = \"config\",\n},\nbuildoptions_c =\n{\nkind = \"list\",\nscope = \"config\",\n},\nbuildoptions_cpp =\n{\nkind = \"list\",\nscope = \"config\",\n},\nbuildoptions_objc =\n{\nkind = \"list\",\nscope = \"config\",\n},\nconfigurations =\n{\nkind = \"list\",\nscope = \"solution\",\n},\ndebugargs =\n{\nkind = \"list\",\nscope = \"config\",\n},\ndebugdir =\n{\nkind = \"path\",\nscope = \"config\",\n},\ndebugenvs =\n{\nkind = \"list\",\nscope = \"config\",\n},\ndefines =\n{\nkind = \"list\",\nscope = \"config\",\n},\ndeploymentoptions =\n{\nkind = \"list\",\nscope = \"config\",\nusagecopy = true,\n},\nexcludes =\n{\nkind = \"filelist\",\nscope = \"config\",\n},\nfiles =\n{\nkind = \"filelist"
+ "\",\nscope = \"config\",\n},\nflags =\n{\nkind = \"list\",\nscope = \"config\",\nisflags = true,\nusagecopy = true,\nallowed = function(value)\nlocal allowed_flags = {\nATL = 1,\nDebugEnvsDontMerge = 1,\nDebugEnvsInherit = 1,\nEnableMinimalRebuild = 1,\nEnableSSE = 1,\nEnableSSE2 = 1,\nExtraWarnings = 1,\nFatalWarnings = 1,\nFloatFast = 1,\nFloatStrict = 1,\nManaged = 1,\nMFC = 1,\nNativeWChar = 1,\nNo64BitChecks = 1,\nNoEditAndContinue = 1,\nNoExceptions = 1,\nNoFramePointer = 1,\nNoImportLib = 1,\nNoIncrementalLink = 1,\nNoManifest = 1,\nNoMultiProcessorCompilation = 1,\nNoNativeWChar = 1,\nNoPCH = 1,\nNoRTTI = 1,\nSingleOutputDir = 1,\nOptimize = 1,\nOptimizeSize = 1,\nOptimizeSpeed = 1,\nSEH = 1,\nStaticATL = 1,\nStaticRuntime = 1,\nSymbols = 1,\nUnicode = 1,\nUnsafe = 1,\nUnsignedChar = 1,\nWinMain = 1,\n}\nlocal englishToAmericanSpelling =\n{\noptimise = 'optimize',\noptimisesize = 'optimizesize',\noptimisespeed = 'optimizespeed',\n}\nlocal lowervalue = value:lower()\nlowervalue = englishToAmericanSpell"
+ "ing[lowervalue] or lowervalue\nfor v, _ in pairs(allowed_flags) do\nif v:lower() == lowervalue then\nreturn v\nend\nend\nreturn nil, \"invalid flag\"\nend,\n},\nframework =\n{\nkind = \"string\",\nscope = \"container\",\nallowed = {\n\"1.0\",\n\"1.1\",\n\"2.0\",\n\"3.0\",\n\"3.5\",\n\"4.0\",\n\"4.5\",\n}\n},\nforcedincludes = \n{\nkind = \"absolutefilelist\",\nscope = \"config\",\n},\nimagepath =\n{\nkind = \"path\",\nscope = \"config\",\n},\nimageoptions =\n{\nkind = \"list\",\nscope = \"config\",\n},\nimplibdir =\n{\nkind = \"path\",\nscope = \"config\",\n},\nimplibextension =\n{\nkind = \"string\",\nscope = \"config\",\n},\nimplibname =\n{\nkind = \"string\",\nscope = \"config\",\n},\nimplibprefix =\n{\nkind = \"string\",\nscope = \"config\",\n},\nimplibsuffix =\n{\nkind = \"string\",\nscope = \"config\",\n},\nincludedirs =\n{\nkind = \"dirlist\",\nscope = \"config\",\nusagecopy = true,\n},\nkind =\n{\nkind = \"string\",\nscope = \"config\",\nallowed = {\n\"ConsoleApp\",\n\"WindowedApp\",\n\"Static"
+ "Lib\",\n\"SharedLib\"\n}\n},\nlanguage =\n{\nkind = \"string\",\nscope = \"container\",\nallowed = {\n\"C\",\n\"C++\",\n\"C#\"\n}\n},\nlibdirs =\n{\nkind = \"dirlist\",\nscope = \"config\",\nlinkagecopy = true,\n},\nlinkoptions =\n{\nkind = \"list\",\nscope = \"config\",\n},\nlinks =\n{\nkind = \"list\",\nscope = \"config\",\nallowed = function(value)\nif value:find('/', nil, true) then\nvalue = path.getabsolute(value)\nend\nreturn value\nend,\nlinkagecopy = true,\n},\nlocation =\n{\nkind = \"path\",\nscope = \"container\",\n},\nmakesettings =\n{\nkind = \"list\",\nscope = \"config\",\n},\nmessageskip =\n{\nkind = \"list\",\nscope = \"solution\",\nisflags = true,\nusagecopy = true,\nallowed = function(value)\nlocal allowed_messages = {\nSkipCreatingMessage = 1,\nSkipBuildingMessage = 1,\nSkipCleaningMessage = 1,\n}\nlocal lowervalue = value:lower()\nfor v, _ in pairs(allowed_messages) do\nif v:lower() == lowervalue then\nreturn v\nend\nend\nreturn nil, \"invalid message to skip\"\nend,\n},\nmsgarchiving "
+ "=\n{\nkind = \"string\",\nscope = \"config\",\n},\nmsgcompile =\n{\nkind = \"string\",\nscope = \"config\",\n},\nmsgcompile_objc =\n{\nkind = \"string\",\nscope = \"config\",\n},\nmsgresource =\n{\nkind = \"string\",\nscope = \"config\",\n},\nmsglinking =\n{\nkind = \"string\",\nscope = \"config\",\n},\nobjdir =\n{\nkind = \"path\",\nscope = \"config\",\n},\noptions =\n{\nkind = \"list\",\nscope = \"container\",\nisflags = true,\nusagecopy = true,\nallowed = function(value)\nlocal allowed_options = {\nForceCPP = 1,\nArchiveSplit = 1\n}\nlocal lowervalue = value:lower()\nfor v, _ in pairs(allowed_options) do\nif v:lower() == lowervalue then\nreturn v\nend\nend\nreturn nil, \"invalid option\"\nend,\n},\npchheader =\n{\nkind = \"string\",\nscope = \"config\",\n},\npchsource =\n{\nkind = \"path\",\nscope = \"config\",\n},\nplatforms =\n{\nkind = \"list\",\nscope = \"solution\",\nallowed = table.keys(premake.platforms),\n},\npostbuildcommands =\n{\nkind = \"list\",\nscope = \"config\",\n},\nprebuildcomma"
+ "nds =\n{\nkind = \"list\",\nscope = \"config\",\n},\nprelinkcommands =\n{\nkind = \"list\",\nscope = \"config\",\n},\nresdefines =\n{\nkind = \"list\",\nscope = \"config\",\n},\nresincludedirs =\n{\nkind = \"dirlist\",\nscope = \"config\",\n},\nresoptions =\n{\nkind = \"list\",\nscope = \"config\",\n},\nstartproject =\n{\nkind = \"string\",\nscope = \"solution\",\n},\ntargetdir =\n{\nkind = \"path\",\nscope = \"config\",\n},\ntargetsubdir =\n{\nkind = \"string\",\nscope = \"config\",\n},\ntargetextension =\n{\nkind = \"string\",\nscope = \"config\",\n},\ntargetname =\n{\nkind = \"string\",\nscope = \"config\",\n},\ntargetprefix =\n{\nkind = \"string\",\nscope = \"config\",\n},\ntargetsuffix =\n{\nkind = \"string\",\nscope = \"config\",\n},\ntrimpaths =\n{\nkind = \"dirlist\",\nscope = \"config\",\n},\nuuid =\n{\nkind = \"string\",\nscope = \"container\",\nallowed = function(value)\nlocal ok = true\nif (#value ~= 36) then ok = false end\nfor i=1,36 do\nlocal ch = value:sub(i,i)\nif (not ch:find(\"["
+ "ABCDEFabcdef0123456789-]\")) then ok = false end\nend\nif (value:sub(9,9) ~= \"-\") then ok = false end\nif (value:sub(14,14) ~= \"-\") then ok = false end\nif (value:sub(19,19) ~= \"-\") then ok = false end\nif (value:sub(24,24) ~= \"-\") then ok = false end\nif (not ok) then\nreturn nil, \"invalid UUID\"\nend\nreturn value:upper()\nend\n},\nuses =\n{\nkind = \"list\",\nscope = \"config\",\n},\nvpaths =\n{\nkind = \"keypath\",\nscope = \"container\",\n},\n}\npremake.check_paths = false\nfunction premake.checkvalue(value, allowed)\nif (allowed) then\nif (type(allowed) == \"function\") then\nreturn allowed(value)\nelse\nfor _,v in ipairs(allowed) do\nif (value:lower() == v:lower()) then\nreturn v\nend\nend\nreturn nil, \"invalid value '\" .. value .. \"'\"\nend\nelse\nreturn value\nend\nend\nfunction premake.getobject(t)\nlocal container\nif (t == \"container\" or t == \"solution\") then\ncontainer = premake.CurrentContainer\nelse\ncontainer = premake.CurrentConfiguration\nend\nif t == \"solution\" then\nif "
+ "type(container) == \"project\" then\ncontainer = container.solution\nend\nif type(container) ~= \"solution\" then\ncontainer = nil\nend\nend\nlocal msg\nif (not container) then\nif (t == \"container\") then\nmsg = \"no active solution or project\"\nelseif (t == \"solution\") then\nmsg = \"no active solution\"\nelse\nmsg = \"no active solution, project, or configuration\"\nend\nend\nreturn container, msg\nend\nfunction premake.setarray(obj, fieldname, value, allowed)\nobj[fieldname] = obj[fieldname] or {}\nlocal function add(value, depth)\nif type(value) == \"table\" then\nfor _,v in ipairs(value) do\nadd(v, depth + 1)\nend\nelse\nvalue, err = premake.checkvalue(value, allowed)\nif not value then\nerror(err, depth)\nend\ntable.insert(obj[fieldname], value)\nend\nend\nif value then\nadd(value, 5)\nend\nreturn obj[fieldname]\nend\nlocal function domatchedarray(ctype, fieldname, value, matchfunc)\nlocal result = { }\nfunction makeabsolute(value, depth)\nif (type(value) == \"table\") then\nfor _, item in ipairs(val"
+ "ue) do\nmakeabsolute(item, depth + 1)\nend\nelseif type(value) == \"string\" then\nif value:find(\"*\") then\nlocal arr = matchfunc(value);\nif (premake.check_paths) and (#arr == 0) then\nerror(\"Can't find matching files for pattern :\" .. value)\nend\nmakeabsolute(arr, depth + 1)\nelse\ntable.insert(result, path.getabsolute(value))\nend\nelse\nerror(\"Invalid value in list: expected string, got \" .. type(value), depth)\nend\nend\nmakeabsolute(value, 3)\nreturn premake.setarray(ctype, fieldname, result)\nend\nfunction premake.setdirarray(ctype, fieldname, value)\nreturn domatchedarray(ctype, fieldname, value, os.matchdirs)\nend\nfunction premake.setfilearray(ctype, fieldname, value)\nreturn domatchedarray(ctype, fieldname, value, os.matchfiles)\nend\nfunction premake.setkeyvalue(ctype, fieldname, values)\nlocal container, err = premake.getobject(ctype)\nif not container then\nerror(err, 4)\nend\nif not container[fieldname] then\ncontainer[fieldname] = {}\nend\nif type(values) ~= \"table\" then\nerror(\"inval"
+ "id value; table expected\", 4)\nend\nlocal field = container[fieldname]\nfor key,value in pairs(values) do\nif not field[key] then\nfield[key] = {}\nend\ntable.insertflat(field[key], value)\nend\nreturn field\nend\nfunction premake.setstring(ctype, fieldname, value, allowed)\nlocal container, err = premake.getobject(ctype)\nif (not container) then\nerror(err, 4)\nend\nif (value) then\nvalue, err = premake.checkvalue(value, allowed)\nif (not value) then\nerror(err, 4)\nend\ncontainer[fieldname] = value\nend\nreturn container[fieldname]\nend\nfunction premake.remove(fieldname, value)\nlocal cfg = premake.CurrentConfiguration\ncfg.removes = cfg.removes or {}\ncfg.removes[fieldname] = premake.setarray(cfg.removes, fieldname, value)\nend\nlocal function accessor(name, value)\nlocal kind = premake.fields[name].kind\nlocal scope = premake.fields[name].scope\nlocal allowed = premake.fields[name].allowed\nif (kind == \"string\" or kind == \"path\") and value then\nif type(value) ~= \"string\" then\nerror(\"string "
+ "value expected\", 3)\nend\nend\nlocal container, err = premake.getobject(scope)\nif (not container) then\nerror(err, 3)\nend\nif kind == \"string\" then\nreturn premake.setstring(scope, name, value, allowed)\nelseif kind == \"path\" then\nif value then value = path.getabsolute(value) end\nreturn premake.setstring(scope, name, value)\nelseif kind == \"list\" then\nreturn premake.setarray(container, name, value, allowed)\nelseif kind == \"dirlist\" then\nreturn premake.setdirarray(container, name, value)\nelseif kind == \"filelist\" or kind == \"absolutefilelist\" then\nreturn premake.setfilearray(container, name, value)\nelseif kind == \"keyvalue\" or kind == \"keypath\" then\nreturn premake.setkeyvalue(scope, name, value)\nend\nend\nfor name, info in pairs(premake.fields) do\n_G[name] = function(value)\nreturn accessor(name, value)\nend\nif info.kind == \"list\" or \n info.kind == \"dirlist\" or \n info.kind == \"filelist\" or\n info.kind == \"absolutefilelist\" \nthen\n_G[\"remove\"..name] = function(va"
+ "lue)\npremake.remove(name, value)\nend\nend\nend\nfunction configuration(terms)\nif not terms then\nreturn premake.CurrentConfiguration\nend\nlocal container, err = premake.getobject(\"container\")\nif (not container) then\nerror(err, 2)\nend\nlocal cfg = { }\ncfg.terms = table.flatten({terms})\ntable.insert(container.blocks, cfg)\npremake.CurrentConfiguration = cfg\ncfg.keywords = { }\nfor _, word in ipairs(cfg.terms) do\ntable.insert(cfg.keywords, path.wildcards(word):lower())\nend\nfor name, field in pairs(premake.fields) do\nif (field.kind ~= \"string\" and field.kind ~= \"path\") then\ncfg[name] = { }\nend\nend\nreturn cfg\nend\nlocal function creategroup(name, sln, parent, inpath)\nlocal group = {}\nsetmetatable(group, {\n__type = \"group\"\n})\ntable.insert(sln.groups, group)\nsln.groups[inpath] = group\ngroup.solution = sln\ngroup.name = name\ngroup.uuid = os.uuid(group.name)\ngroup.parent = parent\nreturn group\nend\nlocal function creategroupsfrompath(inpath, sln)\nif inpath == nil then return nil en"
+ "d\ninpath = path.translate(inpath, \"/\")\nlocal groups = string.explode(inpath, \"/\")\nlocal curpath = \"\"\nlocal lastgroup = nil\nfor i, v in ipairs(groups) do\ncurpath = curpath .. \"/\" .. v:lower()\nlocal group = sln.groups[curpath]\nif group == nil then\ngroup = creategroup(v, sln, lastgroup, curpath)\nend\nlastgroup = group\nend\nreturn lastgroup\nend\nlocal function createproject(name, sln, isUsage)\nlocal prj = {}\nsetmetatable(prj, {\n__type = \"project\",\n})\ntable.insert(sln.projects, prj)\nif(isUsage) then\nif(sln.projects[name]) then\nsln.projects[name].usageProj = prj;\nelse\nsln.projects[name] = prj\nend\nelse\nif(sln.projects[name]) then\nprj.usageProj = sln.projects[name];\nend\nsln.projects[name] = prj\nend\nlocal group = creategroupsfrompath(premake.CurrentGroup, sln)\nprj.solution = sln\nprj.name = name\nprj.basedir = os.getcwd()\nprj.uuid = os.uuid(prj.name)\nprj.blocks = { }\nprj.usage = isUsage\nprj.group = group\nreturn prj;\nend\n"
+ "function usage(name)\nif (not name) then\nif(type(premake.CurrentContainer) ~= \"project\") then return nil end\nif(not premake.CurrentContainer.usage) then return nil end\nreturn premake.CurrentContainer\nend\nlocal sln\nif (type(premake.CurrentContainer) == \"project\") then\nsln = premake.CurrentContainer.solution\nelse\nsln = premake.CurrentContainer\nend\nif (type(sln) ~= \"solution\") then\nerror(\"no active solution\", 2)\nend\n -- if this is a new project, or the project in that slot doesn't have a usage, create it\n if((not sln.projects[name]) or\n ((not sln.projects[name].usage) and (not sln.projects[name].usageProj))) then\n premake.CurrentContainer = createproject(name, sln, true)\n else\n premake.CurrentContainer = iff(sln.projects[name].usage,\n sln.projects[name], sln.projects[name].usageProj)\n end\n -- add an empty, global configuration to the project\n configuration { }\n return premake.CurrentContainer\n end\n function project(name)\n if (not name) then\n --Only return non-usa"
+ "ge projects\n if(type(premake.CurrentContainer) ~= \"project\") then return nil end\n if(premake.CurrentContainer.usage) then return nil end\n return premake.CurrentContainer\nend\n -- identify the parent solution\n local sln\n if (type(premake.CurrentContainer) == \"project\") then\n sln = premake.CurrentContainer.solution\n else\n sln = premake.CurrentContainer\n end\n if (type(sln) ~= \"solution\") then\n error(\"no active solution\", 2)\n end\n -- if this is a new project, or the old project is a usage project, create it\n if((not sln.projects[name]) or sln.projects[name].usage) then\n premake.CurrentContainer = createproject(name, sln)\n else\n premake.CurrentContainer = sln.projects[name];\n end\nconfiguration { }\nreturn premake.CurrentContainer\nend\nfunction solution(name)\nif not name then\nif type(premake.CurrentContainer) == \"project\" then\nreturn premake.CurrentContainer.solution\nelse\nreturn premake.CurrentContainer\nend\nend\npremake.CurrentContainer = premake.solution.get("
+ "name)\nif (not premake.CurrentContainer) then\npremake.CurrentContainer = premake.solution.new(name)\nend\nconfiguration { }\nreturn premake.CurrentContainer\nend\nfunction group(name)\nif not name then \nreturn premake.CurrentGroup\nend\npremake.CurrentGroup = name\nreturn premake.CurrentGroup\nend\nfunction newaction(a)\npremake.action.add(a)\nend\nfunction newoption(opt)\npremake.option.add(opt)\nend\n",
/* base/cmdline.lua */
"newoption \n{\ntrigger = \"cc\",\nvalue = \"VALUE\",\ndescription = \"Choose a C/C++ compiler set\",\nallowed = {\n{ \"gcc\", \"GNU GCC (gcc/g++)\" },\n{ \"ow\", \"OpenWatcom\" },\n}\n}\nnewoption\n{\ntrigger = \"dotnet\",\nvalue = \"VALUE\",\ndescription = \"Choose a .NET compiler set\",\nallowed = {\n{ \"msnet\", \"Microsoft .NET (csc)\" },\n{ \"mono\", \"Novell Mono (mcs)\" },\n{ \"pnet\", \"Portable.NET (cscc)\" },\n}\n}\nnewoption\n{\ntrigger = \"file\",\nvalue = \"FILE\",\ndescription = \"Read FILE as a Premake script; default is 'premake4.lua'\"\n}\nnewoption\n{\ntrigger = \"help\",\ndescription = \"Display this information\"\n}\nnewoption\n{\ntrigger = \"os\",\nvalue = \"VALUE\",\ndescription = \"Generate files for a different operating system\",\nallowed = {\n{ \"bsd\", \"OpenBSD, NetBSD, or FreeBSD\" },\n{ \"linux\", \"Linux\" },\n{ \"macosx\", \"Apple Mac OS X\" },\n{ \"windows\", \"Microsoft Windows\" },\n}\n}\nnewoption\n{"
@@ -185,10 +185,10 @@ const char* builtin_scripts[] = {
"$(SILENT) if exist $(subst /,\\\\\\\\,$(OBJDIR)) rmdir /s /q $(subst /,\\\\\\\\,$(OBJDIR))')\n_p('endif')\n_p('')\n_p('prebuild:')\n_p('\\t$(PREBUILDCMDS)')\n_p('')\n_p('prelink:')\n_p('\\t$(PRELINKCMDS)')\n_p('')\ncpp.pchrules(prj)\ncpp.fileRules(prj)\n_p('-include $(OBJECTS:%%.o=%%.d)')\n_p('ifneq (,$(PCH))')\n_p(' -include $(OBJDIR)/$(notdir $(PCH)).d')\n_p('endif')\nend\nfunction premake.gmake_cpp_header(prj, cc, platforms)\n_p('# %s project makefile autogenerated by GENie', premake.action.current().shortname)\n_p('ifndef config')\n_p(' config=%s', _MAKE.esc(premake.getconfigname(prj.solution.configurations[1], platforms[1], true)))\n_p('endif')\n_p('')\n_p('ifndef verbose')\n_p(' SILENT = @')\n_p('endif')\n_p('')\n_p('SHELLTYPE := msdos')\n_p('ifeq (,$(ComSpec)$(COMSPEC))')\n_p(' SHELLTYPE := posix')\n_p('endif')\n_p('ifeq (/bin,$(findstring /bin,$(SHELL)))')\n_p(' SHELLTYPE := posix')\n_p('endif')\n_p('')\n_p('ifeq (posix,$(SHELLTYPE))')\n_p(' MKDIR = $(SILENT) mkdir -p \"$(1)\"')\n_p(' COPY = $("
"SILENT) cp -fR \"$(1)\" \"$(2)\"')\n_p('else')\n_p(' MKDIR = $(SILENT) mkdir \"$(subst /,\\\\\\\\,$(1))\" 2> nul || exit 0')\n_p(' COPY = $(SILENT) copy /Y \"$(subst /,\\\\\\\\,$(1))\" \"$(subst /,\\\\\\\\,$(2))\"')\n_p('endif')\n_p('')\n_p('CC = %s', cc.cc)\n_p('CXX = %s', cc.cxx)\n_p('AR = %s', cc.ar)\n_p('')\n_p('ifndef RESCOMP')\n_p(' ifdef WINDRES')\n_p(' RESCOMP = $(WINDRES)')\n_p(' else')\n_p(' RESCOMP = windres')\n_p(' endif')\n_p('endif')\n_p('')\nend\nfunction premake.gmake_cpp_config(prj, cfg, cc)\n_p('ifeq ($(config),%s)', _MAKE.esc(cfg.shortname))\ncpp.platformtools(cfg, cc)\n_p(' OBJDIR = %s', _MAKE.esc(cfg.objectsdir))\n_p(' TARGETDIR = %s', _MAKE.esc(cfg.buildtarget.directory))\n_p(' TARGET = $(TARGETDIR)/%s', _MAKE.esc(cfg.buildtarget.name))\n_p(' DEFINES +=%s', make.list(cc.getdefines(cfg.defines)))\n_p(' INCLUDES +=%s', make.list(cc.getincludedirs(cfg.includedirs)))\ncpp.pchconfig(cfg)\ncpp.flags(cfg, cc)\ncpp.linker(cfg, cc)\n_p(' OBJECTS := \\\\')\nfor _, fi"
"le in ipairs(prj.files) do\nif path.iscppfile(file) then\nlocal excluded = false\nfor _, exclude in ipairs(cfg.excludes) do\nexcluded = (exclude == file)\nif (excluded) then break end\nend\nif excluded == false then\n_p('\\t$(OBJDIR)/%s.o \\\\'\n, _MAKE.esc(path.trimdots(path.removeext(file)))\n)\nend\nend\nend\n_p('')\n_p(' define PREBUILDCMDS')\nif #cfg.prebuildcommands > 0 then\n_p('\\t@echo Running pre-build commands')\n_p('\\t%s', table.implode(cfg.prebuildcommands, \"\", \"\", \"\\n\\t\"))\nend\n_p(' endef')\n_p(' define PRELINKCMDS')\nif #cfg.prelinkcommands > 0 then\n_p('\\t@echo Running pre-link commands')\n_p('\\t%s', table.implode(cfg.prelinkcommands, \"\", \"\", \"\\n\\t\"))\nend\n_p(' endef')\n_p(' define POSTBUILDCMDS')\nif #cfg.postbuildcommands > 0 then\n_p('\\t@echo Running post-build commands')\n_p('\\t%s', table.implode(cfg.postbuildcommands, \"\", \"\", \"\\n\\t\"))\nend\n_p(' endef')\nmake.settings(cfg, cc)\n_p('endif')\n_p('')\nend\nfunction cpp.platformtools(cfg, cc)\nlocal platfor"
- "m = cc.platforms[cfg.platform]\nif platform.cc then\n_p(' CC = %s', platform.cc)\nend\nif platform.cxx then\n_p(' CXX = %s', platform.cxx)\nend\nif platform.ar then\n_p(' AR = %s', platform.ar)\nend\nend\nfunction cpp.flags(cfg, cc)\nif cfg.pchheader and not cfg.flags.NoPCH then\n_p(' FORCE_INCLUDE += -include $(OBJDIR)/$(notdir $(PCH))')\nend\nif #cfg.forcedincludes > 0 then\n_p(' FORCE_INCLUDE += -include %s'\n,premake.esc(table.concat(cfg.forcedincludes, \";\")))\nend\n_p(' ALL_CPPFLAGS += $(CPPFLAGS) %s $(DEFINES) $(INCLUDES)', table.concat(cc.getcppflags(cfg), \" \"))\n_p(' ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH)%s', make.list(table.join(cc.getcflags(cfg), cfg.buildoptions, cfg.buildoptions_c)))\n_p(' ALL_CXXFLAGS += $(CXXFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH)%s', make.list(table.join(cc.getcxxflags(cfg), cfg.buildoptions, cfg.buildoptions_cpp)))\n_p(' ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES)%s',\n make.list(table.join(cc.getdefines(cfg.resd"
- "efines),\n cc.getincludedirs(cfg.resincludedirs), cfg.resoptions)))\nend\nfunction cpp.linker(cfg, cc)\n_p(' ALL_LDFLAGS += $(LDFLAGS)%s', make.list(table.join(cc.getlibdirflags(cfg), cc.getldflags(cfg), cfg.linkoptions)))\n_p(' LDDEPS +=%s', make.list(_MAKE.esc(premake.getlinks(cfg, \"siblings\", \"fullpath\"))))\n_p(' LIBS += $(LDDEPS)%s', make.list(cc.getlinkflags(cfg)))\nif cfg.kind == \"StaticLib\" then\nif cfg.platform:startswith(\"Universal\") then\n_p(' LINKCMD = libtool -o $(TARGET)')\nelse\nif cc.llvm then\n_p(' LINKCMD = $(AR) rcs $(TARGET)')\nelse\n_p(' LINKCMD = $(AR) -rcs $(TARGET)')\nend\nend\nelse\nlocal tool = iif(cfg.language == \"C\", \"CC\", \"CXX\")\n_p(' LINKCMD = $(%s) -o $(TARGET) $(OBJECTS) $(RESOURCES) $(ARCH) $(ALL_LDFLAGS) $(LIBS)', tool)\nend\nend\nfunction cpp.pchconfig(cfg)\nif not cfg.pchheader or cfg.flags.NoPCH then\nreturn\nend\nlocal pch = cfg.pchheader\nfor _, incdir in ipairs(cfg.includedirs) do\nlocal abspath = p"
- "ath.getabsolute(path.join(cfg.project.location, incdir))\nlocal testname = path.join(abspath, pch)\nif os.isfile(testname) then\npch = path.getrelative(cfg.location, testname)\nbreak\nend\nend\n_p(' PCH = %s', _MAKE.esc(pch))\n_p(' GCH = $(OBJDIR)/$(notdir $(PCH)).gch')\nend\nfunction cpp.pchrules(prj)\n_p('ifneq (,$(PCH))')\n_p('$(GCH): $(PCH)')\n_p('\\t@echo $(notdir $<)')\nlocal cmd = iif(prj.language == \"C\", \"$(CC) -x c-header $(ALL_CFLAGS)\", \"$(CXX) -x c++-header $(ALL_CXXFLAGS)\")\n_p('\\t$(SILENT) %s -MMD -MP $(DEFINES) $(INCLUDES) -o \"$@\" -MF \"$(@:%%.gch=%%.d)\" -c \"$<\"', cmd)\n_p('endif')\n_p('')\nend\nfunction cpp.fileRules(prj)\nfor _, file in ipairs(prj.files or {}) do\nif path.iscppfile(file) then\n_p('$(OBJDIR)/%s.o: %s'\n, _MAKE.esc(path.trimdots(path.removeext(file)))\n, _MAKE.esc(file)\n)\nif prj.msgcompile then\n_p('\\t@echo ' .. prj.msgcompile)\nelse\n_p('\\t@echo $(notdir $<)')\nend\ncpp.buildcommand(path.iscfile(file) and not prj.options.ForceCPP, \"o\")\n_p('')\n"
- "elseif (path.getextension(file) == \".rc\") then\n_p('$(OBJDIR)/%s.res: %s', _MAKE.esc(path.getbasename(file)), _MAKE.esc(file))\nif prj.msgresource then\n_p('\\t@echo ' .. prj.msgresource)\nelse\n_p('\\t@echo $(notdir $<)')\nend\n_p('\\t$(SILENT) $(RESCOMP) $< -O coff -o \"$@\" $(ALL_RESFLAGS)')\n_p('')\nend\nend\nend\nfunction cpp.buildcommand(iscfile, objext)\nlocal flags = iif(iscfile, '$(CC) $(ALL_CFLAGS)', '$(CXX) $(ALL_CXXFLAGS)')\n_p('\\t$(SILENT) %s $(FORCE_INCLUDE) -o \"$@\" -MF $(@:%%.%s=%%.d) -c \"$<\"', flags, objext)\nend\n",
+ "m = cc.platforms[cfg.platform]\nif platform.cc then\n_p(' CC = %s', platform.cc)\nend\nif platform.cxx then\n_p(' CXX = %s', platform.cxx)\nend\nif platform.ar then\n_p(' AR = %s', platform.ar)\nend\nend\nfunction cpp.flags(cfg, cc)\nif cfg.pchheader and not cfg.flags.NoPCH then\n_p(' FORCE_INCLUDE += -include $(OBJDIR)/$(notdir $(PCH))')\nend\nif #cfg.forcedincludes > 0 then\n_p(' FORCE_INCLUDE += -include %s'\n,premake.esc(table.concat(cfg.forcedincludes, \";\")))\nend\n_p(' ALL_CPPFLAGS += $(CPPFLAGS) %s $(DEFINES) $(INCLUDES)', table.concat(cc.getcppflags(cfg), \" \"))\n_p(' ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH)%s', make.list(table.join(cc.getcflags(cfg), cfg.buildoptions, cfg.buildoptions_c)))\n_p(' ALL_CXXFLAGS += $(CXXFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH)%s', make.list(table.join(cc.getcxxflags(cfg), cfg.buildoptions, cfg.buildoptions_cpp)))\n_p(' ALL_OBJCFLAGS += $(CXXFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH)%s', make.list(table.join(cc.getcxxflags(cfg),"
+ " cfg.buildoptions, cfg.buildoptions_objc)))\n_p(' ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES)%s',\n make.list(table.join(cc.getdefines(cfg.resdefines),\n cc.getincludedirs(cfg.resincludedirs), cfg.resoptions)))\nend\nfunction cpp.linker(cfg, cc)\n_p(' ALL_LDFLAGS += $(LDFLAGS)%s', make.list(table.join(cc.getlibdirflags(cfg), cc.getldflags(cfg), cfg.linkoptions)))\n_p(' LDDEPS +=%s', make.list(_MAKE.esc(premake.getlinks(cfg, \"siblings\", \"fullpath\"))))\n_p(' LIBS += $(LDDEPS)%s', make.list(cc.getlinkflags(cfg)))\nif cfg.kind == \"StaticLib\" then\nif cfg.platform:startswith(\"Universal\") then\n_p(' LINKCMD = libtool -o $(TARGET)')\nelse\nif cc.llvm then\n_p(' LINKCMD = $(AR) rcs $(TARGET)')\nelse\n_p(' LINKCMD = $(AR) -rcs $(TARGET)')\nend\nend\nelse\nlocal tool = iif(cfg.language == \"C\", \"CC\", \"CXX\")\n_p(' LINKCMD = $(%s) -o $(TARGET) $(OBJECTS) $(RESOURCES) $(ARCH) $(ALL_LDFLAGS) $(LIBS)', tool)\nend\nend\nfunction cpp.pchco"
+ "nfig(cfg)\nif not cfg.pchheader or cfg.flags.NoPCH then\nreturn\nend\nlocal pch = cfg.pchheader\nfor _, incdir in ipairs(cfg.includedirs) do\nlocal abspath = path.getabsolute(path.join(cfg.project.location, incdir))\nlocal testname = path.join(abspath, pch)\nif os.isfile(testname) then\npch = path.getrelative(cfg.location, testname)\nbreak\nend\nend\n_p(' PCH = %s', _MAKE.esc(pch))\n_p(' GCH = $(OBJDIR)/$(notdir $(PCH)).gch')\nend\nfunction cpp.pchrules(prj)\n_p('ifneq (,$(PCH))')\n_p('$(GCH): $(PCH)')\n_p('\\t@echo $(notdir $<)')\nlocal cmd = iif(prj.language == \"C\", \"$(CC) -x c-header $(ALL_CFLAGS)\", \"$(CXX) -x c++-header $(ALL_CXXFLAGS)\")\n_p('\\t$(SILENT) %s -MMD -MP $(DEFINES) $(INCLUDES) -o \"$@\" -MF \"$(@:%%.gch=%%.d)\" -c \"$<\"', cmd)\n_p('endif')\n_p('')\nend\nfunction cpp.fileRules(prj)\nfor _, file in ipairs(prj.files or {}) do\nif path.iscppfile(file) then\n_p('$(OBJDIR)/%s.o: %s'\n, _MAKE.esc(path.trimdots(path.removeext(file)))\n, _MAKE.esc(file)\n)\nif (path.isobjcfile(fi"
+ "le) and prj.msgcompile_objc) then\n_p('\\t@echo ' .. prj.msgcompile_objc)\nelseif prj.msgcompile then\n_p('\\t@echo ' .. prj.msgcompile)\nelse\n_p('\\t@echo $(notdir $<)')\nend\nif (path.isobjcfile(file)) then\n_p('\\t$(SILENT) $(CXX) $(ALL_OBJCFLAGS) $(FORCE_INCLUDE) -o \"$@\" -MF $(@:%%.o=%%.d) -c \"$<\"')\nelse\ncpp.buildcommand(path.iscfile(file) and not prj.options.ForceCPP, \"o\")\nend\n_p('')\nelseif (path.getextension(file) == \".rc\") then\n_p('$(OBJDIR)/%s.res: %s', _MAKE.esc(path.getbasename(file)), _MAKE.esc(file))\nif prj.msgresource then\n_p('\\t@echo ' .. prj.msgresource)\nelse\n_p('\\t@echo $(notdir $<)')\nend\n_p('\\t$(SILENT) $(RESCOMP) $< -O coff -o \"$@\" $(ALL_RESFLAGS)')\n_p('')\nend\nend\nend\nfunction cpp.buildcommand(iscfile, objext)\nlocal flags = iif(iscfile, '$(CC) $(ALL_CFLAGS)', '$(CXX) $(ALL_CXXFLAGS)')\n_p('\\t$(SILENT) %s $(FORCE_INCLUDE) -o \"$@\" -MF $(@:%%.%s=%%.d) -c \"$<\"', flags, objext)\nend\n",
/* actions/make/make_csharp.lua */
"local function getresourcefilename(cfg, fname)\nif path.getextension(fname) == \".resx\" then\n local name = cfg.buildtarget.basename .. \".\"\n local dir = path.getdirectory(fname)\n if dir ~= \".\" then \nname = name .. path.translate(dir, \".\") .. \".\"\nend\nreturn \"$(OBJDIR)/\" .. _MAKE.esc(name .. path.getbasename(fname)) .. \".resources\"\nelse\nreturn fname\nend\nend\nfunction premake.make_csharp(prj)\nlocal csc = premake.dotnet\nlocal cfglibs = { }\nlocal cfgpairs = { }\nlocal anycfg\nfor cfg in premake.eachconfig(prj) do\nanycfg = cfg\ncfglibs[cfg] = premake.getlinks(cfg, \"siblings\", \"fullpath\")\ncfgpairs[cfg] = { }\nfor _, fname in ipairs(cfglibs[cfg]) do\nif path.getdirectory(fname) ~= cfg.buildtarget.directory then\ncfgpairs[cfg][\"$(TARGETDIR)/\" .. _MAKE.esc(path.getname(fname))] = _MAKE.esc(fname)\nend\nend\nend\nlocal sources = {}\nlocal embedded = { }\nlocal copypairs = { }\nfor fcfg in premake.project.eachfile(prj) do\nlocal action = csc.getbuildaction(fcfg)\nif action == \"Co"
diff --git a/3rdparty/mongoose/docs/Embed.md b/3rdparty/mongoose/docs/Embed.md
index 28274ac66ca..8e6dfbf5669 100644
--- a/3rdparty/mongoose/docs/Embed.md
+++ b/3rdparty/mongoose/docs/Embed.md
@@ -149,7 +149,7 @@ all Net Skeleton functions will be available too.
-DMONGOOSE_NO_DIRECTORY_LISTING Disable directory listing
-DMONGOOSE_NO_FILESYSTEM Disables all file IO, serving from memory only
-DMONGOOSE_NO_LOGGING Disable access/error logging
- -DMONGOOSE_NO_THREADS
+ -DMONGOOSE_ENABLE_THREADS Enable mg_start_thread() function
-DMONGOOSE_NO_WEBSOCKET Disable WebSocket support
-DMONGOOSE_NO_USER No concept of a user on used platform.
(Platform does not provide getpwnam, setgid or setuid)
diff --git a/3rdparty/mongoose/mongoose.c b/3rdparty/mongoose/mongoose.c
index aa74d0b2d97..f437fe9141d 100644
--- a/3rdparty/mongoose/mongoose.c
+++ b/3rdparty/mongoose/mongoose.c
@@ -81,6 +81,8 @@
#ifdef _MSC_VER
#pragma comment(lib, "ws2_32.lib") // Linking with winsock library
#endif
+#include <winsock2.h>
+#include <ws2tcpip.h>
#include <windows.h>
#include <process.h>
#ifndef EINPROGRESS
@@ -124,7 +126,12 @@ typedef struct _stati64 ns_stat_t;
#include <sys/socket.h>
#include <sys/select.h>
#define closesocket(x) close(x)
+#ifndef __OS2__
#define __cdecl
+#else
+#include <sys/time.h>
+typedef int socklen_t;
+#endif
#define INVALID_SOCKET (-1)
#define to64(x) strtoll(x, NULL, 10)
typedef int sock_t;
@@ -1559,11 +1566,11 @@ static const struct {
{NULL, 0, NULL}
};
-#ifndef MONGOOSE_NO_THREADS
+#ifdef MONGOOSE_ENABLE_THREADS
void *mg_start_thread(void *(*f)(void *), void *p) {
return ns_start_thread(f, p);
}
-#endif // MONGOOSE_NO_THREADS
+#endif // MONGOOSE_ENABLE_THREADS
#ifndef MONGOOSE_NO_MMAP
#ifdef _WIN32
@@ -1579,6 +1586,37 @@ static void *mmap(void *addr, int64_t len, int prot, int flags, int fd,
#define MAP_FAILED NULL
#define MAP_PRIVATE 0
#define PROT_READ 0
+#elif defined(__OS2__)
+static void *mmap(void *addr, int64_t len, int prot, int flags, int fd,
+ int offset) {
+ void *p;
+
+ int pos = lseek( fd, 0, SEEK_CUR ); /* Get a current position */
+
+ if (pos == -1)
+ return NULL;
+
+ /* Seek to offset offset */
+ if (lseek( fd, offset, SEEK_SET) == -1)
+ return NULL;
+
+ p = malloc(len);
+
+ /* Read in a file */
+ if (!p || read(fd, p, len) == -1) {
+ free(p);
+ p = NULL;
+ }
+
+ /* Restore the position */
+ lseek(fd, pos, SEEK_SET);
+
+ return p;
+}
+#define munmap(x, y) free(x)
+#define MAP_FAILED NULL
+#define MAP_PRIVATE 0
+#define PROT_READ 0
#else
#include <sys/mman.h>
#endif