Unverified Commit d340bdf5 authored by Joshua Haberman's avatar Joshua Haberman Committed by GitHub

Merge pull request #5078 from haberman/conformance-cmake

Added cmake build files for the conformance test runner.
parents d42ec079 0e3fa28e
...@@ -1043,6 +1043,7 @@ EXTRA_DIST = $(@DIST_LANG@_EXTRA_DIST) \ ...@@ -1043,6 +1043,7 @@ EXTRA_DIST = $(@DIST_LANG@_EXTRA_DIST) \
WORKSPACE \ WORKSPACE \
cmake/CMakeLists.txt \ cmake/CMakeLists.txt \
cmake/README.md \ cmake/README.md \
cmake/conformance.cmake \
cmake/examples.cmake \ cmake/examples.cmake \
cmake/extract_includes.bat.in \ cmake/extract_includes.bat.in \
cmake/install.cmake \ cmake/install.cmake \
......
...@@ -30,6 +30,7 @@ endif() ...@@ -30,6 +30,7 @@ endif()
# Options # Options
option(protobuf_BUILD_TESTS "Build tests" ON) option(protobuf_BUILD_TESTS "Build tests" ON)
option(protobuf_BUILD_CONFORMANCE "Build conformance tests" OFF)
option(protobuf_BUILD_EXAMPLES "Build examples" OFF) option(protobuf_BUILD_EXAMPLES "Build examples" OFF)
option(protobuf_BUILD_PROTOC_BINARIES "Build libprotoc and protoc compiler" ON) option(protobuf_BUILD_PROTOC_BINARIES "Build libprotoc and protoc compiler" ON)
if (BUILD_SHARED_LIBS) if (BUILD_SHARED_LIBS)
...@@ -218,6 +219,10 @@ if (protobuf_BUILD_TESTS) ...@@ -218,6 +219,10 @@ if (protobuf_BUILD_TESTS)
include(tests.cmake) include(tests.cmake)
endif (protobuf_BUILD_TESTS) endif (protobuf_BUILD_TESTS)
if (protobuf_BUILD_CONFORMANCE)
include(conformance.cmake)
endif (protobuf_BUILD_CONFORMANCE)
include(install.cmake) include(install.cmake)
if (protobuf_BUILD_EXAMPLES) if (protobuf_BUILD_EXAMPLES)
......
add_custom_command(
OUTPUT ${protobuf_source_dir}/conformance/conformance.pb.cc
DEPENDS protoc ${protobuf_source_dir}/conformance/conformance.proto
COMMAND protoc ${protobuf_source_dir}/conformance/conformance.proto
--proto_path=${protobuf_source_dir}/conformance
--cpp_out=${protobuf_source_dir}/conformance
)
add_custom_command(
OUTPUT ${protobuf_source_dir}/src/google/protobuf/test_messages_proto3.pb.cc
${protobuf_source_dir}/src/google/protobuf/test_messages_proto2.pb.cc
DEPENDS protoc ${protobuf_source_dir}/src/google/protobuf/test_messages_proto3.proto
protoc ${protobuf_source_dir}/src/google/protobuf/test_messages_proto2.proto
COMMAND protoc ${protobuf_source_dir}/src/google/protobuf/test_messages_proto3.proto
${protobuf_source_dir}/src/google/protobuf/test_messages_proto2.proto
--proto_path=${protobuf_source_dir}/src
--cpp_out=${protobuf_source_dir}/src
)
add_executable(conformance_test_runner
${protobuf_source_dir}/conformance/conformance.pb.cc
${protobuf_source_dir}/conformance/conformance_test.cc
${protobuf_source_dir}/conformance/conformance_test_runner.cc
${protobuf_source_dir}/conformance/third_party/jsoncpp/json.h
${protobuf_source_dir}/conformance/third_party/jsoncpp/jsoncpp.cpp
${protobuf_source_dir}/src/google/protobuf/test_messages_proto3.pb.cc
${protobuf_source_dir}/src/google/protobuf/test_messages_proto2.pb.cc
)
add_executable(conformance_cpp
${protobuf_source_dir}/conformance/conformance.pb.cc
${protobuf_source_dir}/conformance/conformance_cpp.cc
${protobuf_source_dir}/src/google/protobuf/test_messages_proto3.pb.cc
${protobuf_source_dir}/src/google/protobuf/test_messages_proto2.pb.cc
)
target_include_directories(
conformance_test_runner
PUBLIC ${protobuf_source_dir}/conformance)
target_include_directories(
conformance_cpp
PUBLIC ${protobuf_source_dir}/conformance)
target_link_libraries(conformance_test_runner libprotobuf)
target_link_libraries(conformance_cpp libprotobuf)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment