summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/djinterop/config.hpp.in9
-rw-r--r--include/djinterop/meson.build3
2 files changed, 12 insertions, 0 deletions
diff --git a/include/djinterop/config.hpp.in b/include/djinterop/config.hpp.in
index b558501..4783904 100644
--- a/include/djinterop/config.hpp.in
+++ b/include/djinterop/config.hpp.in
@@ -23,10 +23,19 @@
#error This library needs at least a C++17 compliant compiler
#endif
+// Statement about whether the library was built/installed as static or shared.
+#cmakedefine DJINTEROP_STATIC
+
#if defined _WIN32 || defined __CYGWIN__
+#if defined DJINTEROP_STATIC
+#define DJINTEROP_SYMBOL_IMPORT
+#define DJINTEROP_SYMBOL_EXPORT
+#define DJINTEROP_SYMBOL_LOCAL
+#else
#define DJINTEROP_SYMBOL_IMPORT __declspec(dllimport)
#define DJINTEROP_SYMBOL_EXPORT __declspec(dllexport)
#define DJINTEROP_SYMBOL_LOCAL
+#endif
#else
#if __GNUC__ >= 4
#define DJINTEROP_SYMBOL_IMPORT __attribute__((visibility("default")))
diff --git a/include/djinterop/meson.build b/include/djinterop/meson.build
index c43a0b2..1ec6646 100644
--- a/include/djinterop/meson.build
+++ b/include/djinterop/meson.build
@@ -4,6 +4,9 @@
# of configure_file() does not, at the time of writing (meson 0.55.0), support
# writing the output file to a different directory.
conf_data = configuration_data()
+if default_library_type == 'static'
+ conf_data.set10('DJINTEROP_STATIC', true)
+endif
if cpp_compiler.has_header('optional')
conf_data.set10('DJINTEROP_STD_OPTIONAL', true)
endif