mirror of
https://github.com/protobuf-c/protobuf-c.git
synced 2024-12-27 13:31:02 +08:00
Add BUILD_TESTS option to CMake build.
This commit is contained in:
parent
56b8d915be
commit
e01b30d4fe
@ -12,6 +12,11 @@ PROJECT(protobuf-c)
|
||||
option(MSVC_STATIC_BUILD "MSVC_STATIC_BUILD" OFF)
|
||||
option(BUILD_PROTO3 "BUILD_PROTO3" ON)
|
||||
option(BUILD_PROTOC "Build protoc-gen-c" ON)
|
||||
if(CMAKE_BUILD_TYPE MATCHES Debug)
|
||||
option(BUILD_TESTS "Build tests" ON)
|
||||
else()
|
||||
option(BUILD_TESTS "Build tests" OFF)
|
||||
endif()
|
||||
|
||||
INCLUDE(TestBigEndian)
|
||||
TEST_BIG_ENDIAN(WORDS_BIGENDIAN)
|
||||
@ -94,7 +99,7 @@ FUNCTION(GENERATE_TEST_SOURCES PROTO_FILE SRC HDR)
|
||||
ENDFUNCTION()
|
||||
|
||||
|
||||
IF(CMAKE_BUILD_TYPE MATCHES Debug)
|
||||
IF(BUILD_TESTS)
|
||||
ENABLE_TESTING()
|
||||
|
||||
GENERATE_TEST_SOURCES(${TEST_DIR}/test.proto t/test.pb-c.c t/test.pb-c.h)
|
||||
|
Loading…
x
Reference in New Issue
Block a user