pineapple-src/externals/vcpkg/ports/mman/mman-static.patch

34 lines
742 B
Diff
Raw Normal View History

2022-07-23 03:01:36 +02:00
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 4696ad4..a72bbce 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -8,6 +8,10 @@ option (BUILD_TESTS "tests?" OFF)
set (headers mman.h)
set (sources mman.c)
+if(NOT BUILD_SHARED_LIBS)
+ add_definitions(-DMMANSHARED_EXPORT=)
+endif()
+
add_library (mman ${sources})
install (TARGETS mman RUNTIME DESTINATION bin
diff --git a/mman.h b/mman.h
index 4065bc6..435ea26 100644
--- a/mman.h
+++ b/mman.h
@@ -15,11 +15,13 @@
#include <_mingw.h>
#endif
+#if !defined(MMANSHARED_EXPORT)
#if defined(MMAN_LIBRARY)
#define MMANSHARED_EXPORT __declspec(dllexport)
#else
#define MMANSHARED_EXPORT __declspec(dllimport)
#endif
+#endif
/* Determine offset type */
#include <stdint.h>