Skip to content

Commit

Permalink
Add OpenSSL support for influxs TLS (closes #1569)
Browse files Browse the repository at this point in the history
  • Loading branch information
zuckschwerdt committed Jan 28, 2021
1 parent f2f7bfd commit febe5d8
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 4 deletions.
38 changes: 34 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,31 @@ if(FORCE_COLORED_BUILD)
endif()

########################################################################
# Find build dependencies
# Find OpenSSL build dependencies
########################################################################
set(ENABLE_OPENSSL AUTO CACHE STRING "Enable OpenSSL TLS support")
set_property(CACHE ENABLE_OPENSSL PROPERTY STRINGS AUTO ON OFF)
if(ENABLE_OPENSSL) # AUTO / ON

find_package(OpenSSL)
if(OPENSSL_FOUND)
message(STATUS "OpenSSL TLS support will be compiled.")
include_directories(${OPENSSL_INCLUDE_DIR})
list(APPEND SDR_LIBRARIES ${OPENSSL_LIBRARIES})
ADD_DEFINITIONS(-DOPENSSL)
ADD_DEFINITIONS(-DMG_ENABLE_SSL)
elseif(ENABLE_OPENSSL STREQUAL "AUTO")
message(STATUS "OpenSSL development files not found, TLS won't be possible.")
else()
message(FATAL_ERROR "OpenSSL development files not found.")
endif()

else()
message(STATUS "OpenSSL TLS disabled.")
endif()

########################################################################
# Find LibRTLSDR build dependencies
########################################################################
set(ENABLE_RTLSDR ON CACHE STRING "Enable RTL-SDR (lbrtlsdr) driver support")
set_property(CACHE ENABLE_RTLSDR PROPERTY STRINGS AUTO ON OFF)
Expand All @@ -115,6 +139,9 @@ else()
message(STATUS "RTL-SDR device input disabled.")
endif()

########################################################################
# Find SoapySDR build dependencies
########################################################################
set(ENABLE_SOAPYSDR AUTO CACHE STRING "Enable SoapySDR driver support")
set_property(CACHE ENABLE_SOAPYSDR PROPERTY STRINGS AUTO ON OFF)
if(ENABLE_SOAPYSDR) # AUTO / ON
Expand All @@ -135,6 +162,9 @@ else()
message(STATUS "SoapySDR device input disabled.")
endif()

########################################################################
# Setup optional Profiling with GPerfTools
########################################################################
# cmake -DCMAKE_BUILD_TYPE=Profile ..
# CPUPROFILE=prof.out ./src/rtl_433 ...
# pprof -text ./src/rtl_433 prof.out
Expand All @@ -150,13 +180,13 @@ if("${CMAKE_BUILD_TYPE}" STREQUAL "Profile")
ADD_DEFINITIONS(-fno-builtin-free)
endif()

########################################################################
# Setup the include and linker paths
########################################################################
if(MINGW OR MSVC)
list(APPEND NET_LIBRARIES ws2_32 mswsock)
endif()

########################################################################
# Setup the include and linker paths
########################################################################
include_directories(
BEFORE
${PROJECT_SOURCE_DIR}/include
Expand Down
3 changes: 3 additions & 0 deletions src/r_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,9 @@ char const *version_string(void)
#endif
#ifdef SOAPYSDR
" SoapySDR"
#endif
#ifdef OPENSSL
" with TLS"
#endif
;
}
Expand Down

0 comments on commit febe5d8

Please sign in to comment.