File tree Expand file tree Collapse file tree 1 file changed +12
-4
lines changed Expand file tree Collapse file tree 1 file changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -3,7 +3,13 @@ cmake_minimum_required(VERSION 3.2)
33include ("packaging/cmake/parseversion.cmake" )
44parseversion("src/rdkafka.h" )
55
6- project (RdKafka VERSION ${RDKAFKA_VERSION} )
6+ option (RDKAFKA_BUILD_CXX "Enable CXX support" ON )
7+ set (RDKAFKA_LANGUAGES C)
8+ if (RDKAFKA_BUILD_CXX)
9+ set (RDKAFKA_LANGUAGES ${RDKAFKA_LANGUAGES} CXX)
10+ endif ()
11+
12+ project (RdKafka VERSION ${RDKAFKA_VERSION} LANGUAGES ${RDKAFKA_LANGUAGES} )
713
814set (CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR} /packaging/cmake/Modules/" )
915
@@ -180,8 +186,8 @@ endif()
180186# }
181187
182188option (RDKAFKA_BUILD_STATIC "Build static rdkafka library" OFF )
183- option (RDKAFKA_BUILD_EXAMPLES "Build examples" ON )
184- option (RDKAFKA_BUILD_TESTS "Build tests" ON )
189+ option (RDKAFKA_BUILD_EXAMPLES "Build examples" RDKAFKA_BUILD_CXX )
190+ option (RDKAFKA_BUILD_TESTS "Build tests" RDKAFKA_BUILD_CXX )
185191if (WIN32 )
186192 option (WITHOUT_WIN32_CONFIG "Avoid including win32_config.h on cmake builds" ON )
187193endif (WIN32 )
@@ -279,7 +285,9 @@ install(
279285)
280286
281287add_subdirectory (src)
282- add_subdirectory (src-cpp)
288+ if (RDKAFKA_BUILD_CXX)
289+ add_subdirectory (src-cpp)
290+ endif ()
283291
284292if (RDKAFKA_BUILD_EXAMPLES)
285293 add_subdirectory (examples)
You can’t perform that action at this time.
0 commit comments