bgfx/scripts/genie.lua

225 lines
4.1 KiB
Lua
Raw Normal View History

2012-04-04 07:30:07 +04:00
--
2014-02-11 10:07:04 +04:00
-- Copyright 2010-2014 Branimir Karadzic. All rights reserved.
2012-04-04 07:30:07 +04:00
-- License: http://www.opensource.org/licenses/BSD-2-Clause
--
2014-05-05 02:43:14 +04:00
newoption {
trigger = "with-tools",
description = "Enable building tools.",
}
2014-08-23 06:29:54 +04:00
newoption {
trigger = "with-shared-lib",
description = "Enable building shared library.",
}
2012-04-04 07:30:07 +04:00
solution "bgfx"
configurations {
"Debug",
"Release",
}
platforms {
"x32",
"x64",
2014-05-31 11:18:45 +04:00
-- "Xbox360",
"Native", -- for targets where bitness is not specified
2012-04-04 07:30:07 +04:00
}
language "C++"
2014-09-16 07:50:35 +04:00
startproject "example-00-helloworld"
2012-04-04 07:30:07 +04:00
2012-06-02 06:55:56 +04:00
BGFX_DIR = (path.getabsolute("..") .. "/")
local BGFX_BUILD_DIR = (BGFX_DIR .. ".build/")
local BGFX_THIRD_PARTY_DIR = (BGFX_DIR .. "3rdparty/")
2012-12-09 03:24:51 +04:00
BX_DIR = (BGFX_DIR .. "../bx/")
2012-09-17 04:36:08 +04:00
2013-02-27 09:27:31 +04:00
defines {
"BX_CONFIG_ENABLE_MSVC_LEVEL4_WARNINGS=1"
}
2014-09-11 08:04:42 +04:00
dofile (BX_DIR .. "scripts/toolchain.lua")
toolchain(BGFX_BUILD_DIR, BGFX_THIRD_PARTY_DIR)
2012-04-04 07:30:07 +04:00
2012-06-02 08:56:20 +04:00
function copyLib()
end
2014-09-11 10:01:22 +04:00
function exampleProject(_name)
2013-01-27 04:30:02 +04:00
project ("example-" .. _name)
2014-09-11 10:01:22 +04:00
uuid (os.uuid("example-" .. _name))
2013-01-27 04:30:02 +04:00
kind "WindowedApp"
configuration {}
debugdir (BGFX_DIR .. "examples/runtime/")
includedirs {
BX_DIR .. "include",
BGFX_DIR .. "include",
2013-04-25 08:01:11 +04:00
BGFX_DIR .. "3rdparty",
BGFX_DIR .. "examples/common",
2013-01-27 04:30:02 +04:00
}
files {
BGFX_DIR .. "examples/" .. _name .. "/**.cpp",
BGFX_DIR .. "examples/" .. _name .. "/**.h",
}
links {
"bgfx",
"example-common",
2013-01-27 04:30:02 +04:00
}
configuration { "vs*" }
linkoptions {
"/ignore:4199", -- LNK4199: /DELAYLOAD:*.dll ignored; no imports found from *.dll
}
links { -- this is needed only for testing with GLES2/3 on Windows with VS2008
"DelayImp",
}
2014-09-09 23:24:17 +04:00
configuration { "vs201*" }
linkoptions { -- this is needed only for testing with GLES2/3 on Windows with VS201x
"/DELAYLOAD:\"libEGL.dll\"",
"/DELAYLOAD:\"libGLESv2.dll\"",
}
2013-04-17 10:12:03 +04:00
configuration { "android*" }
2013-12-03 07:46:25 +04:00
kind "ConsoleApp"
2013-04-17 10:12:03 +04:00
targetextension ".so"
2013-12-03 07:46:25 +04:00
linkoptions {
"-shared",
}
2013-04-17 10:12:03 +04:00
links {
"EGL",
"GLESv2",
}
2013-05-19 02:28:35 +04:00
configuration { "nacl or nacl-arm" }
kind "ConsoleApp"
2013-01-27 04:30:02 +04:00
targetextension ".nexe"
links {
"ppapi",
"ppapi_gles2",
"pthread",
}
2013-05-19 02:28:35 +04:00
configuration { "pnacl" }
kind "ConsoleApp"
targetextension ".pexe"
links {
"ppapi",
"ppapi_gles2",
"pthread",
}
2014-03-16 23:38:43 +04:00
configuration { "asmjs" }
kind "ConsoleApp"
targetextension ".bc"
2013-11-20 09:38:06 +04:00
configuration { "linux-*" }
2013-01-27 04:30:02 +04:00
links {
2013-04-30 06:35:33 +04:00
"X11",
2013-01-27 04:30:02 +04:00
"GL",
"pthread",
}
2014-08-25 04:41:41 +04:00
configuration { "rpi" }
links {
"X11",
"GLESv2",
"EGL",
"bcm_host",
2014-08-25 07:39:35 +04:00
"vcos",
"vchiq_arm",
2014-08-25 04:41:41 +04:00
"pthread",
}
2013-04-13 10:43:46 +04:00
configuration { "osx" }
2013-01-27 04:30:02 +04:00
files {
2013-10-20 08:22:52 +04:00
BGFX_DIR .. "examples/common/**.mm",
2013-01-27 04:30:02 +04:00
}
links {
"Cocoa.framework",
"OpenGL.framework",
2014-01-31 08:31:49 +04:00
-- "SDL2",
2013-01-27 04:30:02 +04:00
}
configuration { "xcode4" }
platforms {
"Universal"
}
files {
BGFX_DIR .. "examples/common/**.mm",
}
links {
"Cocoa.framework",
"Foundation.framework",
"OpenGL.framework",
}
2013-07-22 01:44:53 +04:00
configuration { "ios*" }
kind "ConsoleApp"
2013-07-15 00:14:48 +04:00
files {
BGFX_DIR .. "examples/common/**.mm",
}
2013-07-13 09:27:46 +04:00
linkoptions {
"-framework CoreFoundation",
"-framework Foundation",
"-framework OpenGLES",
2013-07-22 01:44:53 +04:00
"-framework UIKit",
"-framework QuartzCore",
2013-07-13 09:27:46 +04:00
}
configuration { "qnx*" }
targetextension ""
links {
"EGL",
"GLESv2",
}
configuration {}
strip()
2013-01-27 04:30:02 +04:00
end
2012-06-02 06:55:56 +04:00
dofile "bgfx.lua"
dofile "example-common.lua"
2014-09-11 10:01:22 +04:00
bgfxProject("", "StaticLib", {})
exampleProject("00-helloworld")
exampleProject("01-cubes")
exampleProject("02-metaballs")
exampleProject("03-raymarch")
exampleProject("04-mesh")
exampleProject("05-instancing")
exampleProject("06-bump")
exampleProject("07-callback")
exampleProject("08-update")
exampleProject("09-hdr")
exampleProject("10-font")
exampleProject("11-fontsdf")
exampleProject("12-lod")
exampleProject("13-stencil")
exampleProject("14-shadowvolumes")
exampleProject("15-shadowmaps-simple")
exampleProject("16-shadowmaps")
exampleProject("17-drawstress")
exampleProject("18-ibl")
exampleProject("19-oit")
exampleProject("20-nanovg")
exampleProject("21-deferred")
exampleProject("22-windows")
2014-08-23 06:29:54 +04:00
if _OPTIONS["with-shared-lib"] then
2014-09-11 10:01:22 +04:00
bgfxProject("-shared-lib", "SharedLib", {})
2014-08-23 06:29:54 +04:00
end
2014-05-05 02:43:14 +04:00
if _OPTIONS["with-tools"] then
dofile "makedisttex.lua"
dofile "shaderc.lua"
dofile "texturec.lua"
dofile "geometryc.lua"
end