static_export.patch 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. diff --git a/include/dpp/export.h b/include/dpp/export.h
  2. index b7b35b5..838f79d 100644
  3. --- a/include/dpp/export.h
  4. +++ b/include/dpp/export.h
  5. @@ -24,25 +24,29 @@
  6. // Investigate: MSVC doesn't like this
  7. //static_assert(__cplusplus >= 201703L, "D++ Requires a C++17 compatible compiler. Please ensure that you have enabled C++17 in your compiler flags.");
  8. -#ifdef DPP_BUILD
  9. +#ifndef DPP_STATIC
  10. - #ifdef _WIN32
  11. - #include <dpp/win32_safe_warnings.h>
  12. - #endif
  13. + #ifdef DPP_BUILD
  14. +
  15. + #ifdef _WIN32
  16. + #include <dpp/win32_safe_warnings.h>
  17. + #endif
  18. - #ifdef _WIN32
  19. - #define DPP_EXPORT __declspec(dllexport)
  20. + #ifdef _WIN32
  21. + #define DPP_EXPORT __declspec(dllexport)
  22. + #else
  23. + #define DPP_EXPORT
  24. + #endif
  25. #else
  26. - #define DPP_EXPORT
  27. + #ifdef _WIN32
  28. + #define DPP_EXPORT __declspec(dllimport)
  29. + #else
  30. + #define DPP_EXPORT
  31. + #endif
  32. #endif
  33. +
  34. #else
  35. - #ifdef _WIN32
  36. - #define DPP_EXPORT __declspec(dllimport)
  37. - /* This is required otherwise fmt::format requires additional file linkage to your project */
  38. - #define FMT_HEADER_ONLY
  39. - #else
  40. - #define DPP_EXPORT
  41. - #endif
  42. + #define DPP_EXPORT
  43. #endif
  44. #ifndef _WIN32