freetype: cherry pick optimization patches from freetype.
[platform/core/uifw/lottie-player.git] / meson.build
1 project('rlottie',
2         'cpp',
3         default_options : ['warning_level=3', 'werror=true', 'cpp_std=c++14', 'optimization=s'],
4         version : '0.1',
5         license : 'LGPL-v2.1',
6         meson_version : '>=0.49',
7         )
8
9 add_project_arguments('-DDEMO_DIR="@0@/example/resource/"'.format(meson.current_source_dir()), language : 'cpp')
10
11 inc = [include_directories('inc')]
12 config_dir = include_directories('.')
13 inc += config_dir
14
15 config_h = configuration_data()
16
17 if get_option('thread') == true
18     config_h.set10('LOTTIE_THREAD_SUPPORT', true)
19 else
20     config_h.set('thread_local', true)
21 endif
22
23 if get_option('module') == true
24     config_h.set10('LOTTIE_IMAGE_MODULE_SUPPORT', true)
25
26     if meson.get_compiler('cpp').get_id() != 'msvc'
27       lib_prefix = 'lib'
28     else
29       lib_prefix = ''
30     endif
31     if host_machine.system() == 'darwin'
32       lib_suffix = '.dylib'
33     elif host_machine.system() == 'windows'
34       lib_suffix = '.dll'
35     else
36       lib_suffix = '.so'
37     endif
38     if get_option('moduledir') != ''
39       config_h.set_quoted('LOTTIE_IMAGE_MODULE_PLUGIN',
40         get_option('prefix') / get_option('moduledir') / lib_prefix + 'rlottie-image-loader' + lib_suffix)
41     else
42       config_h.set_quoted('LOTTIE_IMAGE_MODULE_PLUGIN', lib_prefix + 'rlottie-image-loader' + lib_suffix)
43     endif
44 endif
45
46 if get_option('cache') == true
47     config_h.set10('LOTTIE_CACHE_SUPPORT', true)
48 endif
49
50 if get_option('log') == true
51     config_h.set10('LOTTIE_LOGGING_SUPPORT', true)
52 endif
53
54 if get_option('dumptree') == true
55     config_h.set10('LOTTIE_LOGGING_SUPPORT', true)
56     config_h.set10('LOTTIE_DUMP_TREE_SUPPORT', true)
57 endif
58
59
60 configure_file(
61   output: 'config.h',
62   configuration: config_h
63 )
64
65
66 subdir('inc')
67 subdir('src')
68
69 if get_option('example') == true
70     subdir('example')
71 endif
72
73 if get_option('test') == true
74    subdir('test')
75 endif
76
77
78 if get_option('cmake') == true and host_machine.system() != 'windows'
79     cmake_bin = find_program('cmake', required: false)
80     if cmake_bin.found()
81         cmake = import('cmake')
82         cmake.write_basic_package_version_file(
83             version: meson.project_version(),
84             name: 'rlottie',
85         )
86
87         cmakeconf = configuration_data()
88         cmakeconf.set('VERSION', meson.project_version())
89
90         cmake.configure_package_config_file(
91             input: meson.current_source_dir() + '/cmake/rlottieConfig.cmake.in',
92             name: 'rlottie',
93             configuration: cmakeconf,
94         )
95     endif
96 endif
97
98 summary = '''
99
100 Summary:
101     rlottie version :        @0@
102     Build type      :        @1@
103     Thread Support  :        @2@
104     Module Support  :        @3@
105     Cache  Support  :        @4@
106     Example         :        @5@
107     Test            :        @6@
108     Prefix          :        @7@
109 '''.format(
110         meson.project_version(),
111         get_option('buildtype'),
112         get_option('thread'),
113         get_option('module'),
114         get_option('cache'),
115         get_option('example'),
116         get_option('test'),
117         get_option('prefix'),
118     )
119
120 message(summary)
121
122
123