cmake: Add missing linking to GTEST_LIBRARIES

Since the snappy_unittest target uses gtest routines (when available),
it needs to link to gtest explicitly. Otherwise, the build fails due
to unavailable gtest symbols.
This commit is contained in:
Michał Górny 2017-07-31 20:49:22 +02:00
parent be6dc3db83
commit 56d9b14b54

View file

@ -119,7 +119,10 @@ if(SNAPPY_BUILD_TESTS)
"${PROJECT_SOURCE_DIR}/snappy-test.cc" "${PROJECT_SOURCE_DIR}/snappy-test.cc"
) )
target_compile_definitions(snappy_unittest PRIVATE -DHAVE_CONFIG_H) target_compile_definitions(snappy_unittest PRIVATE -DHAVE_CONFIG_H)
target_link_libraries(snappy_unittest snappy ${GFLAGS_LIBRARIES}) target_link_libraries(snappy_unittest
snappy
${GFLAGS_LIBRARIES}
${GTEST_LIBRARIES})
if(HAVE_LIBZ) if(HAVE_LIBZ)
target_link_libraries(snappy_unittest z) target_link_libraries(snappy_unittest z)