diff --git a/CMakeLists.txt b/CMakeLists.txt index 4a72f018..55762343 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -548,6 +548,9 @@ if(UHDR_BUILD_EXAMPLES) if(UHDR_BUILD_FUZZERS) target_link_options(ultrahdr_app PRIVATE -fsanitize=fuzzer-no-link) endif() + if(NOT BUILD_SHARED_LIBS AND NOT MSVC AND NOT APPLE) + target_link_options(ultrahdr_app PRIVATE -static) + endif() target_link_libraries(ultrahdr_app PRIVATE ${UHDR_CORE_LIB_NAME}) endif()