Android.mk 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  1. # Copyright (C) 2020-2023 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:= -DENABLE_HLSL $(GLSLANG_OS_FLAGS)
  53. include $(CLEAR_VARS)
  54. LOCAL_MODULE:=OSDependent
  55. LOCAL_CXXFLAGS:=-std=c++17 -fno-exceptions -fno-rtti $(GLSLANG_DEFINES)
  56. LOCAL_EXPORT_C_INCLUDES:=$(LOCAL_PATH)
  57. LOCAL_SRC_FILES:=glslang/stub.cpp
  58. LOCAL_C_INCLUDES:=$(LOCAL_PATH)
  59. include $(BUILD_STATIC_LIBRARY)
  60. include $(CLEAR_VARS)
  61. GLSLANG_OUT_PATH=$(if $(call host-path-is-absolute,$(TARGET_OUT)),$(TARGET_OUT),$(abspath $(TARGET_OUT)))
  62. # ShaderLang.cpp depends on the generated build_info.h
  63. $(LOCAL_PATH)/glslang/MachineIndependent/ShaderLang.cpp: \
  64. $(GLSLANG_BUILD_INFO_H)
  65. LOCAL_MODULE:=glslang
  66. LOCAL_CXXFLAGS:=-std=c++17 -fno-exceptions -fno-rtti $(GLSLANG_DEFINES)
  67. LOCAL_EXPORT_C_INCLUDES:=$(LOCAL_PATH) \
  68. $(LOCAL_PATH)/glslang/OSDependent/Unix
  69. LOCAL_SRC_FILES:= \
  70. glslang/CInterface/glslang_c_interface.cpp \
  71. glslang/GenericCodeGen/CodeGen.cpp \
  72. glslang/GenericCodeGen/Link.cpp \
  73. glslang/HLSL/hlslAttributes.cpp \
  74. glslang/HLSL/hlslGrammar.cpp \
  75. glslang/HLSL/hlslOpMap.cpp \
  76. glslang/HLSL/hlslParseables.cpp \
  77. glslang/HLSL/hlslParseHelper.cpp \
  78. glslang/HLSL/hlslScanContext.cpp \
  79. glslang/HLSL/hlslTokenStream.cpp \
  80. glslang/MachineIndependent/attribute.cpp \
  81. glslang/MachineIndependent/Constant.cpp \
  82. glslang/MachineIndependent/glslang_tab.cpp \
  83. glslang/MachineIndependent/InfoSink.cpp \
  84. glslang/MachineIndependent/Initialize.cpp \
  85. glslang/MachineIndependent/Intermediate.cpp \
  86. glslang/MachineIndependent/intermOut.cpp \
  87. glslang/MachineIndependent/IntermTraverse.cpp \
  88. glslang/MachineIndependent/iomapper.cpp \
  89. glslang/MachineIndependent/limits.cpp \
  90. glslang/MachineIndependent/linkValidate.cpp \
  91. glslang/MachineIndependent/parseConst.cpp \
  92. glslang/MachineIndependent/ParseContextBase.cpp \
  93. glslang/MachineIndependent/ParseHelper.cpp \
  94. glslang/MachineIndependent/PoolAlloc.cpp \
  95. glslang/MachineIndependent/propagateNoContraction.cpp \
  96. glslang/MachineIndependent/reflection.cpp \
  97. glslang/MachineIndependent/RemoveTree.cpp \
  98. glslang/MachineIndependent/Scan.cpp \
  99. glslang/MachineIndependent/ShaderLang.cpp \
  100. glslang/MachineIndependent/SpirvIntrinsics.cpp \
  101. glslang/MachineIndependent/SymbolTable.cpp \
  102. glslang/MachineIndependent/Versions.cpp \
  103. glslang/MachineIndependent/preprocessor/PpAtom.cpp \
  104. glslang/MachineIndependent/preprocessor/PpContext.cpp \
  105. glslang/MachineIndependent/preprocessor/Pp.cpp \
  106. glslang/MachineIndependent/preprocessor/PpScanner.cpp \
  107. glslang/MachineIndependent/preprocessor/PpTokens.cpp \
  108. glslang/OSDependent/Unix/ossource.cpp \
  109. SPIRV/CInterface/spirv_c_interface.cpp \
  110. SPIRV/GlslangToSpv.cpp \
  111. SPIRV/InReadableOrder.cpp \
  112. SPIRV/Logger.cpp \
  113. SPIRV/SPVRemapper.cpp \
  114. SPIRV/SpvBuilder.cpp \
  115. SPIRV/SpvPostProcess.cpp \
  116. SPIRV/SpvTools.cpp \
  117. SPIRV/disassemble.cpp \
  118. SPIRV/doc.cpp
  119. LOCAL_C_INCLUDES:=$(LOCAL_PATH) \
  120. $(LOCAL_PATH)/glslang/MachineIndependent \
  121. $(LOCAL_PATH)/glslang/OSDependent/Unix \
  122. $(LOCAL_PATH)/SPIRV \
  123. $(GLSLANG_GENERATED_INCLUDEDIR) \
  124. $(GLSLANG_OUT_PATH)
  125. include $(BUILD_STATIC_LIBRARY)
  126. include $(CLEAR_VARS)
  127. # GlslangToSpv.cpp depends on the generated build_info.h
  128. $(LOCAL_PATH)/SPIRV/GlslangToSpv.cpp: \
  129. $(GLSLANG_BUILD_INFO_H)
  130. LOCAL_MODULE:=SPIRV
  131. LOCAL_CXXFLAGS:=-std=c++17 -fno-exceptions -fno-rtti -Werror $(GLSLANG_DEFINES)
  132. LOCAL_SRC_FILES:=glslang/stub.cpp
  133. LOCAL_C_INCLUDES:=$(LOCAL_PATH)
  134. LOCAL_EXPORT_C_INCLUDES:=$(LOCAL_PATH)
  135. include $(BUILD_STATIC_LIBRARY)