Author: Mark Harfouche 
Summary: Build with dynamically loaded libraries
Source: https://github.com/hmaarrfk/staged-recipes/blob/b253685eeb74da281f7083ace0ec9a19131343a5/recipes/brunsli/use_conda_forge_shared_libraries.patch
----

--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -26,7 +26,7 @@ set(CMAKE_CXX_STANDARD 11)
 set(CMAKE_CXX_EXTENSIONS OFF)
 set(CMAKE_CXX_STANDARD_REQUIRED YES)
 
-add_subdirectory(third_party)
+# add_subdirectory(third_party)
 
 # The Brunsli library definition.
 include(brunsli.cmake)
diff --git a/brunsli.cmake b/brunsli.cmake
index 1e87527..48add4c 100644
--- a/brunsli.cmake
+++ b/brunsli.cmake
@@ -57,7 +57,7 @@ add_library(brunslidec-static STATIC
   ${BRUNSLI_DEC_HEADERS}
 )
 target_link_libraries(brunslidec-static PRIVATE
-  brotlidec-static
+  brotlidec
   brunslicommon-static
 )
 
@@ -66,7 +66,7 @@ add_library(brunslienc-static STATIC
   ${BRUNSLI_ENC_HEADERS}
 )
 target_link_libraries(brunslienc-static PRIVATE
-  brotlienc-static
+  brotlienc
   brunslicommon-static
 )
 
@@ -134,10 +134,16 @@ endif()  # BRUNSLI_EMSCRIPTEN
 if(NOT BRUNSLI_EMSCRIPTEN)
   install(
     TARGETS brunslidec-c brunslienc-c
+    RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}"
     ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}"
     LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}"
   )
 
+  install(
+    TARGETS cbrunsli dbrunsli
+    RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}"
+  )
+
   install(
     DIRECTORY ${BRUNSLI_INCLUDE_DIRS}/brunsli
     DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}"
