mirror of https://github.com/microsoft/vcpkg.git
73 lines
2.9 KiB
Diff
73 lines
2.9 KiB
Diff
diff --git a/include/libhashkit-1.0/visibility.h b/include/libhashkit-1.0/visibility.h
|
|
index dce8c097..6eeb7314 100644
|
|
--- a/include/libhashkit-1.0/visibility.h
|
|
+++ b/include/libhashkit-1.0/visibility.h
|
|
@@ -23,7 +23,10 @@
|
|
* HASHKIT_LOCAL is used for non-api symbols.
|
|
*/
|
|
|
|
-#if defined(BUILDING_HASHKIT)
|
|
+#if defined(HASHKIT_STATIC)
|
|
+# define HASHKIT_API
|
|
+# define HASHKIT_LOCAL
|
|
+#elif defined(BUILDING_HASHKIT)
|
|
# if defined(HAVE_VISIBILITY) && HAVE_VISIBILITY
|
|
# define HASHKIT_API __attribute__((visibility("default")))
|
|
# define HASHKIT_LOCAL __attribute__((visibility("hidden")))
|
|
@@ -45,4 +48,4 @@
|
|
# define HASHKIT_API
|
|
# define HASHKIT_LOCAL
|
|
# endif /* defined(_MSC_VER) */
|
|
-#endif /* defined(BUILDING_HASHKIT) */
|
|
+#endif /* defined(HASHKIT_STATIC) */
|
|
diff --git a/include/libmemcached-1.0/visibility.h b/include/libmemcached-1.0/visibility.h
|
|
index 62c4ea22..4495aa04 100644
|
|
--- a/include/libmemcached-1.0/visibility.h
|
|
+++ b/include/libmemcached-1.0/visibility.h
|
|
@@ -23,7 +23,10 @@
|
|
* LIBMEMCACHED_LOCAL is used for non-api symbols.
|
|
*/
|
|
|
|
-#if defined(BUILDING_LIBMEMCACHEDINTERNAL)
|
|
+#if defined(LIBMEMCACHED_STATIC)
|
|
+# define LIBMEMCACHED_API
|
|
+# define LIBMEMCACHED_LOCAL
|
|
+#elif defined(BUILDING_LIBMEMCACHEDINTERNAL)
|
|
# if defined(HAVE_VISIBILITY) && HAVE_VISIBILITY
|
|
# define LIBMEMCACHED_API __attribute__((visibility("default")))
|
|
# define LIBMEMCACHED_LOCAL __attribute__((visibility("default")))
|
|
@@ -61,4 +64,4 @@
|
|
# define LIBMEMCACHED_LOCAL
|
|
# endif /* defined(_MSC_VER) */
|
|
# endif /* defined(BUILDING_LIBMEMCACHED) */
|
|
-#endif /* defined(BUILDING_LIBMEMCACHEDINTERNAL) */
|
|
+#endif /* defined(LIBMEMCACHED_STATIC) */
|
|
diff --git a/src/libhashkit/CMakeLists.txt b/src/libhashkit/CMakeLists.txt
|
|
index 455570af..c0d9d743 100644
|
|
--- a/src/libhashkit/CMakeLists.txt
|
|
+++ b/src/libhashkit/CMakeLists.txt
|
|
@@ -30,6 +30,9 @@ set_target_properties(libhashkit PROPERTIES
|
|
SOVERSION ${LIBHASHKIT_SO_SOVERSION}
|
|
VERSION ${LIBHASHKIT_SO_VERSION})
|
|
target_compile_options(libhashkit PRIVATE -DBUILDING_HASHKIT)
|
|
+if(NOT BUILD_SHARED_LIBS)
|
|
+ target_compile_options(libhashkit PUBLIC -DHASHKIT_STATIC)
|
|
+endif()
|
|
target_include_directories(libhashkit PRIVATE
|
|
${CMAKE_SOURCE_DIR}/src
|
|
${CMAKE_BINARY_DIR}/src
|
|
diff --git a/src/libmemcached/CMakeLists.txt b/src/libmemcached/CMakeLists.txt
|
|
index 05116ae8..a1a2ac00 100644
|
|
--- a/src/libmemcached/CMakeLists.txt
|
|
+++ b/src/libmemcached/CMakeLists.txt
|
|
@@ -94,6 +94,9 @@ set_target_properties(libmemcached PROPERTIES
|
|
SOVERSION ${LIBMEMCACHED_SO_SOVERSION}
|
|
VERSION ${LIBMEMCACHED_SO_VERSION})
|
|
target_compile_definitions(libmemcached PRIVATE -DBUILDING_LIBMEMCACHED)
|
|
+if(NOT BUILD_SHARED_LIBS)
|
|
+ target_compile_definitions(libmemcached PUBLIC -DLIBMEMCACHED_STATIC)
|
|
+endif()
|
|
target_link_libraries(libmemcached PUBLIC libhashkit Threads::Threads ${CMAKE_DL_LIBS})
|
|
target_link_libraries(libmemcached PRIVATE p9y)
|
|
if(MSVC)
|