$NetBSD: patch-src_CMakeLists.txt,v 1.2 2021/07/17 16:29:31 adam Exp $

Dynamically link the executable.

--- src/CMakeLists.txt.orig	2021-07-17 01:45:36.000000000 +0000
+++ src/CMakeLists.txt
@@ -57,13 +57,13 @@ cmark_add_compile_options(${PROGRAM})
 set_target_properties(${PROGRAM} PROPERTIES
   OUTPUT_NAME "cmark")
 
-if (CMARK_STATIC)
+if (CMARK_SHARED)
+  target_link_libraries(${PROGRAM} ${LIBRARY})
+elseif (CMARK_STATIC)
   target_link_libraries(${PROGRAM} ${STATICLIBRARY})
   # Disable the PUBLIC declarations when compiling the executable:
   set_target_properties(${PROGRAM} PROPERTIES
     COMPILE_FLAGS -DCMARK_STATIC_DEFINE)
-elseif (CMARK_SHARED)
-  target_link_libraries(${PROGRAM} ${LIBRARY})
 endif()
 
 # -fvisibility=hidden
