mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-11-25 09:32:46 +00:00
rlottie/meson: refactor meson buildsystem
This commit is contained in:
parent
1c3098297e
commit
7792124c46
@ -1,4 +1,6 @@
|
|||||||
|
|
||||||
|
override_default = ['warning_level=2', 'werror=false']
|
||||||
|
|
||||||
common_source = files('evasapp.cpp')
|
common_source = files('evasapp.cpp')
|
||||||
common_source += files('lottieview.cpp')
|
common_source += files('lottieview.cpp')
|
||||||
|
|
||||||
@ -8,12 +10,13 @@ demo_sources += common_source
|
|||||||
executable('lottie2gif',
|
executable('lottie2gif',
|
||||||
'lottie2gif.cpp',
|
'lottie2gif.cpp',
|
||||||
include_directories : inc,
|
include_directories : inc,
|
||||||
|
override_options : override_default,
|
||||||
link_with : rlottie_lib)
|
link_with : rlottie_lib)
|
||||||
|
|
||||||
executable('vectorTest',
|
executable('vectorTest',
|
||||||
'vectortest.cpp',
|
'vectortest.cpp',
|
||||||
include_directories : inc,
|
include_directories : inc,
|
||||||
dependencies : [library_deps])
|
dependencies : [rlottie_dep])
|
||||||
|
|
||||||
demo_dep = dependency('elementary', required : false)
|
demo_dep = dependency('elementary', required : false)
|
||||||
|
|
||||||
@ -21,6 +24,7 @@ if (demo_dep.found())
|
|||||||
executable('demo',
|
executable('demo',
|
||||||
demo_sources,
|
demo_sources,
|
||||||
include_directories : inc,
|
include_directories : inc,
|
||||||
|
override_options : override_default,
|
||||||
link_with : rlottie_lib,
|
link_with : rlottie_lib,
|
||||||
dependencies : demo_dep)
|
dependencies : demo_dep)
|
||||||
|
|
||||||
@ -30,6 +34,7 @@ if (demo_dep.found())
|
|||||||
executable('lottieviewTest',
|
executable('lottieviewTest',
|
||||||
lottieview_test_src,
|
lottieview_test_src,
|
||||||
include_directories : inc,
|
include_directories : inc,
|
||||||
|
override_options : override_default,
|
||||||
link_with : rlottie_lib,
|
link_with : rlottie_lib,
|
||||||
dependencies : demo_dep)
|
dependencies : demo_dep)
|
||||||
|
|
||||||
@ -39,6 +44,7 @@ if (demo_dep.found())
|
|||||||
executable('uxsampleTest',
|
executable('uxsampleTest',
|
||||||
uxsample_test_src,
|
uxsample_test_src,
|
||||||
include_directories : inc,
|
include_directories : inc,
|
||||||
|
override_options : override_default,
|
||||||
link_with : rlottie_lib,
|
link_with : rlottie_lib,
|
||||||
dependencies : demo_dep)
|
dependencies : demo_dep)
|
||||||
|
|
||||||
@ -48,6 +54,7 @@ if (demo_dep.found())
|
|||||||
executable('lottieviewer',
|
executable('lottieviewer',
|
||||||
lottieviewer_sources,
|
lottieviewer_sources,
|
||||||
include_directories : inc,
|
include_directories : inc,
|
||||||
|
override_options : override_default,
|
||||||
link_with : rlottie_lib,
|
link_with : rlottie_lib,
|
||||||
dependencies : demo_dep)
|
dependencies : demo_dep)
|
||||||
|
|
||||||
@ -56,6 +63,7 @@ if (meson.get_compiler('cpp').has_header('elementary-1/efl_ui_animation_view.h')
|
|||||||
'efl_animview.cpp',
|
'efl_animview.cpp',
|
||||||
include_directories : inc,
|
include_directories : inc,
|
||||||
link_with : rlottie_lib,
|
link_with : rlottie_lib,
|
||||||
|
override_options : override_default,
|
||||||
dependencies : demo_dep)
|
dependencies : demo_dep)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|||||||
31
meson.build
31
meson.build
@ -1,30 +1,11 @@
|
|||||||
project('rlottie',
|
project('rlottie',
|
||||||
'cpp',
|
'cpp',
|
||||||
default_options : ['warning_level=2', 'werror=true', 'cpp_std=c++14', 'optimization=s'],
|
default_options : ['warning_level=3', 'werror=true', 'cpp_std=c++14', 'optimization=s'],
|
||||||
version : '0.0.1',
|
version : '0.0.1',
|
||||||
license : 'Apache')
|
license : 'Apache')
|
||||||
|
|
||||||
add_project_arguments('-DDEMO_DIR="@0@/example/resource/"'.format(meson.current_source_dir()), language : 'cpp')
|
add_project_arguments('-DDEMO_DIR="@0@/example/resource/"'.format(meson.current_source_dir()), language : 'cpp')
|
||||||
|
add_project_arguments('-DLOT_BUILD', language: 'cpp')
|
||||||
compiler_flags = ['-DLOT_BUILD']
|
|
||||||
compiler_flags_try = ['-fno-exceptions', '-fno-rtti',
|
|
||||||
'-fno-unwind-tables' , '-fno-asynchronous-unwind-tables',
|
|
||||||
'-Woverloaded-virtual', '-Wno-unused-parameter']
|
|
||||||
|
|
||||||
cc = meson.get_compiler('cpp')
|
|
||||||
foreach cf: compiler_flags_try
|
|
||||||
if cc.has_argument(cf) == true
|
|
||||||
compiler_flags += cf
|
|
||||||
endif
|
|
||||||
endforeach
|
|
||||||
|
|
||||||
|
|
||||||
if (build_machine.system() == 'linux' and get_option('thread') == true)
|
|
||||||
compiler_flags += ['-pthread']
|
|
||||||
add_project_link_arguments('-pthread', language: 'cpp')
|
|
||||||
endif
|
|
||||||
|
|
||||||
add_project_arguments(compiler_flags, language: 'cpp')
|
|
||||||
|
|
||||||
inc = [include_directories('inc')]
|
inc = [include_directories('inc')]
|
||||||
config_dir = include_directories('.')
|
config_dir = include_directories('.')
|
||||||
@ -71,11 +52,3 @@ if get_option('test') == true
|
|||||||
subdir('test')
|
subdir('test')
|
||||||
endif
|
endif
|
||||||
|
|
||||||
pkg_mod = import('pkgconfig')
|
|
||||||
|
|
||||||
pkg_mod.generate( libraries : rlottie_lib,
|
|
||||||
version : meson.project_version(),
|
|
||||||
name : 'librlottie',
|
|
||||||
filebase : 'rlottie',
|
|
||||||
description : 'A Library for rendering lottie files.'
|
|
||||||
)
|
|
||||||
|
|||||||
@ -1,12 +1,13 @@
|
|||||||
|
|
||||||
source_file = files('lottieparser.cpp')
|
source_file = [
|
||||||
source_file += files('lottieloader.cpp')
|
'lottieparser.cpp',
|
||||||
source_file += files('lottiemodel.cpp')
|
'lottieloader.cpp',
|
||||||
source_file += files('lottieproxymodel.cpp')
|
'lottiemodel.cpp',
|
||||||
source_file += files('lottieanimation.cpp')
|
'lottieproxymodel.cpp',
|
||||||
source_file += files('lottieitem.cpp')
|
'lottieanimation.cpp',
|
||||||
source_file += files('lottiekeypath.cpp')
|
'lottieitem.cpp',
|
||||||
|
'lottiekeypath.cpp'
|
||||||
|
]
|
||||||
|
|
||||||
lottie_dep = declare_dependency(
|
lottie_dep = declare_dependency(
|
||||||
include_directories : include_directories('.'),
|
include_directories : include_directories('.'),
|
||||||
|
|||||||
@ -1,15 +1,31 @@
|
|||||||
|
cc = meson.get_compiler('cpp')
|
||||||
|
|
||||||
|
if (cc.get_id() != 'msvc')
|
||||||
|
compiler_flags = ['-fno-exceptions', '-fno-rtti',
|
||||||
|
'-fno-unwind-tables' , '-fno-asynchronous-unwind-tables',
|
||||||
|
'-Woverloaded-virtual', '-Wno-unused-parameter']
|
||||||
|
endif
|
||||||
|
|
||||||
subdir('vector')
|
subdir('vector')
|
||||||
subdir('lottie')
|
subdir('lottie')
|
||||||
subdir('binding')
|
subdir('binding')
|
||||||
|
|
||||||
library_deps = vector_dep
|
rlottie_dep = [ vector_dep, lottie_dep, binding_dep, dependency('threads')]
|
||||||
library_deps += lottie_dep
|
|
||||||
library_deps += binding_dep
|
|
||||||
|
|
||||||
rlottie_lib = shared_library('rlottie',
|
rlottie_lib = shared_library('rlottie',
|
||||||
include_directories : inc,
|
include_directories : inc,
|
||||||
version : meson.project_version(),
|
version : meson.project_version(),
|
||||||
dependencies : library_deps,
|
dependencies : rlottie_dep,
|
||||||
install : true,
|
install : true,
|
||||||
|
cpp_args : compiler_flags,
|
||||||
gnu_symbol_visibility : 'hidden',
|
gnu_symbol_visibility : 'hidden',
|
||||||
)
|
)
|
||||||
|
|
||||||
|
pkg_mod = import('pkgconfig')
|
||||||
|
|
||||||
|
pkg_mod.generate( libraries : rlottie_lib,
|
||||||
|
version : meson.project_version(),
|
||||||
|
name : 'librlottie',
|
||||||
|
filebase : 'rlottie',
|
||||||
|
description : 'A Library for rendering lottie files.'
|
||||||
|
)
|
||||||
|
|||||||
@ -1,8 +1,9 @@
|
|||||||
|
|
||||||
source_file = files('v_ft_math.cpp')
|
source_file = [
|
||||||
source_file += files('v_ft_raster.cpp')
|
'v_ft_math.cpp',
|
||||||
source_file += files('v_ft_stroker.cpp')
|
'v_ft_raster.cpp',
|
||||||
|
'v_ft_stroker.cpp',
|
||||||
|
]
|
||||||
|
|
||||||
freetype_dep = declare_dependency(
|
freetype_dep = declare_dependency(
|
||||||
include_directories : include_directories('.'),
|
include_directories : include_directories('.'),
|
||||||
|
|||||||
@ -3,38 +3,32 @@ subdir('freetype')
|
|||||||
subdir('pixman')
|
subdir('pixman')
|
||||||
subdir('stb')
|
subdir('stb')
|
||||||
|
|
||||||
vector_dep = [freetype_dep]
|
source_file = [
|
||||||
vector_dep += pixman_dep
|
'vdasher.cpp',
|
||||||
vector_dep += stb_dep
|
'vbrush.cpp',
|
||||||
|
'vbitmap.cpp',
|
||||||
|
'vpainter.cpp',
|
||||||
|
'vcompositionfunctions.cpp',
|
||||||
|
'vdrawhelper.cpp',
|
||||||
|
'vdrawhelper_sse2.cpp',
|
||||||
|
'vdrawhelper_neon.cpp',
|
||||||
|
'vdrawable.cpp',
|
||||||
|
'vrect.cpp',
|
||||||
|
'vrle.cpp',
|
||||||
|
'vpath.cpp',
|
||||||
|
'vpathmesure.cpp',
|
||||||
|
'vmatrix.cpp',
|
||||||
|
'velapsedtimer.cpp',
|
||||||
|
'vdebug.cpp',
|
||||||
|
'vinterpolator.cpp',
|
||||||
|
'vbezier.cpp',
|
||||||
|
'vraster.cpp',
|
||||||
|
'vimageloader.cpp',
|
||||||
|
]
|
||||||
|
|
||||||
|
vector_dep = declare_dependency( include_directories : include_directories('.'),
|
||||||
source_file = files('vdasher.cpp')
|
sources : source_file,
|
||||||
source_file += files('vbrush.cpp')
|
dependencies : [freetype_dep, pixman_dep, stb_dep],
|
||||||
source_file += files('vbitmap.cpp')
|
|
||||||
source_file += files('vpainter.cpp')
|
|
||||||
source_file += files('vcompositionfunctions.cpp')
|
|
||||||
source_file += files('vdrawhelper.cpp')
|
|
||||||
source_file += files('vdrawhelper_sse2.cpp')
|
|
||||||
source_file += files('vdrawhelper_neon.cpp')
|
|
||||||
source_file += files('vdrawable.cpp')
|
|
||||||
|
|
||||||
source_file += files('vrect.cpp')
|
|
||||||
source_file += files('vrle.cpp')
|
|
||||||
source_file += files('vpath.cpp')
|
|
||||||
source_file += files('vpathmesure.cpp')
|
|
||||||
source_file += files('vmatrix.cpp')
|
|
||||||
source_file += files('velapsedtimer.cpp')
|
|
||||||
source_file += files('vdebug.cpp')
|
|
||||||
source_file += files('vinterpolator.cpp')
|
|
||||||
source_file += files('vbezier.cpp')
|
|
||||||
source_file += files('vraster.cpp')
|
|
||||||
source_file += files('vimageloader.cpp')
|
|
||||||
|
|
||||||
inc_dir = [include_directories('.')]
|
|
||||||
inc_dir += config_dir
|
|
||||||
|
|
||||||
vector_dep += declare_dependency( include_directories : inc_dir,
|
|
||||||
sources : source_file
|
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -1,8 +1,8 @@
|
|||||||
|
|
||||||
source_file = files('vregion.cpp')
|
source_file = ['vregion.cpp']
|
||||||
|
|
||||||
if host_machine.cpu_family() == 'arm' or host_machine.cpu_family() == 'aarch64'
|
if host_machine.cpu_family() == 'arm' or host_machine.cpu_family() == 'aarch64'
|
||||||
source_file += files('pixman-arm-neon-asm.S')
|
source_file += 'pixman-arm-neon-asm.S'
|
||||||
endif
|
endif
|
||||||
|
|
||||||
pixman_dep = declare_dependency(
|
pixman_dep = declare_dependency(
|
||||||
|
|||||||
@ -1,22 +1,17 @@
|
|||||||
|
|
||||||
source_file = ['stb_image.cpp']
|
source_file = ['stb_image.cpp']
|
||||||
|
|
||||||
inc_dir = [include_directories('.')]
|
|
||||||
inc_dir += config_dir
|
|
||||||
|
|
||||||
if get_option('module') == true
|
if get_option('module') == true
|
||||||
rlottie_image_loader_lib = shared_library('rlottie-image-loader',
|
rlottie_image_loader_lib = shared_library('rlottie-image-loader',
|
||||||
source_file,
|
source_file,
|
||||||
include_directories : inc_dir,
|
include_directories : [include_directories('.'), config_dir],
|
||||||
install : true,
|
install : true,
|
||||||
gnu_symbol_visibility : 'hidden',
|
gnu_symbol_visibility : 'hidden',
|
||||||
)
|
)
|
||||||
# dl dependancy for dlopen, dlsym, dlclose symbol
|
|
||||||
cc = meson.get_compiler('cpp')
|
cc = meson.get_compiler('cpp')
|
||||||
stb_dep = cc.find_library('dl', required : false)
|
stb_dep = cc.find_library('dl', required : false)
|
||||||
else
|
else
|
||||||
stb_dep = declare_dependency(
|
stb_dep = declare_dependency( include_directories : include_directories('.'),
|
||||||
include_directories : inc_dir,
|
|
||||||
sources : source_file
|
sources : source_file
|
||||||
)
|
)
|
||||||
endif
|
endif
|
||||||
|
|||||||
@ -1,25 +1,35 @@
|
|||||||
|
|
||||||
vector_test_sources = files('testsuite.cpp')
|
override_default = ['warning_level=2', 'werror=false']
|
||||||
vector_test_sources += files('test_vpath.cpp')
|
|
||||||
|
|
||||||
gtest_dep = dependency('gtest')
|
gtest_dep = dependency('gtest')
|
||||||
|
|
||||||
|
vector_test_sources = [
|
||||||
|
'testsuite.cpp',
|
||||||
|
'test_vpath.cpp',
|
||||||
|
]
|
||||||
|
|
||||||
vector_testsuite = executable('vectorTestSuite',
|
vector_testsuite = executable('vectorTestSuite',
|
||||||
vector_test_sources,
|
vector_test_sources,
|
||||||
include_directories : inc,
|
include_directories : inc,
|
||||||
dependencies : [gtest_dep, library_deps])
|
override_options : override_default,
|
||||||
|
dependencies : [gtest_dep, rlottie_dep],
|
||||||
|
)
|
||||||
|
|
||||||
test('Vector Testsuite', vector_testsuite)
|
test('Vector Testsuite', vector_testsuite)
|
||||||
|
|
||||||
|
|
||||||
animation_test_sources = files('testsuite.cpp')
|
animation_test_sources = [
|
||||||
animation_test_sources += files('test_lottieanimation.cpp')
|
'testsuite.cpp',
|
||||||
animation_test_sources += files('test_lottieanimation_capi.cpp')
|
'test_lottieanimation.cpp',
|
||||||
|
'test_lottieanimation_capi.cpp'
|
||||||
|
]
|
||||||
|
|
||||||
animation_testsuite = executable('animationTestSuite',
|
animation_testsuite = executable('animationTestSuite',
|
||||||
animation_test_sources,
|
animation_test_sources,
|
||||||
include_directories : inc,
|
include_directories : inc,
|
||||||
|
override_options : override_default,
|
||||||
link_with : rlottie_lib,
|
link_with : rlottie_lib,
|
||||||
dependencies : gtest_dep)
|
dependencies : gtest_dep,
|
||||||
|
)
|
||||||
|
|
||||||
test('Animation Testsuite', animation_testsuite)
|
test('Animation Testsuite', animation_testsuite)
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
#include <gtest/gtest.h>
|
#include <gtest/gtest.h>
|
||||||
#include "lottieanimation_capi.h"
|
#include "rlottie_capi.h"
|
||||||
|
|
||||||
class AnimationCApiTest : public ::testing::Test {
|
class AnimationCApiTest : public ::testing::Test {
|
||||||
public:
|
public:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user