shaderc.lua 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  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 { "windows" }
  40. includedirs {
  41. "$(DXSDK_DIR)/include",
  42. }
  43. links {
  44. "d3dx9",
  45. "d3dcompiler",
  46. "dxguid",
  47. }
  48. configuration {}
  49. defines { -- fcpp
  50. "NINCLUDE=64",
  51. "NWORK=65536",
  52. "NBUFF=65536",
  53. "OLD_PREPROCESSOR=0",
  54. }
  55. includedirs {
  56. path.join(BX_DIR, "include"),
  57. path.join(BGFX_DIR, "include"),
  58. FCPP_DIR,
  59. path.join(GLSL_OPTIMIZER, "include"),
  60. path.join(GLSL_OPTIMIZER, "src/mesa"),
  61. path.join(GLSL_OPTIMIZER, "src/mapi"),
  62. path.join(GLSL_OPTIMIZER, "src/glsl"),
  63. }
  64. files {
  65. path.join(BGFX_DIR, "tools/shaderc/**.cpp"),
  66. path.join(BGFX_DIR, "tools/shaderc/**.h"),
  67. path.join(BGFX_DIR, "src/vertexdecl.**"),
  68. path.join(FCPP_DIR, "**.h"),
  69. path.join(FCPP_DIR, "cpp1.c"),
  70. path.join(FCPP_DIR, "cpp2.c"),
  71. path.join(FCPP_DIR, "cpp3.c"),
  72. path.join(FCPP_DIR, "cpp4.c"),
  73. path.join(FCPP_DIR, "cpp5.c"),
  74. path.join(FCPP_DIR, "cpp6.c"),
  75. path.join(FCPP_DIR, "cpp6.c"),
  76. path.join(GLSL_OPTIMIZER, "src/mesa/**.c"),
  77. path.join(GLSL_OPTIMIZER, "src/glsl/**.cpp"),
  78. path.join(GLSL_OPTIMIZER, "src/mesa/**.h"),
  79. path.join(GLSL_OPTIMIZER, "src/glsl/**.c"),
  80. path.join(GLSL_OPTIMIZER, "src/glsl/**.cpp"),
  81. path.join(GLSL_OPTIMIZER, "src/glsl/**.h"),
  82. path.join(GLSL_OPTIMIZER, "src/util/**.c"),
  83. path.join(GLSL_OPTIMIZER, "src/util/**.h"),
  84. }
  85. excludes {
  86. path.join(GLSL_OPTIMIZER, "src/glsl/glcpp/glcpp.c"),
  87. path.join(GLSL_OPTIMIZER, "src/glsl/glcpp/tests/**"),
  88. path.join(GLSL_OPTIMIZER, "src/glsl/glcpp/**.l"),
  89. path.join(GLSL_OPTIMIZER, "src/glsl/glcpp/**.y"),
  90. path.join(GLSL_OPTIMIZER, "src/glsl/ir_set_program_inouts.cpp"),
  91. path.join(GLSL_OPTIMIZER, "src/glsl/main.cpp"),
  92. path.join(GLSL_OPTIMIZER, "src/glsl/builtin_stubs.cpp"),
  93. }
  94. strip()