shaderc.lua 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  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 { "windows", "vs*" }
  29. includedirs {
  30. GLSL_OPTIMIZER .. "include/c99",
  31. }
  32. configuration { "windows" }
  33. includedirs {
  34. "$(DXSDK_DIR)/include",
  35. }
  36. links {
  37. "d3dx9",
  38. "d3dcompiler",
  39. "dxguid",
  40. }
  41. configuration {}
  42. defines { -- fcpp
  43. "NINCLUDE=64",
  44. "NWORK=65536",
  45. "NBUFF=65536",
  46. }
  47. includedirs {
  48. BX_DIR .. "include",
  49. FCPP_DIR,
  50. GLSL_OPTIMIZER .. "include",
  51. GLSL_OPTIMIZER .. "src/mesa",
  52. GLSL_OPTIMIZER .. "src/mapi",
  53. GLSL_OPTIMIZER .. "src/glsl",
  54. }
  55. files {
  56. BGFX_DIR .. "tools/shaderc/**.cpp",
  57. BGFX_DIR .. "tools/shaderc/**.h",
  58. FCPP_DIR .. "**.h",
  59. FCPP_DIR .. "cpp1.c",
  60. FCPP_DIR .. "cpp2.c",
  61. FCPP_DIR .. "cpp3.c",
  62. FCPP_DIR .. "cpp4.c",
  63. FCPP_DIR .. "cpp5.c",
  64. FCPP_DIR .. "cpp6.c",
  65. FCPP_DIR .. "cpp6.c",
  66. GLSL_OPTIMIZER .. "src/mesa/**.c",
  67. GLSL_OPTIMIZER .. "src/glsl/**.cpp",
  68. GLSL_OPTIMIZER .. "src/mesa/**.h",
  69. GLSL_OPTIMIZER .. "src/glsl/**.c",
  70. GLSL_OPTIMIZER .. "src/glsl/**.cpp",
  71. GLSL_OPTIMIZER .. "src/glsl/**.h",
  72. }
  73. excludes {
  74. GLSL_OPTIMIZER .. "src/glsl/glcpp/glcpp.c",
  75. GLSL_OPTIMIZER .. "src/glsl/glcpp/tests/**",
  76. GLSL_OPTIMIZER .. "src/glsl/glcpp/**.l",
  77. GLSL_OPTIMIZER .. "src/glsl/glcpp/**.y",
  78. GLSL_OPTIMIZER .. "src/glsl/ir_set_program_inouts.cpp",
  79. GLSL_OPTIMIZER .. "src/glsl/main.cpp",
  80. GLSL_OPTIMIZER .. "src/glsl/builtin_stubs.cpp",
  81. }
  82. strip()