vcpkg/ports/nghttp2/enable-static.patch

28 lines
903 B
Diff
Raw Normal View History

2018-02-08 04:12:14 +08:00
diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt
2018-05-17 21:06:26 +08:00
index 17e422b..b2e7a6e 100644
2018-02-08 04:12:14 +08:00
--- a/lib/CMakeLists.txt
+++ b/lib/CMakeLists.txt
2018-05-17 21:06:26 +08:00
@@ -37,8 +37,8 @@ if(WIN32)
set(NGHTTP2_RES ${CMAKE_CURRENT_BINARY_DIR}/version.rc)
2018-02-08 04:12:14 +08:00
endif()
2018-05-17 21:06:26 +08:00
-# Public shared library
2018-02-08 04:12:14 +08:00
-add_library(nghttp2 SHARED ${NGHTTP2_SOURCES} ${NGHTTP2_RES})
2018-05-17 21:06:26 +08:00
+# Public library
2018-02-08 04:12:14 +08:00
+add_library(nghttp2 ${NGHTTP2_SOURCES} ${NGHTTP2_RES})
set_target_properties(nghttp2 PROPERTIES
COMPILE_FLAGS "${WARNCFLAGS}"
VERSION ${LT_VERSION} SOVERSION ${LT_SOVERSION}
2018-05-17 21:06:26 +08:00
@@ -49,6 +49,10 @@ target_include_directories(nghttp2 INTERFACE
2018-02-08 04:12:14 +08:00
"${CMAKE_CURRENT_SOURCE_DIR}/includes"
)
2018-05-17 21:06:26 +08:00
2018-02-08 04:12:14 +08:00
+if(NOT BUILD_SHARED_LIBS)
+ target_compile_definitions(nghttp2 PUBLIC "-DNGHTTP2_STATICLIB")
+endif()
2018-05-17 21:06:26 +08:00
+
if(HAVE_CUNIT OR ENABLE_STATIC_LIB)
2018-02-08 04:12:14 +08:00
# Static library (for unittests because of symbol visibility)
2018-05-17 21:06:26 +08:00
add_library(nghttp2_static STATIC ${NGHTTP2_SOURCES})