define LOT_BUILD only for DLL

This commit is contained in:
Vincent Torri 2019-07-12 07:08:13 +02:00 committed by Subhransu
parent 15e715103d
commit a0f0f3c4cc
5 changed files with 20 additions and 2 deletions

View File

@ -23,6 +23,10 @@
#include <vector>
#include <memory>
#ifdef LOT_EXPORT
#undef LOT_EXPORT
#endif
#if defined _WIN32 || defined __CYGWIN__
#ifdef LOT_BUILD
#define LOT_EXPORT __declspec(dllexport)
@ -451,4 +455,7 @@ template<> struct MapType<std::integral_constant<Property, Property::TrScale>>:
} // namespace lotplayer
#undef LOT_EXPORT
#define LOT_EXPORT
#endif // _RLOTTIE_H_

View File

@ -19,6 +19,10 @@
#ifndef _RLOTTIE_COMMON_H_
#define _RLOTTIE_COMMON_H_
#ifdef LOT_EXPORT
#undef LOT_EXPORT
#endif
#if defined _WIN32 || defined __CYGWIN__
#ifdef LOT_BUILD
#define LOT_EXPORT __declspec(dllexport)
@ -226,4 +230,7 @@ typedef struct LOTLayerNode {
* @}
*/
#undef LOT_EXPORT
#define LOT_EXPORT
#endif // _RLOTTIE_COMMON_H_

View File

@ -5,7 +5,6 @@ project('rlottie',
license : 'Apache')
add_project_arguments('-DDEMO_DIR="@0@/example/resource/"'.format(meson.current_source_dir()), language : 'cpp')
add_project_arguments('-DLOT_BUILD', language: 'cpp')
inc = [include_directories('inc')]
config_dir = include_directories('.')

View File

@ -1,5 +1,5 @@
cc = meson.get_compiler('cpp')
compiler_flags =[]
compiler_flags = []
if (cc.get_id() != 'msvc')
compiler_flags = ['-fno-exceptions', '-fno-rtti',
'-fno-unwind-tables' , '-fno-asynchronous-unwind-tables',
@ -10,6 +10,8 @@ subdir('vector')
subdir('lottie')
subdir('binding')
compiler_flags += ['-DLOT_BUILD=1']
rlottie_lib_dep = [ vector_dep, lottie_dep, binding_dep, dependency('threads')]
rlottie_lib = shared_library('rlottie',

View File

@ -1,11 +1,14 @@
source_file = ['stb_image.cpp']
compiler_flags = ['-DLOT_BUILD=1']
if get_option('module') == true
rlottie_image_loader_lib = shared_library('rlottie-image-loader',
source_file,
include_directories : [include_directories('.'), config_dir],
install : true,
cpp_args : compiler_flags,
gnu_symbol_visibility : 'hidden',
)
cc = meson.get_compiler('cpp')