diff --git a/CMakeLists.txt b/CMakeLists.txt index abeec4ff0..901267e6c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1949,10 +1949,12 @@ elseif(APPLE) ${SECURITY_FRAMEWORK}) endif() else() - # DH requires math (m) library - target_link_libraries(wolfssl - PUBLIC - m) + if(WOLFSSL_DH) + # DH requires math (m) library + target_link_libraries(wolfssl + PUBLIC + m) + endif() endif() ####################################################