-
Notifications
You must be signed in to change notification settings - Fork 15
/
quark.gyp
executable file
·149 lines (144 loc) · 3.71 KB
/
quark.gyp
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
147
148
149
{
'includes': [
'src/util/util.gypi',
'src/src.gypi',
'src/js/js.gypi',
'trial/trial.gypi',
'tools/default_target.gypi',
],
'target_defaults': {
'direct_dependent_settings': {
'include_dirs': [ '.' ],
},
},
'variables': {
'quark_product_dir%': '<(output)/../qkmake/product',
'quark_product_so_subdir%': '<(os)/<(arch)',
'other_ldflags': [],
'conditions': [
['os=="android"', {
'quark_product_so_subdir': '<(os)/jniLibs/<(android_abi)'
}],
['library_output=="static_library"', {
'other_ldflags+': [
'-Wl,--whole-archive',
'<(output)/obj.target/libquark-util.a',
'<(output)/obj.target/libquark.a',
'<(output)/obj.target/libquark-js.a',
'<(output)/obj.target/libquark-media.a',
'-Wl,--no-whole-archive',
],
}],
],
},
############################################
# targets output
############################################
'targets': [{
'target_name': 'libquark',
'type': 'none',
'dependencies': [
'quark',
'quark-js',
'quark-media',
],
'conditions': [
# output mac shared library for "quark.framework"
['library_output=="shared_library" and OS=="mac" and project=="make"', {
'actions': [{
'action_name': 'mk_quark_dylib',
'variables': {
'embed_bitcode%': 0,
'use_v8_link%': 0,
'lib_v8_a%': [
'<(output)/libv8_base.a',
'<(output)/libv8_libbase.a',
'<(output)/libv8_libsampler.a',
'<(output)/libv8_builtins_setup.a',
'<(output)/libv8_nosnapshot.a',
'<(output)/libv8_libplatform.a',
],
'conditions': [
['arch in "arm arm64" and without_embed_bitcode==0', {
'embed_bitcode': 1,
}],
['use_v8==0 and os=="ios"', {
'use_v8_link': 1,
'lib_v8_a': [ '<(output)/libv8-link.a' ],
}],
],
},
'inputs': [
'tools/build_dylib.sh',
'<(output)/libuv.a',
'<(output)/libopenssl.a',
'<(output)/libhttp_parser.a',
'<(output)/libminizip.a',
'<(output)/libreachability.a',
'<(output)/libtess2.a',
'<(output)/libfreetype.a',
'<(output)/libtinyxml2.a',
'<(output)/obj.target/ffmpeg/libffmpeg.a',
'<(output)/libquark-utils.a',
'<(output)/libquark.a',
'<(output)/libquark-media.a',
'<(output)/libquark-js.a',
'<@(lib_v8_a)',
],
'outputs': [
'<(output)/libquark.dylib',
# '<(output)/libquark-media.dylib',
# '<(output)/libquark-js.dylib',
],
'action': [
'sh', '-c',
'tools/build_dylib.sh '
'<(output) <(embed_bitcode) <(use_v8_link) '
'<(arch_name) '
'<(sysroot) '
'<(version_min) '
],
# 'process_outputs_as_sources': 1,
}]
}],
# output not mac shared library for "libquark.so"
['library_output=="shared_library" and OS!="mac"', {
'product_name': 'quark', # libquark.so
'type': 'shared_library',
# 'product_prefix': 'quark',
# 'product_extension': 'so',
'copies': [{
'destination': '<(quark_product_dir)/<(quark_product_so_subdir)',
'files': [
'<(output)/lib.target/libquark.so',
'<(output)/lib.target/libquark-js.so',
'<(output)/lib.target/libquark-media.so',
],
}], # copy libquark.so to product directory
}],
], # conditions
}],
# output executed binrary
'conditions': [
['OS != "mac" or project=="xcode"', {
'includes': [ 'test/test.gypi' ],
}],
['os!="ios"', {
'targets+': [
{
'target_name': 'quarkrun',
'product_name': 'quark', # output name quark
'type': 'executable',
'dependencies': [
'quark',
'quark-js',
'quark-media',
],
'ldflags': [ '<@(other_ldflags)' ],
'sources': [
'src/js/main.cc',
], # sources
}],
}]
],
}