examples: keep aspect ratio of svg images.
[platform/core/graphics/tizenvg.git] / meson.build
1 project('thorvg',
2         'cpp',
3         default_options : ['buildtype=debugoptimized', 'b_sanitize=none', 'werror=false', 'optimization=s', 'cpp_std=c++14'],
4         version : '0.8.99',
5         license : 'MIT')
6
7 config_h = configuration_data()
8
9 src_dir = '/'.join(meson.current_source_dir().split('\\'))
10 add_project_arguments('-DEXAMPLE_DIR="@0@/src/examples/images"'.format(src_dir),
11                       '-DTEST_DIR="@0@/test/images"'.format(src_dir),
12                       language : 'cpp')
13
14 config_h.set_quoted('THORVG_VERSION_STRING', meson.project_version())
15
16 if get_option('engines').contains('sw') == true
17     config_h.set10('THORVG_SW_RASTER_SUPPORT', true)
18 endif
19
20 if get_option('engines').contains('gl') == true
21     config_h.set10('THORVG_GL_RASTER_SUPPORT', true)
22 endif
23
24 all_loaders = false
25
26 if get_option('loaders').contains('all') == true
27     all_loaders = true
28 endif
29
30 if all_loaders or get_option('loaders').contains('svg') == true
31     config_h.set10('THORVG_SVG_LOADER_SUPPORT', true)
32 endif
33
34 if all_loaders or get_option('loaders').contains('tvg') == true
35     config_h.set10('THORVG_TVG_LOADER_SUPPORT', true)
36 endif
37
38 if all_loaders or get_option('loaders').contains('png') == true
39    config_h.set10('THORVG_PNG_LOADER_SUPPORT', true)
40 endif
41
42 if all_loaders or get_option('loaders').contains('jpg') == true
43     config_h.set10('THORVG_JPG_LOADER_SUPPORT', true)
44 endif
45
46 if get_option('savers').contains('tvg') == true
47     config_h.set10('THORVG_TVG_SAVER_SUPPORT', true)
48 endif
49
50 simd_type = 'none'
51
52 if get_option('vector') == true
53   if host_machine.cpu_family() == 'x86' or host_machine.cpu_family() == 'x86_64'
54     config_h.set10('THORVG_AVX_VECTOR_SUPPORT', true)
55     simd_type = 'avx'
56   elif host_machine.cpu_family() == 'arm'
57     config_h.set10('THORVG_NEON_VECTOR_SUPPORT', true)
58     simd_type = 'neon'
59   endif
60 endif
61
62 if get_option('bindings').contains('capi') == true
63     config_h.set10('THORVG_CAPI_BINDING_SUPPORT', true)
64 endif
65
66 if get_option('log') == true
67     config_h.set10('THORVG_LOG_ENABLED', true)
68 endif
69
70
71 all_tools = false
72
73 if get_option('tools').contains('all') == true
74     all_tools = true
75 endif
76
77
78 configure_file(
79     output: 'config.h',
80     configuration: config_h
81 )
82
83 headers = [include_directories('inc'), include_directories('.')]
84
85 subdir('inc')
86 subdir('src')
87
88 if get_option('tests') == true
89    subdir('test')
90 endif
91
92 summary = '''
93
94 Summary:
95     ThorVG version:        @0@
96     Build Type:            @1@
97     Prefix:                @2@
98     SIMD Instruction:      @3@
99     Raster Engine (SW):    @4@
100     Raster Engine (GL):    @5@
101     Loader (TVG):          @6@
102     Loader (SVG):          @7@
103     Loader (PNG):          @8@
104     Loader (JPG):          @9@
105     Saver (TVG):           @10@
106     CAPI Binding:          @11@
107     Log Message:           @12@
108     Tests:                 @13@
109     Examples:              @14@
110     Tool (Svg2Tvg):        @15@
111     Tool (Svg2Png):        @16@
112
113 '''.format(
114         meson.project_version(),
115         get_option('buildtype'),
116         get_option('prefix'),
117         simd_type,
118         get_option('engines').contains('sw'),
119         get_option('engines').contains('gl'),
120         all_loaders or get_option('loaders').contains('tvg'),
121         all_loaders or get_option('loaders').contains('svg'),
122         all_loaders or get_option('loaders').contains('png'),
123         all_loaders or get_option('loaders').contains('jpg'),
124         get_option('savers').contains('tvg'),
125         get_option('bindings').contains('capi'),
126         get_option('log'),
127         get_option('tests'),
128         get_option('examples'),
129         all_tools or get_option('tools').contains('svg2tvg'),
130         all_tools or get_option('tools').contains('svg2png'),
131     )
132
133 message(summary)