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-06-29 10:01:37 +02:00
parent 513df5fb5a
commit fbc0300e0b
1 changed files with 1 additions and 1 deletions

View File

@ -146,7 +146,7 @@ ENDIF (HAVE_LIBQUICKLZ)
ADD_EXECUTABLE(snappy-unittest snappy_unittest.cc snappy-test.cc) ADD_EXECUTABLE(snappy-unittest snappy_unittest.cc 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 ${COMPRESSION_LIBS} TARGET_LINK_LIBRARIES(snappy-unittest snappy ${COMPRESSION_LIBS}
${GFLAGS_LIBRARIES}) ${GFLAGS_LIBRARIES} ${GTEST_LIBRARIES})
TARGET_INCLUDE_DIRECTORIES(snappy-unittest BEFORE PRIVATE ${Snappy_SOURCE_DIR} TARGET_INCLUDE_DIRECTORIES(snappy-unittest BEFORE PRIVATE ${Snappy_SOURCE_DIR}
${GTEST_INCLUDE_DIRS} ${GFLAGS_INCLUDE_DIRS}) ${GTEST_INCLUDE_DIRS} ${GFLAGS_INCLUDE_DIRS})