[CDRIVER-2585] Set include path with CMake for LibreSSL Created: 03/Apr/18  Updated: 28/Oct/23  Resolved: 05/Apr/18

Status: Closed
Project: C Driver
Component/s: cmake, tls
Affects Version/s: None
Fix Version/s: 1.10.0

Type: Improvement Priority: Major - P3
Reporter: A. Jesse Jiryu Davis Assignee: A. Jesse Jiryu Davis
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Epic Link: Remove Autotools

 Description   

The Autotools build system searches for LibreSSL using pkg-config. If the build system finds LibreSSL, it adds the library's include path to SSL_CFLAGS like so:

   AS_IF([test "$enable_ssl" = "libressl"],[
      PKG_CHECK_MODULES(SSL, [libtls], [enable_ssl=libressl], [
         AC_CHECK_LIB([tls],[tls_init],[
            SSL_LIBS="-ltls -lcrypto"
            enable_ssl=libressl
         ])
      ])
   ])

The call to PKG_CHECK_MODULES with the prefix string "SSL" means that LibreSSL's include path is added to SSL_CFLAGS, which is used later when building libmongoc.

CMake needs similar logic to ensure it adds LibreSSL's include path to libmongoc's include directories. Currently it only handles OpenSSL's include path. We should use CMake's pkg_check_modules to get LibreSSL's include path and library path using pkg-config, then fall back to the current behavior if pkg-config fails.



 Comments   
Comment by Githook User [ 06/Apr/18 ]

Author:

{'email': 'jesse@mongodb.com', 'name': 'A. Jesse Jiryu Davis', 'username': 'ajdavis'}

Message: CDRIVER-2585 cmake sets include path for libressl
Branch: master
https://github.com/mongodb/mongo-c-driver/commit/1c6815d33933e5f90623bb6775cdf7bc8fc29d56

Generated at Wed Feb 07 21:15:41 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.