Examples require C++ linker
@@ -30,17 +30,19 @@ option(ENABLE_MAINTAINER_FLAGS "Use strict compiler checks" OFF)
option(ENABLE_AUTOMATIC_INIT_AND_CLEANUP "Enable automatic init and cleanup (GCC only)" ON)
option(ENABLE_CRYPTO_SYSTEM_PROFILE "Use system crypto profile (OpenSSL only)" OFF)
option(ENABLE_TRACING "Turn on verbose debug output" OFF)
-set(ENABLE_SNAPPY bundled CACHE STRING "Enable snappy support")
+set(ENABLE_SNAPPY AUTO CACHE STRING "Enable snappy support")
set(ENABLE_ZLIB bundled CACHE STRING "Enable zlib support")
if (NOT WIN32)
message(WARNING "CMake support is experimental and may not produce production quality artifacts")
endif ()
-if (ENABLE_SNAPPY STREQUAL "bundled")
+if (WIN32 AND ENABLE_SNAPPY STREQUAL "AUTO")
project (libmongoc C CXX)
+ set (ENABLE_SNAPPY "bundled")
else ()
project (libmongoc C)
+ set (ENABLE_SNAPPY "")
endif ()
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${PROJECT_SOURCE_DIR}/build/cmake)
@@ -695,10 +697,6 @@ function(mongoc_add_example example use_shared)
target_link_libraries(${example} shlwapi)
endif()
set (EXAMPLES ${EXAMPLES} ${example})
- if (ENABLE_SNAPPY STREQUAL "bundled")
- set_target_properties(${example} PROPERTIES LINKER_LANGUAGE CXX)
- set_target_properties(${example} PROPERTIES LINKER_LANGUAGE CXX)
- endif ()
endif ()
endfunction()
