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