define LOT_BUILD only for DLL
authorVincent Torri <vincent.torri@gmail.com>
Fri, 12 Jul 2019 05:08:13 +0000 (07:08 +0200)
committerJunsuChoi <jsuya.choi@samsung.com>
Thu, 18 Jul 2019 11:04:28 +0000 (20:04 +0900)
inc/rlottie.h
inc/rlottiecommon.h
meson.build
src/meson.build
src/vector/stb/meson.build

index 0795615..6405986 100644 (file)
 #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_
index 8355de1..946f65d 100644 (file)
 #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_
index c4f49c8..99068f7 100644 (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('.')
index 87f927b..598ac5e 100644 (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',
index 5e8f670..327b1b1 100644 (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')