Browse Source

Add WOLFSSL_DH_CONST option to Cmake

Eric Blankenhorn 1 year ago
parent
commit
9f7e82a081
1 changed files with 7 additions and 2 deletions
  1. 7 2
      CMakeLists.txt

+ 7 - 2
CMakeLists.txt

@@ -931,7 +931,7 @@ endif()
 # DH
 add_option("WOLFSSL_DH"
     "Enable DH (default: enabled)"
-    "yes" "yes;no")
+    "yes" "yes;no;const")
 
 if(WOLFSSL_OPENSSH)
     override_cache(WOLFSSL_DH "yes")
@@ -946,6 +946,11 @@ else()
     endif()
 endif()
 
+if("${WOLFSSL_DH}" STREQUAL "const")
+    list(APPEND WOLFSSL_DEFINITIONS "-DWOLFSSL_DH_CONST")
+    set(WOLFSSL_DH_CONST "yes")
+endif()
+
 # TODO: - Anonymous
 
 # ASN
@@ -1949,7 +1954,7 @@ elseif(APPLE)
             ${SECURITY_FRAMEWORK})
     endif()
 else()
-    if(WOLFSSL_DH)
+    if(WOLFSSL_DH AND NOT WOLFSSL_DH_CONST)
         # DH requires math (m) library
         target_link_libraries(wolfssl
             PUBLIC