Skip to content

Commit 7574135

Browse files
bjoriajdavis
authored andcommitted
CDRIVER-2261 Examples require C++ linker
1 parent 7c33882 commit 7574135

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

CMakeLists.txt

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,17 +29,19 @@ option(ENABLE_MAINTAINER_FLAGS "Use strict compiler checks" OFF)
2929
option(ENABLE_AUTOMATIC_INIT_AND_CLEANUP "Enable automatic init and cleanup (GCC only)" ON)
3030
option(ENABLE_CRYPTO_SYSTEM_PROFILE "Use system crypto profile (OpenSSL only)" OFF)
3131
option(ENABLE_TRACING "Turn on verbose debug output" OFF)
32-
set(ENABLE_SNAPPY bundled CACHE STRING "Enable snappy support")
32+
set(ENABLE_SNAPPY AUTO CACHE STRING "Enable snappy support")
3333
set(ENABLE_ZLIB bundled CACHE STRING "Enable zlib support")
3434

3535
if (NOT WIN32)
3636
message(WARNING "CMake support is experimental and may not produce production quality artifacts")
3737
endif ()
3838

39-
if (ENABLE_SNAPPY STREQUAL "bundled")
40-
project (libmongoc C CXX)
39+
if (WIN32 AND ENABLE_SNAPPY STREQUAL "AUTO")
40+
project (libmongoc C CXX)
41+
set (ENABLE_SNAPPY "bundled")
4142
else ()
42-
project (libmongoc C)
43+
project (libmongoc C)
44+
set (ENABLE_SNAPPY "")
4345
endif ()
4446

4547
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${PROJECT_SOURCE_DIR}/build/cmake)
@@ -688,10 +690,6 @@ function(mongoc_add_example example use_shared)
688690
target_link_libraries(${example} shlwapi)
689691
endif()
690692
set (EXAMPLES ${EXAMPLES} ${example})
691-
if (ENABLE_SNAPPY STREQUAL "bundled")
692-
set_target_properties(${example} PROPERTIES LINKER_LANGUAGE CXX)
693-
set_target_properties(${example} PROPERTIES LINKER_LANGUAGE CXX)
694-
endif ()
695693
endif ()
696694
endfunction()
697695

0 commit comments

Comments
 (0)