From 19bb6fd33e315e1370583d7a90ec3da10f184a54 Mon Sep 17 00:00:00 2001
From: Nat Goodspeed <nat@lindenlab.com>
Date: Wed, 27 Sep 2017 15:27:30 -0400
Subject: [PATCH] MAINT-7081: Mention nghttp2 library wherever it must be
 mentioned.

---
 indra/cmake/Copy3rdPartyLibs.cmake |  1 +
 indra/cmake/NGHTTP2.cmake          | 20 ++++++++++++++++++++
 indra/llcorehttp/CMakeLists.txt    |  4 ++++
 indra/llmessage/CMakeLists.txt     |  4 ++++
 indra/llplugin/CMakeLists.txt      |  2 +-
 indra/newview/CMakeLists.txt       |  1 +
 indra/newview/viewer_manifest.py   |  1 +
 7 files changed, 32 insertions(+), 1 deletion(-)
 create mode 100644 indra/cmake/NGHTTP2.cmake

diff --git a/indra/cmake/Copy3rdPartyLibs.cmake b/indra/cmake/Copy3rdPartyLibs.cmake
index 5ccbe7d1d82..cb7432ce4c9 100644
--- a/indra/cmake/Copy3rdPartyLibs.cmake
+++ b/indra/cmake/Copy3rdPartyLibs.cmake
@@ -169,6 +169,7 @@ elseif(DARWIN)
         ${EXPAT_COPY}
         libGLOD.dylib
         libndofdev.dylib
+        libnghttp2.dylib
        )
 
     if (FMODEX)
diff --git a/indra/cmake/NGHTTP2.cmake b/indra/cmake/NGHTTP2.cmake
new file mode 100644
index 00000000000..df191ff3c13
--- /dev/null
+++ b/indra/cmake/NGHTTP2.cmake
@@ -0,0 +1,20 @@
+include(Prebuilt)
+
+set(NGHTTP2_FIND_QUIETLY ON)
+set(NGHTTP2_FIND_REQUIRED ON)
+
+if (USESYSTEMLIBS)
+  include(FindNGHTTP2)
+else (USESYSTEMLIBS)
+  use_prebuilt_binary(nghttp2)
+  if (WINDOWS)
+    set(NGHTTP2_LIBRARIES 
+      ${ARCH_PREBUILT_DIRS_RELEASE}/nghttp2.lib
+      )
+  elseif (DARWIN)
+    set(NGHTTP2_LIBRARIES libnghttp2.dylib)
+  else (WINDOWS)
+    set(NGHTTP2_LIBRARIES libnghttp2.a)
+  endif (WINDOWS)
+  set(NGHTTP2_INCLUDE_DIR ${LIBS_PREBUILT_DIR}/include/nghttp2)
+endif (USESYSTEMLIBS)
diff --git a/indra/llcorehttp/CMakeLists.txt b/indra/llcorehttp/CMakeLists.txt
index 435fb09aa4c..40ec836f12a 100644
--- a/indra/llcorehttp/CMakeLists.txt
+++ b/indra/llcorehttp/CMakeLists.txt
@@ -6,6 +6,7 @@ include(00-Common)
 include(GoogleMock)
 include(CURL)
 include(OpenSSL)
+include(NGHTTP2)
 include(ZLIB)
 include(LLCoreHttp)
 include(LLAddBuildTest)
@@ -94,6 +95,7 @@ target_link_libraries(
   ${CURL_LIBRARIES}
   ${OPENSSL_LIBRARIES}
   ${CRYPTO_LIBRARIES}
+  ${NGHTTP2_LIBRARIES}
   ${BOOST_THREAD_LIBRARY}
   ${BOOST_SYSTEM_LIBRARY}
   )
@@ -132,6 +134,7 @@ if (LL_TESTS)
       ${CURL_LIBRARIES}
       ${OPENSSL_LIBRARIES}
       ${CRYPTO_LIBRARIES}
+      ${NGHTTP2_LIBRARIES}
       ${BOOST_THREAD_LIBRARY}
       ${BOOST_SYSTEM_LIBRARY}
       )
