Skip to content

Commit 60e737f

Browse files
jen20James Nugent
authored andcommitted
Link against msgpack-static when shared disabled
This commit causes the tests to be linked against the msgpack-static target if MSGPACK_ENABLE_SHARED is set to OFF.
1 parent 5f1d5e8 commit 60e737f

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

test/CMakeLists.txt

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,14 +50,20 @@ IF (MSGPACK_CXX11)
5050
)
5151
ENDIF ()
5252

53+
IF (MSGPACK_ENABLE_SHARED)
54+
SET (MSGPACK_TEST_LIB msgpack)
55+
ELSE ()
56+
SET (MSGPACK_TEST_LIB msgpack-static)
57+
ENDIF ()
58+
5359
FOREACH (source_file ${check_PROGRAMS})
5460
GET_FILENAME_COMPONENT (source_file_we ${source_file} NAME_WE)
5561
ADD_EXECUTABLE (
5662
${source_file_we}
5763
${source_file}
5864
)
5965
TARGET_LINK_LIBRARIES (${source_file_we}
60-
msgpack
66+
${MSGPACK_TEST_LIB}
6167
${GTEST_BOTH_LIBRARIES}
6268
${ZLIB_LIBRARIES}
6369
${CMAKE_THREAD_LIBS_INIT}

0 commit comments

Comments
 (0)