example-common.lua 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. --
  2. -- Copyright 2010-2022 Branimir Karadzic. All rights reserved.
  3. -- License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
  4. --
  5. project ("example-glue")
  6. kind "StaticLib"
  7. includedirs {
  8. path.join(BIMG_DIR, "include"),
  9. path.join(BGFX_DIR, "include"),
  10. path.join(BGFX_DIR, "3rdparty"),
  11. }
  12. files {
  13. path.join(BGFX_DIR, "examples/common/example-glue.cpp"),
  14. }
  15. using_bx()
  16. configuration {}
  17. project ("example-common")
  18. kind "StaticLib"
  19. includedirs {
  20. path.join(BIMG_DIR, "include"),
  21. path.join(BGFX_DIR, "include"),
  22. path.join(BGFX_DIR, "3rdparty"),
  23. }
  24. files {
  25. path.join(BGFX_DIR, "3rdparty/meshoptimizer/src/**.cpp"),
  26. path.join(BGFX_DIR, "3rdparty/meshoptimizer/src/**.h"),
  27. path.join(BGFX_DIR, "3rdparty/dear-imgui/**.cpp"),
  28. path.join(BGFX_DIR, "3rdparty/dear-imgui/**.h"),
  29. path.join(BGFX_DIR, "examples/common/**.cpp"),
  30. path.join(BGFX_DIR, "examples/common/**.h"),
  31. }
  32. using_bx()
  33. if filesexist(BGFX_DIR, path.join(BGFX_DIR, "../bgfx-gnm"),
  34. { path.join(BGFX_DIR, "../bgfx-gnm/examples/common/entry/entry_orbis.cpp") }) then
  35. files {
  36. path.join(BGFX_DIR, "../bgfx-gnm/examples/common/entry/entry_orbis.cpp"),
  37. }
  38. end
  39. if filesexist(BGFX_DIR, path.join(BGFX_DIR, "../bgfx-nvn"),
  40. { path.join(BGFX_DIR, "../bgfx-gnm/examples/common/entry/entry_nx.cpp") }) then
  41. files {
  42. path.join(BGFX_DIR, "../bgfx-gnm/examples/common/entry/entry_nx.cpp"),
  43. }
  44. end
  45. removefiles {
  46. path.join(BGFX_DIR, "examples/common/example-glue.cpp"),
  47. }
  48. if _OPTIONS["with-sdl"] then
  49. defines {
  50. "ENTRY_CONFIG_USE_SDL=1",
  51. }
  52. includedirs {
  53. "$(SDL2_DIR)/include",
  54. }
  55. end
  56. if _OPTIONS["with-glfw"] then
  57. defines {
  58. "ENTRY_CONFIG_USE_GLFW=1",
  59. }
  60. end
  61. if _OPTIONS["with-wayland"] then
  62. defines {
  63. "ENTRY_CONFIG_USE_WAYLAND=1",
  64. }
  65. end
  66. configuration { "android-*" }
  67. includedirs {
  68. path.join(BGFX_DIR, "3rdparty/native_app_glue")
  69. }
  70. configuration { "osx* or ios* or tvos*" }
  71. files {
  72. path.join(BGFX_DIR, "examples/common/**.mm"),
  73. }
  74. configuration { "winstore* or durango"}
  75. files {
  76. path.join(BGFX_DIR, "examples/common/**.cx"),
  77. }
  78. linkoptions {
  79. "/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
  80. }
  81. premake.vstudio.splashpath = "../../../examples/runtime/images/SplashScreen.png"
  82. configuration {}