Skip to content

Commit c8202ff

Browse files
committed
cmake: On Windows, require dynamic runtime when building connector as DLL.
1 parent bb5962b commit c8202ff

File tree

1 file changed

+5
-11
lines changed

1 file changed

+5
-11
lines changed

CMakeLists.txt

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,11 @@ if(BUILD_STATIC)
171171
add_definitions(-DCONCPP_BUILD_STATIC)
172172
else()
173173
message("Building shared connector library")
174+
175+
if(WIN32 AND STATIC_MSVCRT)
176+
message(SEND_ERROR "Shared library should not use static runtime.")
177+
endif()
178+
174179
set(LIB_TYPE SHARED)
175180
add_definitions(-DCONCPP_BUILD_SHARED)
176181
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
@@ -452,17 +457,6 @@ IF (WITH_TESTS)
452457
# Unit tests declared with ADD_NG_TEST() (see cdk/cmake/testing.cmake)
453458
ADD_TEST_TARGET()
454459

455-
#
456-
# !!!Warning!!! FIXME
457-
# This is temporary solution to a problem hit when linking our test driver
458-
# with dynamic version of DLL. Ignoring duplicate runtime symbols is potentially
459-
# dangerous. This should be replaced by some real solution.
460-
#
461-
462-
if(MSVC)
463-
set_target_properties(run_unit_tests PROPERTIES LINK_FLAGS /FORCE:MULTIPLE)
464-
endif()
465-
466460
# Test for public headers declared with ADD_HEADERS()
467461
# (see cdk/cmake/headers.cmake)
468462
ADD_HEADERS_TEST()

0 commit comments

Comments
 (0)