summaryrefslogtreecommitdiff
path: root/src/lib/evas/meson.build
blob: d923cee0df3c19d447d51bdd0f7cdcead0fad112 (plain) (blame)
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
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
# README
#
# All those stages are defining dependencies with theire source code
# as 'source :', later everything is build as libevas.so.
#

png = dependency('libpng')
tiff = dependency('libtiff-4', required: get_option('evas-loaders-disabler').contains('tiff') == false)
giflib = cc.find_library('gif')
webp = dependency('libwebp', required: get_option('evas-loaders-disabler').contains('webp') == false)
libopenjp2 = dependency('libopenjp2', required: get_option('evas-loaders-disabler').contains('jp2k') == false)

evas_image_loaders_file = [
     ['bmp',     'shared', []],
     ['eet',     'static', [eet]],
     ['generic', 'shared', [rt]],
     ['gif',     'shared', [giflib]],
     ['ico',     'shared', []],
     ['jpeg',    'static', [jpeg]],
     ['jp2k',    'shared', [libopenjp2]],
     ['pmaps',   'shared', []],
     ['png',     'static', [png]],
     ['psd',     'shared', []],
     ['tga',     'shared', []],
     ['tgv',     'shared', [rg_etc, lz4]],
     ['tiff',    'shared', [tiff]],
     ['wbmp',    'shared', []],
     ['webp',    'shared', [webp]],
     ['xpm',     'shared', []]
]

evas_image_savers_file = [
     ['eet',     'static', [eet]],
     ['jpeg',    'static', [jpeg]],
     ['png',     'static', [png]],
     ['tgv',     'shared', [rg_etc, lz4]],
     ['tiff',    'shared', [tiff]],
     ['webp',    'shared', [webp]],
]
json = dependency('rlottie', required: get_option('evas-loaders-disabler').contains('json') == false)

evas_vg_loaders_file = [
  ['eet', [eet]],
  ['json', [json]],
  ['svg', []],
]

evas_vg_savers_file = ['eet', 'svg']

rel_evas_modules = join_paths('..', '..', '..', 'modules', 'evas', 'engines', 'software_generic')
evas_deps = [eo, eet, eina, efl, emile, ector, ecore, draw, buildsystem]
evas_ext_deps = [buildsystem_simple, intl, m, draw_simple, valgrind, libunibreak, lua, vg_common]

pub_eo_file_target = []
priv_eo_files = []
evas_include_directories = []
pub_eo_files = []
pub_evas_eo_files = []
pub_evas_eot_files = []

pub_legacy_eo_files = [

]
evas_src = []

subdir('software_generic')

foreach eo_file : pub_legacy_eo_files
  pub_eo_file_target += custom_target('eolian_gen_' + eo_file,
    input : eo_file,
    output : [eo_file + '.h'],
    depfile : eo_file + '.d',
    install : true,
    install_dir : dir_package_include,
    command : eolian_gen + [ '-I', meson.current_source_dir(), eolian_include_directories,
                           '-o', 'h:' + join_paths(meson.current_build_dir(), eo_file + '.h'),
                           '-o', 'c:' + join_paths(meson.current_build_dir(), eo_file + '.c'),
                           '-o', 'd:' + join_paths(meson.current_build_dir(), eo_file + '.d'),
                           '-gchd', '@INPUT@'])
endforeach

foreach eo_file : pub_eo_files
  pub_eo_file_target += custom_target('eolian_gen_' + eo_file.underscorify(),
    input : eo_file,
    output : [eo_file.underscorify() + '.h'],
    depfile : eo_file.underscorify() + '.d',
    install : true,
    install_dir : dir_package_include,
    command : eolian_gen + [ '-I', meson.current_source_dir(), eolian_include_directories,
                           '-o', 'h:' + join_paths(meson.current_build_dir(), eo_file + '.h'),
                           '-o', 'c:' + join_paths(meson.current_build_dir(), eo_file + '.c'),
                           '-o', 'd:' + join_paths(meson.current_build_dir(), eo_file + '.d'),
                           '-gchd', '@INPUT@'])
