@ -18,11 +18,6 @@ set(tests_protos
$ { u t i l _ t e s t _ p r o t o s _ f i l e s }
$ { u t i l _ t e s t _ p r o t o s _ f i l e s }
)
)
set ( protoc_cpp_args )
if ( protobuf_BUILD_SHARED_LIBS )
set ( protoc_cpp_args "dllexport_decl=PROTOBUF_TEST_EXPORTS" )
endif ( )
file ( MAKE_DIRECTORY ${ protobuf_BINARY_DIR } /src )
file ( MAKE_DIRECTORY ${ protobuf_BINARY_DIR } /src )
set ( lite_test_proto_files )
set ( lite_test_proto_files )
@ -32,23 +27,17 @@ foreach(proto_file ${lite_test_protos})
L A N G U A G E c p p
L A N G U A G E c p p
O U T _ V A R p b _ g e n e r a t e d _ f i l e s
O U T _ V A R p b _ g e n e r a t e d _ f i l e s
I M P O R T _ D I R S $ { p r o t o b u f _ S O U R C E _ D I R } / s r c
I M P O R T _ D I R S $ { p r o t o b u f _ S O U R C E _ D I R } / s r c
P L U G I N _ O P T I O N S $ { p r o t o c _ c p p _ a r g s }
)
)
set ( lite_test_proto_files ${ lite_test_proto_files } ${ pb_generated_files } )
set ( lite_test_proto_files ${ lite_test_proto_files } ${ pb_generated_files } )
endforeach ( proto_file )
endforeach ( proto_file )
set ( tests_proto_files )
set ( tests_proto_files )
foreach ( proto_file ${ tests_protos } )
foreach ( proto_file ${ tests_protos } )
if ( MSVC AND protobuf_BUILD_SHARED_LIBS AND ${ proto_file } MATCHES ".*enormous.*" )
# O u r e n o r m o u s p r o t o s a r e t o o b i g f o r w i n d o w s D L L s .
continue ( )
endif ( )
protobuf_generate (
protobuf_generate (
P R O T O S $ { p r o t o _ f i l e }
P R O T O S $ { p r o t o _ f i l e }
L A N G U A G E c p p
L A N G U A G E c p p
O U T _ V A R p b _ g e n e r a t e d _ f i l e s
O U T _ V A R p b _ g e n e r a t e d _ f i l e s
I M P O R T _ D I R S $ { p r o t o b u f _ S O U R C E _ D I R } / s r c
I M P O R T _ D I R S $ { p r o t o b u f _ S O U R C E _ D I R } / s r c
P L U G I N _ O P T I O N S $ { p r o t o c _ c p p _ a r g s }
)
)
set ( tests_proto_files ${ tests_proto_files } ${ pb_generated_files } )
set ( tests_proto_files ${ tests_proto_files } ${ pb_generated_files } )
endforeach ( proto_file )
endforeach ( proto_file )
@ -96,7 +85,7 @@ else()
set ( protobuf_GTEST_ARGS )
set ( protobuf_GTEST_ARGS )
endif ( )
endif ( )
add_library ( libtest_common ${ protobuf_SHARED_OR_ STATIC}
add_library ( libtest_common STATIC
$ { t e s t s _ p r o t o _ f i l e s }
$ { t e s t s _ p r o t o _ f i l e s }
)
)
target_link_libraries ( libtest_common
target_link_libraries ( libtest_common
@ -109,11 +98,6 @@ target_link_libraries(libtest_common
if ( MSVC )
if ( MSVC )
target_compile_options ( libtest_common PRIVATE /bigobj )
target_compile_options ( libtest_common PRIVATE /bigobj )
endif ( )
endif ( )
if ( protobuf_BUILD_SHARED_LIBS )
target_compile_definitions ( libtest_common
P U B L I C P R O T O B U F _ U S E _ D L L S
P R I V A T E L I B P R O T O B U F _ T E S T _ E X P O R T S )
endif ( )
add_executable ( tests ${ tests_files } ${ common_test_files } )
add_executable ( tests ${ tests_files } ${ common_test_files } )
if ( MSVC )
if ( MSVC )
@ -155,7 +139,7 @@ target_link_libraries(test_plugin
G T e s t : : g m o c k
G T e s t : : g m o c k
)
)
add_library ( libtest_common_lite ${ protobuf_SHARED_OR_ STATIC}
add_library ( libtest_common_lite STATIC
$ { l i t e _ t e s t _ p r o t o _ f i l e s }
$ { l i t e _ t e s t _ p r o t o _ f i l e s }
)
)
target_link_libraries ( libtest_common_lite
target_link_libraries ( libtest_common_lite
@ -163,11 +147,6 @@ target_link_libraries(libtest_common_lite
$ { p r o t o b u f _ A B S L _ U S E D _ T A R G E T S }
$ { p r o t o b u f _ A B S L _ U S E D _ T A R G E T S }
G T e s t : : g m o c k
G T e s t : : g m o c k
)
)
if ( protobuf_BUILD_SHARED_LIBS )
target_compile_definitions ( libtest_common_lite
P U B L I C P R O T O B U F _ U S E _ D L L S
P R I V A T E L I B P R O T O B U F _ T E S T _ E X P O R T S )
endif ( )
add_executable ( lite-test
add_executable ( lite-test
$ { p r o t o b u f _ l i t e _ t e s t _ f i l e s }
$ { p r o t o b u f _ l i t e _ t e s t _ f i l e s }