From 68520e3f0b76fc6f3ca3fe04e671e3686fcf6b90 Mon Sep 17 00:00:00 2001 From: Eric Blankenhorn Date: Tue, 17 Jan 2023 16:28:36 -0600 Subject: [PATCH] Fix Cmake to exclude libm when DH is not enabled --- CMakeLists.txt | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) 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() ####################################################