endforeach


pub_eo_types_files = [

]

foreach eo_file : pub_eo_types_files
  pub_eo_file_target += custom_target('eolian_gen_' + eo_file,
    input : eo_file,
    output : [eo_file + '.h'],
    depfile : eo_file + '.d',
    install : true,
    install_dir : dir_package_include,
    command : eolian_gen + [ '-I', meson.current_source_dir(), eolian_include_directories,
                           '-o', 'h:' + join_paths(meson.current_build_dir(), eo_file + '.h'),
                           '-o', 'd:' + join_paths(meson.current_build_dir(), eo_file + '.d'),
                           '-ghd', '@INPUT@'])
endforeach

eolian_include_directories += ['-I', meson.current_source_dir()]

evas_src += pub_eo_file_target

evas_header_src = [
  'Evas.h',
  'Evas_Common.h',
  'Evas_Eo.h',
  'Evas_GL.h',
  'Evas_Legacy.h',
  'Evas_Loader.h',
  'Efl_Canvas.h',
]

evas_include_directories += [
  include_directories('.'),
  include_directories('common'),
  include_directories('include'),
  include_directories('filters'),
]

evas_src += files([
   'main.c'
])

evas_src_opt = [ ]

evas_ext_deps += dependency('freetype2')

if (get_option('fontconfig'))
   config_h.set('HAVE_FONTCONFIG', '1')
   evas_ext_deps += dependency('fontconfig')
endif

if (get_option('fribidi'))
   config_h.set('HAVE_FRIBIDI', '1')
   evas_ext_deps += dependency('fribidi')
endif

if (get_option('pixman'))
   pixman_support = ['HAVE_PIXMAN', 'PIXMAN_FONT', 'PIXMAN_RECT', 'PIXMAN_LINE', 'PIXMAN_POLY', 'PIXMAN_IMAGE', 'PIXMAN_IMAGE_SCALE_SAMPLE']
   foreach support : pixman_support
     config_h.set(support, '1')
   endforeach
   evas_ext_deps += dependency('pixman-1')
endif

if (get_option('hyphen'))
   config_h.set('HAVE_HYPHEN', '1')
   hyphen = dependency('hyphen', required : false)
   if hyphen.found() == false
     evas_ext_deps += cc.find_library('hyphen')
   endif
   evas_ext_deps += hyphen
   config_h.set_quoted('EVAS_DICTS_HYPHEN_DIR', get_option('dictionaries-hyphen-dir'))
endif

subdir('include')
subdir('common')
subdir('canvas')
subdir('gesture')
subdir('filters')
subdir('cache')
subdir('file')
subdir('vg')

gl_deps = []

if get_option('harfbuzz')
  evas_ext_deps += dependency('harfbuzz')
  config_h.set('HAVE_HARFBUZZ', '1')
endif

if get_option('wl')
  evas_ext_deps += wayland_protocol
endif


if get_option('opengl') != 'none'
  if get_option('opengl') == 'es-egl'
    config_h.set('GL_GLES', '1')
    gl_deps += dependency('glesv2')
    gl_deps += dependency('egl')
  else
    gl_deps += dependency('gl')
  endif
endif

evas_link = [ ]
evas_pub_deps = [eina, ecore, ector, emile]

if cpu_sse3 == true or cpu_neon == true and cpu_neon_intrinsics == false
  evas_opt = static_library('evas_opt',
    sources: evas_src_opt,
    include_directories:
      [ include_directories('../../..') ] +
      evas_include_directories +
      [vg_common_inc_dir],
    c_args: native_arch_opt_c_args,
    dependencies: [eina, eo, ector, emile, evas_deps, evas_ext_deps],
  )
  evas_link += [ evas_opt ]
endif

