From a674d734d33072187e250f3d87d840590198db0d Mon Sep 17 00:00:00 2001 From: bkaradzic Date: Sat, 26 Jan 2013 16:30:02 -0800 Subject: [PATCH] Simplified example premake script. --- premake/example-00-helloworld.lua | 51 -------------------- premake/example-01-cubes.lua | 53 --------------------- premake/example-02-metaballs.lua | 53 --------------------- premake/example-03-raymarch.lua | 53 --------------------- premake/example-04-mesh.lua | 53 --------------------- premake/example-05-instancing.lua | 53 --------------------- premake/example-06-bump.lua | 50 -------------------- premake/example-07-callback.lua | 50 -------------------- premake/example-08-update.lua | 53 --------------------- premake/premake4.lua | 77 +++++++++++++++++++++++++++---- 10 files changed, 68 insertions(+), 478 deletions(-) delete mode 100755 premake/example-00-helloworld.lua delete mode 100755 premake/example-01-cubes.lua delete mode 100755 premake/example-02-metaballs.lua delete mode 100755 premake/example-03-raymarch.lua delete mode 100755 premake/example-04-mesh.lua delete mode 100755 premake/example-05-instancing.lua delete mode 100755 premake/example-06-bump.lua delete mode 100755 premake/example-07-callback.lua delete mode 100755 premake/example-08-update.lua diff --git a/premake/example-00-helloworld.lua b/premake/example-00-helloworld.lua deleted file mode 100755 index 79dffca8..00000000 --- a/premake/example-00-helloworld.lua +++ /dev/null @@ -1,51 +0,0 @@ -project "example-00-helloworld" - uuid "ff2c8450-ebf4-11e0-9572-0800200c9a66" - kind "WindowedApp" - - includedirs { - BX_DIR .. "include", - BGFX_DIR .. "include", - } - - files { - BGFX_DIR .. "examples/common/**.cpp", - BGFX_DIR .. "examples/common/**.h", - BGFX_DIR .. "examples/00-helloworld/**.cpp", - BGFX_DIR .. "examples/00-helloworld/**.h", - } - - links { - "bgfx", - } - - configuration { "emscripten" } - targetextension ".bc" - - configuration { "nacl or nacl-arm or pnacl" } - targetextension ".nexe" - links { - "ppapi", - "ppapi_gles2", - "pthread", - } - - configuration { "nacl", "Release" } - postbuildcommands { - "@echo Stripping symbols.", - "@$(NACL)/bin/x86_64-nacl-strip -s \"$(TARGET)\"" - } - - configuration { "linux" } - links { - "GL", - "pthread", - } - - configuration { "macosx" } - files { - BGFX_DIR .. "examples/common/**.mm", - } - links { - "Cocoa.framework", - "OpenGL.framework", - } diff --git a/premake/example-01-cubes.lua b/premake/example-01-cubes.lua deleted file mode 100755 index 6dd65c40..00000000 --- a/premake/example-01-cubes.lua +++ /dev/null @@ -1,53 +0,0 @@ -project "example-01-cubes" - uuid "fec3bc94-e1e5-11e1-9c59-c7eeec2c1c51" - kind "WindowedApp" - - debugdir (BGFX_DIR .. "examples/runtime/") - - includedirs { - BX_DIR .. "include", - BGFX_DIR .. "include", - } - - files { - BGFX_DIR .. "examples/common/**.cpp", - BGFX_DIR .. "examples/common/**.h", - BGFX_DIR .. "examples/01-cubes/**.cpp", - BGFX_DIR .. "examples/01-cubes/**.h", - } - - links { - "bgfx", - } - - configuration { "emscripten" } - targetextension ".bc" - - configuration { "nacl or nacl-arm or pnacl" } - targetextension ".nexe" - links { - "ppapi", - "ppapi_gles2", - "pthread", - } - - configuration { "nacl", "Release" } - postbuildcommands { - "@echo Stripping symbols.", - "@$(NACL)/bin/x86_64-nacl-strip -s \"$(TARGET)\"" - } - - configuration { "linux" } - links { - "GL", - "pthread", - } - - configuration { "macosx" } - files { - BGFX_DIR .. "examples/common/**.mm", - } - links { - "Cocoa.framework", - "OpenGL.framework", - } diff --git a/premake/example-02-metaballs.lua b/premake/example-02-metaballs.lua deleted file mode 100755 index fe72eb7b..00000000 --- a/premake/example-02-metaballs.lua +++ /dev/null @@ -1,53 +0,0 @@ -project "example-02-metaballs" - uuid "413b2cb4-f7db-11e1-bf5f-a716de6a022f" - kind "WindowedApp" - - debugdir (BGFX_DIR .. "examples/runtime/") - - includedirs { - BX_DIR .. "include", - BGFX_DIR .. "include", - } - - files { - BGFX_DIR .. "examples/common/**.cpp", - BGFX_DIR .. "examples/common/**.h", - BGFX_DIR .. "examples/02-metaballs/**.cpp", - BGFX_DIR .. "examples/02-metaballs/**.h", - } - - links { - "bgfx", - } - - configuration { "emscripten" } - targetextension ".bc" - - configuration { "nacl or nacl-arm or pnacl" } - targetextension ".nexe" - links { - "ppapi", - "ppapi_gles2", - "pthread", - } - - configuration { "nacl", "Release" } - postbuildcommands { - "@echo Stripping symbols.", - "@$(NACL)/bin/x86_64-nacl-strip -s \"$(TARGET)\"" - } - - configuration { "linux" } - links { - "GL", - "pthread", - } - - configuration { "macosx" } - files { - BGFX_DIR .. "examples/common/**.mm", - } - links { - "Cocoa.framework", - "OpenGL.framework", - } diff --git a/premake/example-03-raymarch.lua b/premake/example-03-raymarch.lua deleted file mode 100755 index 06358079..00000000 --- a/premake/example-03-raymarch.lua +++ /dev/null @@ -1,53 +0,0 @@ -project "example-03-raymarch" - uuid "1cede802-0220-11e2-91ba-e108de6a022f" - kind "WindowedApp" - - debugdir (BGFX_DIR .. "examples/runtime/") - - includedirs { - BX_DIR .. "include", - BGFX_DIR .. "include", - } - - files { - BGFX_DIR .. "examples/common/**.cpp", - BGFX_DIR .. "examples/common/**.h", - BGFX_DIR .. "examples/03-raymarch/**.cpp", - BGFX_DIR .. "examples/03-raymarch/**.h", - } - - links { - "bgfx", - } - - configuration { "emscripten" } - targetextension ".bc" - - configuration { "nacl or nacl-arm or pnacl" } - targetextension ".nexe" - links { - "ppapi", - "ppapi_gles2", - "pthread", - } - - configuration { "nacl", "Release" } - postbuildcommands { - "@echo Stripping symbols.", - "@$(NACL)/bin/x86_64-nacl-strip -s \"$(TARGET)\"" - } - - configuration { "linux" } - links { - "GL", - "pthread", - } - - configuration { "macosx" } - files { - BGFX_DIR .. "examples/common/**.mm", - } - links { - "Cocoa.framework", - "OpenGL.framework", - } diff --git a/premake/example-04-mesh.lua b/premake/example-04-mesh.lua deleted file mode 100755 index 4686dba5..00000000 --- a/premake/example-04-mesh.lua +++ /dev/null @@ -1,53 +0,0 @@ -project "example-04-mesh" - uuid "546bbc76-0c4a-11e2-ab09-debcdd6a022f" - kind "WindowedApp" - - debugdir (BGFX_DIR .. "examples/runtime/") - - includedirs { - BX_DIR .. "include", - BGFX_DIR .. "include", - } - - files { - BGFX_DIR .. "examples/common/**.cpp", - BGFX_DIR .. "examples/common/**.h", - BGFX_DIR .. "examples/04-mesh/**.cpp", - BGFX_DIR .. "examples/04-mesh/**.h", - } - - links { - "bgfx", - } - - configuration { "emscripten" } - targetextension ".bc" - - configuration { "nacl or nacl-arm or pnacl" } - targetextension ".nexe" - links { - "ppapi", - "ppapi_gles2", - "pthread", - } - - configuration { "nacl", "Release" } - postbuildcommands { - "@echo Stripping symbols.", - "@$(NACL)/bin/x86_64-nacl-strip -s \"$(TARGET)\"" - } - - configuration { "linux" } - links { - "GL", - "pthread", - } - - configuration { "macosx" } - files { - BGFX_DIR .. "examples/common/**.mm", - } - links { - "Cocoa.framework", - "OpenGL.framework", - } diff --git a/premake/example-05-instancing.lua b/premake/example-05-instancing.lua deleted file mode 100755 index ce08a9ba..00000000 --- a/premake/example-05-instancing.lua +++ /dev/null @@ -1,53 +0,0 @@ -project "example-05-instancing" - uuid "5d3da660-1105-11e2-aece-71e4dd6a022f" - kind "WindowedApp" - - debugdir (BGFX_DIR .. "examples/runtime/") - - includedirs { - BX_DIR .. "include", - BGFX_DIR .. "include", - } - - files { - BGFX_DIR .. "examples/common/**.cpp", - BGFX_DIR .. "examples/common/**.h", - BGFX_DIR .. "examples/05-instancing/**.cpp", - BGFX_DIR .. "examples/05-instancing/**.h", - } - - links { - "bgfx", - } - - configuration { "emscripten" } - targetextension ".bc" - - configuration { "nacl or nacl-arm or pnacl" } - targetextension ".nexe" - links { - "ppapi", - "ppapi_gles2", - "pthread", - } - - configuration { "nacl", "Release" } - postbuildcommands { - "@echo Stripping symbols.", - "@$(NACL)/bin/x86_64-nacl-strip -s \"$(TARGET)\"" - } - - configuration { "linux" } - links { - "GL", - "pthread", - } - - configuration { "macosx" } - files { - BGFX_DIR .. "examples/common/**.mm", - } - links { - "Cocoa.framework", - "OpenGL.framework", - } diff --git a/premake/example-06-bump.lua b/premake/example-06-bump.lua deleted file mode 100755 index 6c704381..00000000 --- a/premake/example-06-bump.lua +++ /dev/null @@ -1,50 +0,0 @@ -project "example-06-bump" - uuid "ffb23e6c-167b-11e2-81df-94c4dd6a022f" - kind "WindowedApp" - - debugdir (BGFX_DIR .. "examples/runtime/") - - includedirs { - BX_DIR .. "include", - BGFX_DIR .. "include", - } - - files { - BGFX_DIR .. "examples/common/**.cpp", - BGFX_DIR .. "examples/common/**.h", - BGFX_DIR .. "examples/06-bump/**.cpp", - BGFX_DIR .. "examples/06-bump/**.h", - } - - links { - "bgfx", - } - - configuration { "nacl or nacl-arm or pnacl" } - targetextension ".nexe" - links { - "ppapi", - "ppapi_gles2", - "pthread", - } - - configuration { "nacl", "Release" } - postbuildcommands { - "@echo Stripping symbols.", - "@$(NACL)/bin/x86_64-nacl-strip -s \"$(TARGET)\"" - } - - configuration { "linux" } - links { - "GL", - "pthread", - } - - configuration { "macosx" } - files { - BGFX_DIR .. "examples/common/**.mm", - } - links { - "Cocoa.framework", - "OpenGL.framework", - } diff --git a/premake/example-07-callback.lua b/premake/example-07-callback.lua deleted file mode 100755 index 756ed5e2..00000000 --- a/premake/example-07-callback.lua +++ /dev/null @@ -1,50 +0,0 @@ -project "example-07-callback" - uuid "acc53bbc-52f0-11e2-9781-ad8edd4b7d02" - kind "WindowedApp" - - debugdir (BGFX_DIR .. "examples/runtime/") - - includedirs { - BX_DIR .. "include", - BGFX_DIR .. "include", - } - - files { - BGFX_DIR .. "examples/common/**.cpp", - BGFX_DIR .. "examples/common/**.h", - BGFX_DIR .. "examples/07-callback/**.cpp", - BGFX_DIR .. "examples/07-callback/**.h", - } - - links { - "bgfx", - } - - configuration { "nacl or nacl-arm or pnacl" } - targetextension ".nexe" - links { - "ppapi", - "ppapi_gles2", - "pthread", - } - - configuration { "nacl", "Release" } - postbuildcommands { - "@echo Stripping symbols.", - "@$(NACL)/bin/x86_64-nacl-strip -s \"$(TARGET)\"" - } - - configuration { "linux" } - links { - "GL", - "pthread", - } - - configuration { "macosx" } - files { - BGFX_DIR .. "examples/common/**.mm", - } - links { - "Cocoa.framework", - "OpenGL.framework", - } diff --git a/premake/example-08-update.lua b/premake/example-08-update.lua deleted file mode 100755 index 3abdb562..00000000 --- a/premake/example-08-update.lua +++ /dev/null @@ -1,53 +0,0 @@ -project "example-08-update" - uuid "e011e246-5862-11e2-b202-b7cb257a7926" - kind "WindowedApp" - - debugdir (BGFX_DIR .. "examples/runtime/") - - includedirs { - BX_DIR .. "include", - BGFX_DIR .. "include", - } - - files { - BGFX_DIR .. "examples/common/**.cpp", - BGFX_DIR .. "examples/common/**.h", - BGFX_DIR .. "examples/08-update/**.cpp", - BGFX_DIR .. "examples/08-update/**.h", - } - - links { - "bgfx", - } - - configuration { "emscripten" } - targetextension ".bc" - - configuration { "nacl or nacl-arm or pnacl" } - targetextension ".nexe" - links { - "ppapi", - "ppapi_gles2", - "pthread", - } - - configuration { "nacl", "Release" } - postbuildcommands { - "@echo Stripping symbols.", - "@$(NACL)/bin/x86_64-nacl-strip -s \"$(TARGET)\"" - } - - configuration { "linux" } - links { - "GL", - "pthread", - } - - configuration { "macosx" } - files { - BGFX_DIR .. "examples/common/**.mm", - } - links { - "Cocoa.framework", - "OpenGL.framework", - } diff --git a/premake/premake4.lua b/premake/premake4.lua index b2bb0834..ea12d399 100644 --- a/premake/premake4.lua +++ b/premake/premake4.lua @@ -28,16 +28,75 @@ toolchain(BGFX_BUILD_DIR, BGFX_THIRD_PARTY_DIR) function copyLib() end +function exampleProject(_name, _uuid) + + project ("example-" .. _name) + uuid (_uuid) + kind "WindowedApp" + + configuration {} + + debugdir (BGFX_DIR .. "examples/runtime/") + + includedirs { + BX_DIR .. "include", + BGFX_DIR .. "include", + } + + files { + BGFX_DIR .. "examples/common/**.cpp", + BGFX_DIR .. "examples/common/**.h", + BGFX_DIR .. "examples/" .. _name .. "/**.cpp", + BGFX_DIR .. "examples/" .. _name .. "/**.h", + } + + links { + "bgfx", + } + + configuration { "emscripten" } + targetextension ".bc" + + configuration { "nacl or nacl-arm or pnacl" } + targetextension ".nexe" + links { + "ppapi", + "ppapi_gles2", + "pthread", + } + + configuration { "nacl", "Release" } + postbuildcommands { + "@echo Stripping symbols.", + "@$(NACL)/bin/x86_64-nacl-strip -s \"$(TARGET)\"" + } + + configuration { "linux" } + links { + "GL", + "pthread", + } + + configuration { "macosx" } + files { + BGFX_DIR .. "examples/common/**.mm", + } + links { + "Cocoa.framework", + "OpenGL.framework", + } +end + dofile "bgfx.lua" -dofile "example-00-helloworld.lua" -dofile "example-01-cubes.lua" -dofile "example-02-metaballs.lua" -dofile "example-03-raymarch.lua" -dofile "example-04-mesh.lua" -dofile "example-05-instancing.lua" -dofile "example-06-bump.lua" -dofile "example-07-callback.lua" -dofile "example-08-update.lua" +exampleProject("00-helloworld", "ff2c8450-ebf4-11e0-9572-0800200c9a66") +exampleProject("01-cubes", "fec3bc94-e1e5-11e1-9c59-c7eeec2c1c51") +exampleProject("02-metaballs", "413b2cb4-f7db-11e1-bf5f-a716de6a022f") +exampleProject("03-raymarch", "1cede802-0220-11e2-91ba-e108de6a022f") +exampleProject("04-mesh", "546bbc76-0c4a-11e2-ab09-debcdd6a022f") +exampleProject("05-instancing", "5d3da660-1105-11e2-aece-71e4dd6a022f") +exampleProject("06-bump", "ffb23e6c-167b-11e2-81df-94c4dd6a022f") +exampleProject("07-callback", "acc53bbc-52f0-11e2-9781-ad8edd4b7d02") +exampleProject("08-update", "e011e246-5862-11e2-b202-b7cb257a7926") dofile "makedisttex.lua" dofile "shaderc.lua" dofile "texturec.lua"