mirror of
https://github.com/eclipse-mosquitto/mosquitto.git
synced 2026-03-23 16:33:35 +08:00
cmake: Only include C++ support when required
Thanks to Yann Morin
This commit is contained in:
@@ -10,7 +10,7 @@ set (VERSION 2.1.2)
|
|||||||
project(mosquitto
|
project(mosquitto
|
||||||
VERSION ${VERSION}
|
VERSION ${VERSION}
|
||||||
DESCRIPTION "Eclipse Mosquitto"
|
DESCRIPTION "Eclipse Mosquitto"
|
||||||
LANGUAGES C CXX
|
LANGUAGES C
|
||||||
)
|
)
|
||||||
|
|
||||||
set(CMAKE_C_STANDARD 99)
|
set(CMAKE_C_STANDARD 99)
|
||||||
@@ -46,10 +46,16 @@ include(CMakePushCheckState)
|
|||||||
include(CheckSourceCompiles)
|
include(CheckSourceCompiles)
|
||||||
|
|
||||||
option(WITH_BUNDLED_DEPS "Build with bundled dependencies?" ON)
|
option(WITH_BUNDLED_DEPS "Build with bundled dependencies?" ON)
|
||||||
|
option(WITH_LIB_CPP "Build C++ library?" ON)
|
||||||
option(WITH_TLS "Include SSL/TLS support?" ON)
|
option(WITH_TLS "Include SSL/TLS support?" ON)
|
||||||
option(WITH_TLS_PSK "Include TLS-PSK support (requires WITH_TLS)?" ON)
|
option(WITH_TLS_PSK "Include TLS-PSK support (requires WITH_TLS)?" ON)
|
||||||
option(WITH_TESTS "Enable tests" ON)
|
option(WITH_TESTS "Enable tests" ON)
|
||||||
option(INC_MEMTRACK "Include memory tracking support?" ON)
|
option(INC_MEMTRACK "Include memory tracking support?" ON)
|
||||||
|
|
||||||
|
if (WITH_LIB_CPP OR WITH_TESTS)
|
||||||
|
ENABLE_LANGUAGE(CXX)
|
||||||
|
endif()
|
||||||
|
|
||||||
if (WITH_TLS)
|
if (WITH_TLS)
|
||||||
find_package(OpenSSL REQUIRED)
|
find_package(OpenSSL REQUIRED)
|
||||||
add_definitions("-DWITH_TLS")
|
add_definitions("-DWITH_TLS")
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
option(WITH_LIB_CPP "Build C++ library?" ON)
|
|
||||||
if(WITH_LIB_CPP)
|
if(WITH_LIB_CPP)
|
||||||
add_subdirectory(cpp)
|
add_subdirectory(cpp)
|
||||||
endif()
|
endif()
|
||||||
|
|||||||
Reference in New Issue
Block a user