foreach loader_inst : evas_image_loaders_file
  loader = loader_inst[0]
  loader_type = loader_inst[1]
  loader_deps = loader_inst[2]
  if get_option('evas-loaders-disabler').contains(loader) == false
    if loader_type == 'static'
      config_h.set('BUILD_LOADER_'+loader.to_upper(), '1')
      file = join_paths(meson.source_root(), 'src', 'modules', 'evas', 'image_loaders', loader, 'evas_image_load_'+loader+'.c')
      config_h.set('EVAS_STATIC_BUILD_'+loader.to_upper(), '1')
      evas_static_list += [declare_dependency(
        sources: file,
        dependencies: loader_deps,
      )]
    endif
  else
    message('Image loader '+loader+' disabled')
  endif
endforeach

foreach loader_inst : evas_image_savers_file
  loader = loader_inst[0]
  loader_type = loader_inst[1]
  loader_deps = loader_inst[2]
  if get_option('evas-loaders-disabler').contains(loader) == false
    if loader_type == 'static'
      config_h.set('BUILD_LOADER_'+loader.to_upper(), '1')
      file = join_paths(meson.source_root(), 'src', 'modules', 'evas', 'image_savers', loader, 'evas_image_save_'+loader+'.c')
      config_h.set('EVAS_STATIC_BUILD_'+loader.to_upper(), '1')
      evas_static_list += [declare_dependency(
        sources: file,
        dependencies: loader_deps,
      )]
    endif
  else
    message('Image saver '+loader+' disabled')
  endif
endforeach

foreach loader_inst : evas_vg_loaders_file
  loader = loader_inst[0]
  loader_deps = loader_inst[1]

  if (get_option('evas-loaders-disabler').contains(loader) == false)
    file = join_paths(meson.source_root(), 'src', 'modules', 'evas', 'vg_loaders', loader, 'evas_vg_load_'+loader+'.c')
    evas_static_list += [declare_dependency(
      sources: file,
      dependencies: loader_deps,
    )]
    config_h.set('EVAS_STATIC_BUILD_VG_'+loader.to_upper(), '1')
  endif
endforeach

foreach loader : evas_vg_savers_file
  if (get_option('evas-loaders-disabler').contains(loader) == false)
    file = join_paths(meson.source_root(), 'src', 'modules', 'evas', 'vg_savers', loader, 'evas_vg_save_'+loader+'.c')
    evas_static_list += [declare_dependency(
      sources: file,
      dependencies: [eo, ector, emile, freetype, eet],
    )]
    config_h.set('EVAS_STATIC_BUILD_VG_'+loader.to_upper(), '1')
  endif
endforeach

evas_ext_deps += evas_static_list

evas_ext_deps += declare_dependency(
  link_with: evas_link,
)

evas_lib = library('evas',
    include_directories: evas_include_directories + [vg_common_inc_dir],
    sources : [evas_src, pub_eo_file_target, priv_eo_file_target],
    dependencies: [evas_deps, evas_ext_deps],
    link_with: evas_link,
    install: true,
    c_args : package_c_args,
    version : meson.project_version()
)

evas = declare_dependency(
   link_with : [evas_lib],
   sources: pub_eo_file_target,
   dependencies : evas_pub_deps,
   include_directories: evas_include_directories + [vg_common_inc_dir] + [include_directories(join_paths('..', '..', 'modules', 'evas', 'engines', 'buffer'))],
)

evas_bin = declare_dependency(
   link_with : [evas_lib],
   dependencies : [eina, ecore, ector, emile],
   include_directories : evas_include_directories
)

if get_option('install-eo-files')
  install_data(pub_evas_eo_files + pub_evas_eot_files,
    install_dir: join_paths(eolian_include_dir, package_version_name)
  )
endif

install_headers(evas_header_src,
  install_dir : dir_package_include,
)

pub_eo_files = []
package_eo_subdirs += ['canvas', 'gesture']
package_header_subdirs += ['canvas', 'gesture']
#special case becase evas has a more structures subfolder
efl_one_include_dirs += evas_include_directories