From 17df41def0618a955be942041466b878fc1418d3 Mon Sep 17 00:00:00 2001 From: Sam Smith Date: Thu, 12 Jul 2018 15:38:01 -0400 Subject: [PATCH] Fix compiling static lib on Windows with MSVC On Windows, the DLL will create nghttp2.lib AND nghttp2.dll. Then the static lib also tries to build nghttp2.lib, but that fails because it already exists. The nghttp2.lib created for the DLL cannot be used without the DLL. This compiles the static nghttp2.lib into a separate directory, which works around the above issue. Signed-off-by: Matthew Horan --- lib/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt index 17e422b2..e58070f5 100644 --- a/lib/CMakeLists.txt +++ b/lib/CMakeLists.txt @@ -56,6 +56,7 @@ if(HAVE_CUNIT OR ENABLE_STATIC_LIB) COMPILE_FLAGS "${WARNCFLAGS}" VERSION ${LT_VERSION} SOVERSION ${LT_SOVERSION} ARCHIVE_OUTPUT_NAME nghttp2 + ARCHIVE_OUTPUT_DIRECTORY static ) target_compile_definitions(nghttp2_static PUBLIC "-DNGHTTP2_STATICLIB") if(ENABLE_STATIC_LIB)