aboutsummaryrefslogtreecommitdiff
path: root/cmake/tests.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'cmake/tests.cmake')
-rw-r--r--cmake/tests.cmake14
1 files changed, 14 insertions, 0 deletions
diff --git a/cmake/tests.cmake b/cmake/tests.cmake
index ec790e33..f4679d1a 100644
--- a/cmake/tests.cmake
+++ b/cmake/tests.cmake
@@ -63,6 +63,7 @@ set(tests_protos
google/protobuf/unittest_optimize_for.proto
google/protobuf/unittest_preserve_unknown_enum.proto
google/protobuf/unittest_preserve_unknown_enum2.proto
+ google/protobuf/unittest_proto3.proto
google/protobuf/unittest_proto3_arena.proto
google/protobuf/unittest_proto3_arena_lite.proto
google/protobuf/unittest_proto3_lite.proto
@@ -78,6 +79,7 @@ set(tests_protos
google/protobuf/util/internal/testdata/struct.proto
google/protobuf/util/internal/testdata/timestamp_duration.proto
google/protobuf/util/internal/testdata/wrappers.proto
+ google/protobuf/util/json_format.proto
google/protobuf/util/json_format_proto3.proto
google/protobuf/util/message_differencer_unittest.proto
)
@@ -166,6 +168,7 @@ set(tests_files
${protobuf_source_dir}/src/google/protobuf/proto3_arena_lite_unittest.cc
${protobuf_source_dir}/src/google/protobuf/proto3_arena_unittest.cc
${protobuf_source_dir}/src/google/protobuf/proto3_lite_unittest.cc
+ ${protobuf_source_dir}/src/google/protobuf/proto3_lite_unittest.inc
${protobuf_source_dir}/src/google/protobuf/reflection_ops_unittest.cc
${protobuf_source_dir}/src/google/protobuf/repeated_field_reflection_unittest.cc
${protobuf_source_dir}/src/google/protobuf/repeated_field_unittest.cc
@@ -204,6 +207,17 @@ if(protobuf_ABSOLUTE_TEST_PLUGIN_PATH)
add_compile_options(-DGOOGLE_PROTOBUF_TEST_PLUGIN_PATH="$<TARGET_FILE:test_plugin>")
endif()
+if(MINGW)
+ set_source_files_properties(${tests_files} PROPERTIES COMPILE_FLAGS "-Wno-narrowing")
+
+ # required for tests on MinGW Win64
+ if (CMAKE_SIZEOF_VOID_P EQUAL 8)
+ set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--stack,16777216")
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wa,-mbig-obj")
+ endif()
+
+endif()
+
add_executable(tests ${tests_files} ${common_test_files} ${tests_proto_files} ${lite_test_proto_files})
target_link_libraries(tests libprotoc libprotobuf gmock_main)