Android.mk 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166
  1. # Copyright (C) 2020 The Khronos Group Inc.
  2. #
  3. # All rights reserved.
  4. #
  5. # Redistribution and use in source and binary forms, with or without
  6. # modification, are permitted provided that the following conditions
  7. # are met:
  8. #
  9. # Redistributions of source code must retain the above copyright
  10. # notice, this list of conditions and the following disclaimer.
  11. #
  12. # Redistributions in binary form must reproduce the above
  13. # copyright notice, this list of conditions and the following
  14. # disclaimer in the documentation and/or other materials provided
  15. # with the distribution.
  16. #
  17. # Neither the name of The Khronos Group Inc. nor the names of its
  18. # contributors may be used to endorse or promote products derived
  19. # from this software without specific prior written permission.
  20. #
  21. # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  22. # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  23. # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
  24. # FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
  25. # COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
  26. # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
  27. # BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
  28. # LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
  29. # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  30. # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
  31. # ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  32. # POSSIBILITY OF SUCH DAMAGE.
  33. LOCAL_PATH := $(call my-dir)
  34. # Generate glslang/build_info.h
  35. GLSLANG_GENERATED_INCLUDEDIR:=$(TARGET_OUT)/include
  36. GLSLANG_BUILD_INFO_H:=$(GLSLANG_GENERATED_INCLUDEDIR)/glslang/build_info.h
  37. define gen_glslang_build_info_h
  38. $(call generate-file-dir,$(GLSLANG_GENERATED_INCLUDEDIR)/dummy_filename)
  39. $(GLSLANG_BUILD_INFO_H): \
  40. $(LOCAL_PATH)/build_info.py \
  41. $(LOCAL_PATH)/build_info.h.tmpl \
  42. $(LOCAL_PATH)/CHANGES.md
  43. @$(HOST_PYTHON) $(LOCAL_PATH)/build_info.py \
  44. $(LOCAL_PATH) \
  45. -i $(LOCAL_PATH)/build_info.h.tmpl \
  46. -o $(GLSLANG_BUILD_INFO_H)
  47. @echo "[$(TARGET_ARCH_ABI)] Generate : $(GLSLANG_BUILD_INFO_H) <= CHANGES.md"
  48. endef
  49. $(eval $(call gen_glslang_build_info_h))
  50. GLSLANG_OS_FLAGS := -DGLSLANG_OSINCLUDE_UNIX
  51. # AMD and NV extensions are turned on by default in upstream Glslang.
  52. GLSLANG_DEFINES:= -DAMD_EXTENSIONS -DNV_EXTENSIONS -DENABLE_HLSL $(GLSLANG_OS_FLAGS)
  53. include $(CLEAR_VARS)
  54. LOCAL_MODULE:=OSDependent
  55. LOCAL_CXXFLAGS:=-std=c++11 -fno-exceptions -fno-rtti $(GLSLANG_DEFINES)
  56. LOCAL_EXPORT_C_INCLUDES:=$(LOCAL_PATH)
  57. LOCAL_SRC_FILES:=glslang/OSDependent/Unix/ossource.cpp
  58. LOCAL_C_INCLUDES:=$(LOCAL_PATH) $(LOCAL_PATH)/glslang/OSDependent/Unix/
  59. LOCAL_EXPORT_C_INCLUDES:=$(LOCAL_PATH)/glslang/OSDependent/Unix/
  60. include $(BUILD_STATIC_LIBRARY)
  61. include $(CLEAR_VARS)
  62. LOCAL_MODULE:=OGLCompiler
  63. LOCAL_CXXFLAGS:=-std=c++11 -fno-exceptions -fno-rtti $(GLSLANG_DEFINES)
  64. LOCAL_EXPORT_C_INCLUDES:=$(LOCAL_PATH)
  65. LOCAL_SRC_FILES:=OGLCompilersDLL/InitializeDll.cpp
  66. LOCAL_C_INCLUDES:=$(LOCAL_PATH)/OGLCompiler
  67. LOCAL_STATIC_LIBRARIES:=OSDependent
  68. include $(BUILD_STATIC_LIBRARY)
  69. # Build the stubbed HLSL library.
  70. # The HLSL source is now directly referenced by the glslang static library
  71. # instead.
  72. include $(CLEAR_VARS)
  73. LOCAL_MODULE:=HLSL
  74. LOCAL_CXXFLAGS:=-std=c++11 -fno-exceptions -fno-rtti $(GLSLANG_DEFINES)
  75. LOCAL_SRC_FILES:= \
  76. hlsl/stub.cpp
  77. LOCAL_C_INCLUDES:=$(LOCAL_PATH) \
  78. $(LOCAL_PATH)/glslang/HLSL
  79. include $(BUILD_STATIC_LIBRARY)
  80. include $(CLEAR_VARS)
  81. GLSLANG_OUT_PATH=$(if $(call host-path-is-absolute,$(TARGET_OUT)),$(TARGET_OUT),$(abspath $(TARGET_OUT)))
  82. # ShaderLang.cpp depends on the generated build_info.h
  83. $(LOCAL_PATH)/glslang/MachineIndependent/ShaderLang.cpp: \
  84. $(GLSLANG_BUILD_INFO_H)
  85. LOCAL_MODULE:=glslang
  86. LOCAL_CXXFLAGS:=-std=c++11 -fno-exceptions -fno-rtti $(GLSLANG_DEFINES)
  87. LOCAL_EXPORT_C_INCLUDES:=$(LOCAL_PATH)
  88. LOCAL_SRC_FILES:= \
  89. glslang/GenericCodeGen/CodeGen.cpp \
  90. glslang/GenericCodeGen/Link.cpp \
  91. glslang/HLSL/hlslAttributes.cpp \
  92. glslang/HLSL/hlslGrammar.cpp \
  93. glslang/HLSL/hlslOpMap.cpp \
  94. glslang/HLSL/hlslParseables.cpp \
  95. glslang/HLSL/hlslParseHelper.cpp \
  96. glslang/HLSL/hlslScanContext.cpp \
  97. glslang/HLSL/hlslTokenStream.cpp \
  98. glslang/MachineIndependent/attribute.cpp \
  99. glslang/MachineIndependent/Constant.cpp \
  100. glslang/MachineIndependent/glslang_tab.cpp \
  101. glslang/MachineIndependent/InfoSink.cpp \
  102. glslang/MachineIndependent/Initialize.cpp \
  103. glslang/MachineIndependent/Intermediate.cpp \
  104. glslang/MachineIndependent/intermOut.cpp \
  105. glslang/MachineIndependent/IntermTraverse.cpp \
  106. glslang/MachineIndependent/iomapper.cpp \
  107. glslang/MachineIndependent/limits.cpp \
  108. glslang/MachineIndependent/linkValidate.cpp \
  109. glslang/MachineIndependent/parseConst.cpp \
  110. glslang/MachineIndependent/ParseContextBase.cpp \
  111. glslang/MachineIndependent/ParseHelper.cpp \
  112. glslang/MachineIndependent/PoolAlloc.cpp \
  113. glslang/MachineIndependent/propagateNoContraction.cpp \
  114. glslang/MachineIndependent/reflection.cpp \
  115. glslang/MachineIndependent/RemoveTree.cpp \
  116. glslang/MachineIndependent/Scan.cpp \
  117. glslang/MachineIndependent/ShaderLang.cpp \
  118. glslang/MachineIndependent/SymbolTable.cpp \
  119. glslang/MachineIndependent/Versions.cpp \
  120. glslang/MachineIndependent/preprocessor/PpAtom.cpp \
  121. glslang/MachineIndependent/preprocessor/PpContext.cpp \
  122. glslang/MachineIndependent/preprocessor/Pp.cpp \
  123. glslang/MachineIndependent/preprocessor/PpScanner.cpp \
  124. glslang/MachineIndependent/preprocessor/PpTokens.cpp
  125. LOCAL_C_INCLUDES:=$(LOCAL_PATH) \
  126. $(LOCAL_PATH)/glslang/MachineIndependent \
  127. $(GLSLANG_GENERATED_INCLUDEDIR) \
  128. $(GLSLANG_OUT_PATH)
  129. LOCAL_STATIC_LIBRARIES:=OSDependent OGLCompiler HLSL
  130. include $(BUILD_STATIC_LIBRARY)
  131. include $(CLEAR_VARS)
  132. # GlslangToSpv.cpp depends on the generated build_info.h
  133. $(LOCAL_PATH)/SPIRV/GlslangToSpv.cpp: \
  134. $(GLSLANG_BUILD_INFO_H)
  135. LOCAL_MODULE:=SPIRV
  136. LOCAL_CXXFLAGS:=-std=c++11 -fno-exceptions -fno-rtti -Werror $(GLSLANG_DEFINES)
  137. LOCAL_SRC_FILES:= \
  138. SPIRV/GlslangToSpv.cpp \
  139. SPIRV/InReadableOrder.cpp \
  140. SPIRV/Logger.cpp \
  141. SPIRV/SPVRemapper.cpp \
  142. SPIRV/SpvBuilder.cpp \
  143. SPIRV/SpvPostProcess.cpp \
  144. SPIRV/SpvTools.cpp \
  145. SPIRV/disassemble.cpp \
  146. SPIRV/doc.cpp
  147. LOCAL_C_INCLUDES:=$(LOCAL_PATH) \
  148. $(LOCAL_PATH)/glslang/SPIRV \
  149. $(GLSLANG_GENERATED_INCLUDEDIR)
  150. LOCAL_EXPORT_C_INCLUDES:=$(LOCAL_PATH)/glslang/SPIRV
  151. LOCAL_STATIC_LIBRARIES:=glslang
  152. include $(BUILD_STATIC_LIBRARY)