bgfx/scripts/example-common.lua
Martijn Courteaux e488a07f1b
Support both X11 and Wayland in the same build. (#3360)
* Support both X11 and Wayland in the same build.

 - Works for both Vulkan and OpenGL.
 - Remove --with-wayland from genie options.
 - Vulkan loads all three extensions for surface creation instead of only one.
 - Add width and height parameter to GlContext::createSwapChain(), which is needed for EGL to create
   a SwapChain with the given window size.
 - Dirty-fix the example-22-windows to recreate the FrameBuffer by first destroying and then
   recreating to make sure the window is released of its swapchain.
 - Fix dbgText glitch in example-22-windows.
 - Remove old X11-related dependencies for GLFW3.

* Formatting.
2024-10-05 14:33:22 -07:00

102 lines
2.3 KiB
Lua

--
-- Copyright 2010-2024 Branimir Karadzic. All rights reserved.
-- License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
--
project ("example-glue")
kind "StaticLib"
includedirs {
path.join(BIMG_DIR, "include"),
path.join(BGFX_DIR, "include"),
path.join(BGFX_DIR, "3rdparty"),
}
files {
path.join(BGFX_DIR, "examples/common/example-glue.cpp"),
}
using_bx()
configuration {}
project ("example-common")
kind "StaticLib"
includedirs {
path.join(BIMG_DIR, "include"),
path.join(BGFX_DIR, "include"),
path.join(BGFX_DIR, "3rdparty"),
}
files {
path.join(BGFX_DIR, "3rdparty/meshoptimizer/src/**.cpp"),
path.join(BGFX_DIR, "3rdparty/meshoptimizer/src/**.h"),
path.join(BGFX_DIR, "3rdparty/dear-imgui/**.cpp"),
path.join(BGFX_DIR, "3rdparty/dear-imgui/**.h"),
path.join(BGFX_DIR, "examples/common/**.cpp"),
path.join(BGFX_DIR, "examples/common/**.h"),
}
defines {
"USE_ENTRY=1",
}
using_bx()
if filesexist(BGFX_DIR, path.join(BGFX_DIR, "../bgfx-gnm"),
{ path.join(BGFX_DIR, "../bgfx-gnm/examples/common/entry/entry_orbis.cpp") }) then
files {
path.join(BGFX_DIR, "../bgfx-gnm/examples/common/entry/entry_orbis.cpp"),
}
end
if filesexist(BGFX_DIR, path.join(BGFX_DIR, "../bgfx-nvn"),
{ path.join(BGFX_DIR, "../bgfx-gnm/examples/common/entry/entry_nx.cpp") }) then
files {
path.join(BGFX_DIR, "../bgfx-gnm/examples/common/entry/entry_nx.cpp"),
}
end
removefiles {
path.join(BGFX_DIR, "examples/common/example-glue.cpp"),
}
if _OPTIONS["with-sdl"] then
defines {
"ENTRY_CONFIG_USE_SDL=1",
}
includedirs {
"$(SDL2_DIR)/include",
}
end
if _OPTIONS["with-glfw"] then
defines {
"ENTRY_CONFIG_USE_GLFW=1",
}
end
configuration { "android-*" }
includedirs {
path.join(BGFX_DIR, "3rdparty/native_app_glue")
}
configuration { "osx* or ios* or tvos*" }
files {
path.join(BGFX_DIR, "examples/common/**.mm"),
}
configuration { "winstore* or durango"}
files {
path.join(BGFX_DIR, "examples/common/**.cx"),
}
linkoptions {
"/ignore:4264" -- LNK4264: archiving object file compiled with /ZW into a static library; note that when authoring Windows Runtime types it is not recommended to link with a static library that contains Windows Runtime metadata
}
premake.vstudio.splashpath = "../../../examples/runtime/images/SplashScreen.png"
configuration {}