shaderc.lua 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. --
  2. -- Copyright 2010-2013 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 = (BGFX_DIR .. "3rdparty/glsl-optimizer/")
  9. local FCPP_DIR = (BGFX_DIR .. "3rdparty/fcpp/")
  10. configuration { "vs*" }
  11. includedirs {
  12. GLSL_OPTIMIZER .. "src/glsl/msvc",
  13. }
  14. defines { -- glsl-optimizer
  15. "__STDC__",
  16. "__STDC_VERSION__=199901L",
  17. "strdup=_strdup",
  18. "alloca=_alloca",
  19. "isascii=__isascii",
  20. }
  21. buildoptions {
  22. "/wd4996" -- warning C4996: 'strdup': The POSIX name for this item is deprecated. Instead, use the ISO C++ conformant name: _strdup.
  23. }
  24. configuration { "mingw or linux or osx" }
  25. buildoptions {
  26. "-fno-strict-aliasing" -- glsl-optimizer has bugs if strict aliasing is used.
  27. }
  28. configuration { "osx" }
  29. links {
  30. "Cocoa.framework",
  31. }
  32. configuration { "windows", "vs*" }
  33. includedirs {
  34. GLSL_OPTIMIZER .. "include/c99",
  35. }
  36. configuration { "windows" }
  37. includedirs {
  38. "$(DXSDK_DIR)/include",
  39. }
  40. links {
  41. "d3dx9",
  42. "d3dcompiler",
  43. "dxguid",
  44. }
  45. configuration {}
  46. defines { -- fcpp
  47. "NINCLUDE=64",
  48. "NWORK=65536",
  49. "NBUFF=65536",
  50. }
  51. includedirs {
  52. BX_DIR .. "include",
  53. FCPP_DIR,
  54. GLSL_OPTIMIZER .. "include",
  55. GLSL_OPTIMIZER .. "src/mesa",
  56. GLSL_OPTIMIZER .. "src/mapi",
  57. GLSL_OPTIMIZER .. "src/glsl",
  58. }
  59. files {
  60. BGFX_DIR .. "tools/shaderc/**.cpp",
  61. BGFX_DIR .. "tools/shaderc/**.h",
  62. FCPP_DIR .. "**.h",
  63. FCPP_DIR .. "cpp1.c",
  64. FCPP_DIR .. "cpp2.c",
  65. FCPP_DIR .. "cpp3.c",
  66. FCPP_DIR .. "cpp4.c",
  67. FCPP_DIR .. "cpp5.c",
  68. FCPP_DIR .. "cpp6.c",
  69. FCPP_DIR .. "cpp6.c",
  70. GLSL_OPTIMIZER .. "src/mesa/**.c",
  71. GLSL_OPTIMIZER .. "src/glsl/**.cpp",
  72. GLSL_OPTIMIZER .. "src/mesa/**.h",
  73. GLSL_OPTIMIZER .. "src/glsl/**.c",
  74. GLSL_OPTIMIZER .. "src/glsl/**.cpp",
  75. GLSL_OPTIMIZER .. "src/glsl/**.h",
  76. }
  77. excludes {
  78. GLSL_OPTIMIZER .. "src/glsl/glcpp/glcpp.c",
  79. GLSL_OPTIMIZER .. "src/glsl/glcpp/tests/**",
  80. GLSL_OPTIMIZER .. "src/glsl/glcpp/**.l",
  81. GLSL_OPTIMIZER .. "src/glsl/glcpp/**.y",
  82. GLSL_OPTIMIZER .. "src/glsl/ir_set_program_inouts.cpp",
  83. GLSL_OPTIMIZER .. "src/glsl/main.cpp",
  84. GLSL_OPTIMIZER .. "src/glsl/builtin_stubs.cpp",
  85. }
  86. strip()