shaderc.lua 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. --
  2. -- Copyright 2010-2015 Branimir Karadzic. All rights reserved.
  3. -- License: http://www.opensource.org/licenses/BSD-2-Clause
  4. --
  5. project "shaderc"
  6. uuid "f3cd2e90-52a4-11e1-b86c-0800200c9a66"
  7. kind "ConsoleApp"
  8. local GLSL_OPTIMIZER = path.join(BGFX_DIR, "3rdparty/glsl-optimizer")
  9. local FCPP_DIR = path.join(BGFX_DIR, "3rdparty/fcpp")
  10. includedirs {
  11. path.join(GLSL_OPTIMIZER, "src"),
  12. }
  13. configuration { "vs*" }
  14. includedirs {
  15. path.join(GLSL_OPTIMIZER, "src/glsl/msvc"),
  16. }
  17. defines { -- glsl-optimizer
  18. "__STDC__",
  19. "__STDC_VERSION__=199901L",
  20. "strdup=_strdup",
  21. "alloca=_alloca",
  22. "isascii=__isascii",
  23. }
  24. buildoptions {
  25. "/wd4996" -- warning C4996: 'strdup': The POSIX name for this item is deprecated. Instead, use the ISO C++ conformant name: _strdup.
  26. }
  27. configuration { "mingw* or linux or osx" }
  28. buildoptions {
  29. "-fno-strict-aliasing" -- glsl-optimizer has bugs if strict aliasing is used.
  30. }
  31. configuration { "osx" }
  32. links {
  33. "Cocoa.framework",
  34. }
  35. configuration { "windows", "vs*" }
  36. includedirs {
  37. path.join(GLSL_OPTIMIZER, "include/c99"),
  38. }
  39. configuration { "vs*" }
  40. includedirs {
  41. "$(DXSDK_DIR)/include",
  42. }
  43. configuration { "windows" }
  44. links {
  45. "d3dx9",
  46. "d3dcompiler",
  47. "dxguid",
  48. }
  49. configuration {}
  50. defines { -- fcpp
  51. "NINCLUDE=64",
  52. "NWORK=65536",
  53. "NBUFF=65536",
  54. "OLD_PREPROCESSOR=0",
  55. }
  56. includedirs {
  57. path.join(BX_DIR, "include"),
  58. path.join(BGFX_DIR, "include"),
  59. FCPP_DIR,
  60. path.join(GLSL_OPTIMIZER, "include"),
  61. path.join(GLSL_OPTIMIZER, "src/mesa"),
  62. path.join(GLSL_OPTIMIZER, "src/mapi"),
  63. path.join(GLSL_OPTIMIZER, "src/glsl"),
  64. }
  65. files {
  66. path.join(BGFX_DIR, "tools/shaderc/**.cpp"),
  67. path.join(BGFX_DIR, "tools/shaderc/**.h"),
  68. path.join(BGFX_DIR, "src/vertexdecl.**"),
  69. path.join(FCPP_DIR, "**.h"),
  70. path.join(FCPP_DIR, "cpp1.c"),
  71. path.join(FCPP_DIR, "cpp2.c"),
  72. path.join(FCPP_DIR, "cpp3.c"),
  73. path.join(FCPP_DIR, "cpp4.c"),
  74. path.join(FCPP_DIR, "cpp5.c"),
  75. path.join(FCPP_DIR, "cpp6.c"),
  76. path.join(FCPP_DIR, "cpp6.c"),
  77. path.join(GLSL_OPTIMIZER, "src/mesa/**.c"),
  78. path.join(GLSL_OPTIMIZER, "src/glsl/**.cpp"),
  79. path.join(GLSL_OPTIMIZER, "src/mesa/**.h"),
  80. path.join(GLSL_OPTIMIZER, "src/glsl/**.c"),
  81. path.join(GLSL_OPTIMIZER, "src/glsl/**.cpp"),
  82. path.join(GLSL_OPTIMIZER, "src/glsl/**.h"),
  83. path.join(GLSL_OPTIMIZER, "src/util/**.c"),
  84. path.join(GLSL_OPTIMIZER, "src/util/**.h"),
  85. }
  86. excludes {
  87. path.join(GLSL_OPTIMIZER, "src/glsl/glcpp/glcpp.c"),
  88. path.join(GLSL_OPTIMIZER, "src/glsl/glcpp/tests/**"),
  89. path.join(GLSL_OPTIMIZER, "src/glsl/glcpp/**.l"),
  90. path.join(GLSL_OPTIMIZER, "src/glsl/glcpp/**.y"),
  91. path.join(GLSL_OPTIMIZER, "src/glsl/ir_set_program_inouts.cpp"),
  92. path.join(GLSL_OPTIMIZER, "src/glsl/main.cpp"),
  93. path.join(GLSL_OPTIMIZER, "src/glsl/builtin_stubs.cpp"),
  94. }
  95. strip()