mirror of
https://github.com/protobuf-c/protobuf-c.git
synced 2025-01-14 01:07:57 +08:00
CMakeLists.txt: Fix protoc-c crashes on Linux
-lpthread was missing from the linker command line. See https://github.com/protocolbuffers/protobuf/issues/5107 for more details. .travis.yml: Run CMake debug build for verification
This commit is contained in:
parent
db6c49cc43
commit
ce75229b6a
@ -15,6 +15,7 @@ env:
|
||||
global:
|
||||
- PROTOBUF_VERSION=3.7.1
|
||||
- PKG_CONFIG_PATH=$HOME/protobuf-$PROTOBUF_VERSION-bin/lib/pkgconfig
|
||||
- CMAKE_PREFIX_PATH=$HOME/protobuf-$PROTOBUF_VERSION-bin
|
||||
|
||||
install:
|
||||
- pip install --user cpp-coveralls
|
||||
@ -27,6 +28,7 @@ script:
|
||||
- ./configure && make -j2 distcheck VERBOSE=1 && make clean
|
||||
- ./configure --enable-valgrind-tests CFLAGS="-fsanitize=undefined -fno-sanitize-recover=undefined" && make -j2 distcheck DISTCHECK_CONFIGURE_FLAGS="--enable-valgrind-tests CFLAGS=\"-fsanitize=undefined -fno-sanitize-recover=undefined\"" VERBOSE=1 && make clean
|
||||
- ./configure --enable-code-coverage && make -j2 && make check
|
||||
- ( mkdir build-cmake/bin && cd build-cmake/bin && cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=protobuf-c-bin ../ && make -j2 && make test && make install)
|
||||
|
||||
after_success:
|
||||
- cpp-coveralls --build-root . --exclude t/ --exclude /usr/include --exclude protobuf-$PROTOBUF_VERSION --exclude protoc-c
|
||||
|
@ -134,6 +134,15 @@ TARGET_LINK_LIBRARIES(test-generated-code3 protobuf-c)
|
||||
|
||||
ENDIF()
|
||||
|
||||
# https://github.com/protocolbuffers/protobuf/issues/5107
|
||||
IF(CMAKE_HOST_UNIX)
|
||||
FIND_PACKAGE(Threads REQUIRED)
|
||||
TARGET_LINK_LIBRARIES(protoc-gen-c ${CMAKE_THREAD_LIBS_INIT})
|
||||
IF(CMAKE_BUILD_TYPE MATCHES Debug)
|
||||
TARGET_LINK_LIBRARIES(cxx-generate-packed-data ${CMAKE_THREAD_LIBS_INIT})
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
|
||||
INSTALL(TARGETS protoc-gen-c protobuf-c RUNTIME DESTINATION bin LIBRARY DESTINATION lib ARCHIVE DESTINATION lib)
|
||||
INSTALL(FILES ${MAIN_DIR}/protobuf-c/protobuf-c.h DESTINATION include/protobuf-c)
|
||||
INSTALL(FILES ${MAIN_DIR}/protobuf-c/protobuf-c.h DESTINATION include)
|
||||
|
Loading…
x
Reference in New Issue
Block a user