-
Couldn't load subscription status.
- Fork 3.2k
Open
Description
When built with mklove, WITH_SASL_SCRAM is set if WITH_SSL is set:
Lines 143 to 145 in c56a3e6
| if [[ "$WITH_SSL" == "y" ]]; then | |
| # SASL SCRAM requires base64 encoding from OpenSSL | |
| mkl_allvar_set WITH_SASL_SCRAM WITH_SASL_SCRAM y |
When built with cmake, WITH_SASL is set (by default) only if libsasl2 (cyrus-sasl) is found by pkg-config, or if a test program successfully links against -lsasl2:
Lines 127 to 145 in c56a3e6
| if(PkgConfig_FOUND) | |
| pkg_check_modules(SASL libsasl2) | |
| if(SASL_FOUND) | |
| set(with_sasl_default ON) | |
| else() | |
| try_compile( | |
| WITH_SASL_CYRUS_BOOL | |
| "${CMAKE_CURRENT_BINARY_DIR}/try_compile" | |
| "${TRYCOMPILE_SRC_DIR}/libsasl2_test.c" | |
| LINK_LIBRARIES "-lsasl2" | |
| ) | |
| if(WITH_SASL_CYRUS_BOOL) | |
| set(with_sasl_default ON) | |
| set(SASL_LIBRARIES "-lsasl2") | |
| else() | |
| set(with_sasl_default OFF) | |
| endif() | |
| endif() | |
| endif() |
WITH_SASL_SCRAM is then only enabled if WITH_SASL is set:
Lines 148 to 156 in c56a3e6
| if(WITH_SASL) | |
| if(SASL_FOUND) | |
| link_directories(${SASL_LIBRARY_DIRS}) | |
| endif() | |
| if(WITH_SSL) | |
| set(WITH_SASL_SCRAM ON) | |
| set(WITH_SASL_OAUTHBEARER ON) | |
| list(APPEND BUILT_WITH "SASL_SCRAM SASL_OAUTHBEARER") | |
| endif() |
This means that when building with cmake, you need to either override -DWITH_SASL=ON or you'll never get SASL support that isn't SASL_CYRUS.
My suggestions:
- The check for
libsasl2should have thetry_compile()outside of theif(WITH_PKGCONFIG)guard:if(WITH_PKGCONFIG) pkg_check_modules(SASL libsasl2) if(SASL_FOUND) set(with_sasl_default ON) endif() else() try_compile(WITH_SASL_CYRUS_BOOL ...) if(WITH_SASL_CYRUS_BOOL) set(with_sasl_default ON) set(SASL_LIBRARIES "-lsasl2") endif() endif()
- The check for
if(WITH_SSL)should be hoisted outside of theif(WITH_SASL)guard, so that if OpenSSL is present,SASL_SCRAMandSASL_OATHBEARERcan be used.
Metadata
Metadata
Assignees
Labels
No labels