File tree Expand file tree Collapse file tree 2 files changed +12
-0
lines changed Expand file tree Collapse file tree 2 files changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -23,10 +23,16 @@ subdir('src')
2323
2424subdir (' tools' )
2525
26+ c_args = [
27+ ' -DOOPETRIS_LIBRARY_C_WRAPPER_TYPE='
28+ + (get_option (' default_library' ) == ' static' ? ' 1' : ' 0' ),
29+ ]
30+
2631liboopetris_c_wrapper = library (
2732 ' oopetris_c_wrapper' ,
2833 src_files,
2934 dependencies : deps,
35+ cpp_args : c_args,
3036 cpp_shared_args : [' -DOOPETRIS_LIBRARY_C_WRAPPER_EXPORT' ],
3137 override_options : {
3238 ' warning_level' : ' 3' ,
@@ -40,6 +46,7 @@ liboopetris_c_wrapper_dep = declare_dependency(
4046 link_with : liboopetris_c_wrapper,
4147 dependencies : deps,
4248 version : meson .project_version(),
49+ compile_args : c_args,
4350 include_directories : include_directories (' src' ),
4451)
4552meson .override_dependency(' liboopetris-c-wrapper' , liboopetris_c_wrapper_dep)
@@ -60,6 +67,7 @@ pkg.generate(
6067 name : ' oopetris-c-wrapper' ,
6168 filebase : ' oopetris-c-wrapper' ,
6269 subdirs : ' oopetris' ,
70+ extra_cflags : c_args,
6371 variables : [' compiler=' + pkg_cpp_compiler, ' cpp_stdlib=' + pkg_cpp_stdlib],
6472)
6573
Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ extern "C" {
66
77
88#if defined(_MSC_VER )
9+ #if defined(OOPETRIS_LIBRARY_C_WRAPPER_TYPE ) && OOPETRIS_LIBRARY_C_WRAPPER_TYPE == 0
910#if defined(OOPETRIS_LIBRARY_C_WRAPPER_EXPORT )
1011#define OOPETRIS_C_WRAPPER_EXPORTED __declspec(dllexport)
1112#else
@@ -14,6 +15,9 @@ extern "C" {
1415#else
1516#define OOPETRIS_C_WRAPPER_EXPORTED
1617#endif
18+ #else
19+ #define OOPETRIS_C_WRAPPER_EXPORTED
20+ #endif
1721
1822
1923#ifdef __cplusplus
You can’t perform that action at this time.
0 commit comments