@@ -202,6 +205,7 @@ endif (DARWIN)
       ${CURL_LIBRARIES}
       ${OPENSSL_LIBRARIES}
       ${CRYPTO_LIBRARIES}
+      ${NGHTTP2_LIBRARIES}
       ${BOOST_THREAD_LIBRARY}
       ${BOOST_SYSTEM_LIBRARY}
       )
diff --git a/indra/llmessage/CMakeLists.txt b/indra/llmessage/CMakeLists.txt
index 87bec60d959..e0922c0667d 100644
--- a/indra/llmessage/CMakeLists.txt
+++ b/indra/llmessage/CMakeLists.txt
@@ -214,6 +214,7 @@ target_link_libraries(
   ${JSONCPP_LIBRARIES}
   ${OPENSSL_LIBRARIES}
   ${CRYPTO_LIBRARIES}
+  ${NGHTTP2_LIBRARIES}
   ${XMLRPCEPI_LIBRARIES}
   ${LLCOREHTTP_LIBRARIES}
   ${BOOST_COROUTINE_LIBRARY}
@@ -231,6 +232,7 @@ target_link_libraries(
   ${JSONCPP_LIBRARIES}
   ${OPENSSL_LIBRARIES}
   ${CRYPTO_LIBRARIES}
+  ${NGHTTP2_LIBRARIES}
   ${XMLRPCEPI_LIBRARIES}
   ${LLCOREHTTP_LIBRARIES}
   ${BOOST_COROUTINE_LIBRARY}
@@ -257,6 +259,7 @@ if (LINUX)
     ${LLVFS_LIBRARIES}
     ${LLMATH_LIBRARIES}
     ${CURL_LIBRARIES}
+    ${NGHTTP2_LIBRARIES}
     ${LLCOMMON_LIBRARIES}
     ${LLMESSAGE_LIBRARIES}
     ${LLCOREHTTP_LIBRARIES}
@@ -272,6 +275,7 @@ else (LINUX)
     ${LLVFS_LIBRARIES}
     ${LLMATH_LIBRARIES}
     ${CURL_LIBRARIES}
+    ${NGHTTP2_LIBRARIES}
     ${LLCOMMON_LIBRARIES}
     ${LLMESSAGE_LIBRARIES}
     ${LLCOREHTTP_LIBRARIES}
diff --git a/indra/llplugin/CMakeLists.txt b/indra/llplugin/CMakeLists.txt
index 2cdea67723b..129efeb5295 100644
--- a/indra/llplugin/CMakeLists.txt
+++ b/indra/llplugin/CMakeLists.txt
@@ -82,7 +82,7 @@ if (LL_TESTS)
     set_source_files_properties(
       llplugincookiestore.cpp
       PROPERTIES
-        LL_TEST_ADDITIONAL_LIBRARIES "${CURL_LIBRARIES}"
+        LL_TEST_ADDITIONAL_LIBRARIES "${CURL_LIBRARIES};${NGHTTP2_LIBRARIES}"
       )
 
     LL_ADD_PROJECT_UNIT_TESTS(llplugin "${llplugin_TEST_SOURCE_FILES}")
diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt
index f353109debb..2100c91cfe0 100644
--- a/indra/newview/CMakeLists.txt
+++ b/indra/newview/CMakeLists.txt
@@ -2219,6 +2219,7 @@ if (LL_TESTS)
     ${LLCOMMON_LIBRARIES}
     ${JSONCPP_LIBRARIES}
     ${CURL_LIBRARIES}
+    ${NGHTTP2_LIBRARIES}
     )
 
   set_source_files_properties(
diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py
index 900e9f7b1bd..e9e1b1d6acb 100755
--- a/indra/newview/viewer_manifest.py
+++ b/indra/newview/viewer_manifest.py
@@ -930,6 +930,7 @@ def path_optional(src, dst):
                                 "libexpat.1.dylib",
                                 "libexception_handler.dylib",
                                 "libGLOD.dylib",
+                                "libnghttp2.dylib",
                                 ):
                     dylibs += path_optional(os.path.join(relpkgdir, libfile), libfile)
 
-- 
GitLab