$NetBSD$ Use cmake variable for libdl. https://github.com/doctest/doctest/pull/848 --- examples/executable_dll_and_plugin/CMakeLists.txt.orig 2023-03-15 12:35:44.000000000 +0000 +++ examples/executable_dll_and_plugin/CMakeLists.txt @@ -12,7 +12,7 @@ target_link_libraries(executable_dll_and target_link_libraries(executable_dll_and_plugin implementation) if(NOT WIN32) - target_link_libraries(executable_dll_and_plugin dl) + target_link_libraries(executable_dll_and_plugin ${CMAKE_DL_LIBS}) endif() # have the executable depend on the plugin so it gets built as well when building/starting only the executable