Permalink
Browse files

Merge branch 'master' into down-integrate

  • Loading branch information...
acozzette committed Dec 1, 2017
2 parents 92a7e77 + a711e3d commit 0ba8eea655a5e40d19ab95c773192b5d908c5a61
Showing with 2,945 additions and 5,853 deletions.
  1. +62 −62 .travis.yml
  2. +2 −0 BUILD
  3. +77 −1 CHANGES.txt
  4. +20 −9 Makefile.am
  5. +1 −1 Protobuf.podspec
  6. +5 −2 cmake/CMakeLists.txt
  7. +0 −1 cmake/extract_includes.bat.in
  8. +22 −10 cmake/install.cmake
  9. +11 −1 configure.ac
  10. +16 −0 conformance/conformance_test.cc
  11. +1 −1 csharp/Google.Protobuf.Tools.nuspec
  12. +11 −19 csharp/generate_protos.sh
  13. +3 −0 csharp/protos/README.md
  14. +2 −6 {src/google/protobuf → csharp/protos}/map_unittest_proto3.proto
  15. +1 −13 {src/google/protobuf → csharp/protos}/unittest_import_proto3.proto
  16. +0 −1 {src/google/protobuf → csharp/protos}/unittest_import_public_proto3.proto
  17. +0 −1 csharp/protos/unittest_issues.proto
  18. +379 −0 csharp/protos/unittest_proto3.proto
  19. +3 −3 csharp/src/Google.Protobuf.Test/JsonFormatterTest.cs
  20. +2 −2 csharp/src/Google.Protobuf.Test/JsonParserTest.cs
  21. +22 −12 csharp/src/Google.Protobuf.Test/Reflection/DescriptorsTest.cs
  22. +127 −127 csharp/src/Google.Protobuf.Test/TestProtos/MapUnittestProto3.cs
  23. +10 −7 csharp/src/Google.Protobuf.Test/TestProtos/TestMessagesProto3.cs
  24. +9 −11 csharp/src/Google.Protobuf.Test/TestProtos/UnittestImportProto3.cs
  25. +7 −7 csharp/src/Google.Protobuf.Test/TestProtos/UnittestImportPublicProto3.cs
  26. +2 −2 csharp/src/Google.Protobuf.Test/TestProtos/UnittestIssues.cs
  27. +140 −134 csharp/src/Google.Protobuf.Test/TestProtos/UnittestProto3.cs
  28. +36 −9 csharp/src/Google.Protobuf.Test/TestProtos/UnittestWellKnownTypes.cs
  29. +3 −3 csharp/src/Google.Protobuf.Test/WellKnownTypes/AnyTest.cs
  30. +1 −1 csharp/src/Google.Protobuf/Google.Protobuf.csproj
  31. +1 −1 csharp/src/Google.Protobuf/JsonTokenizer.cs
  32. +1 −0 docs/third_party.md
  33. +1 −1 java/core/pom.xml
  34. +71 −33 java/core/src/main/java/com/google/protobuf/CodedInputStream.java
  35. +32 −3 java/core/src/main/java/com/google/protobuf/UnsafeUtil.java
  36. +483 −1 java/core/src/main/java/com/google/protobuf/Utf8.java
  37. +325 −0 java/core/src/test/java/com/google/protobuf/DecodeUtf8Test.java
  38. +9 −0 java/core/src/test/java/com/google/protobuf/IsValidUtf8TestUtil.java
  39. +1 −1 java/pom.xml
  40. +1 −1 java/util/pom.xml
  41. +1 −1 js/package.json
  42. +5 −21 objectivec/DevTools/full_mac_build.sh
  43. +1 −1 objectivec/GPBCodedOutputStream.m
  44. +35 −2,835 objectivec/GPBDictionary.h
  45. +0 −1,953 objectivec/GPBDictionary.m
  46. +9 −4 objectivec/GPBMessage.m
  47. +8 −0 objectivec/GPBRootObject.m
  48. +288 −17 objectivec/GPBUtilities.m
  49. +2 −1 objectivec/GPBUtilities_PackagePrivate.h
  50. +0 −2 objectivec/ProtocolBuffers_iOS.xcodeproj/project.pbxproj
  51. +1 −1 objectivec/Tests/GPBCodedInputStreamTests.m
  52. +56 −24 objectivec/Tests/GPBDictionaryTests+Bool.m
  53. +67 −38 objectivec/Tests/GPBDictionaryTests+Int32.m
  54. +67 −38 objectivec/Tests/GPBDictionaryTests+Int64.m
  55. +60 −35 objectivec/Tests/GPBDictionaryTests+String.m
  56. +67 −38 objectivec/Tests/GPBDictionaryTests+UInt32.m
  57. +67 −38 objectivec/Tests/GPBDictionaryTests+UInt64.m
  58. +18 −17 objectivec/Tests/GPBDictionaryTests.pddm
  59. +4 −4 objectivec/Tests/GPBMessageTests+Serialization.m
  60. +4 −2 objectivec/Tests/GPBMessageTests.m
  61. +58 −22 objectivec/Tests/iOSTestHarness/Images.xcassets/AppIcon.appiconset/Contents.json
  62. BIN objectivec/Tests/iOSTestHarness/Images.xcassets/AppIcon.appiconset/appicon_1024.png
  63. BIN objectivec/Tests/iOSTestHarness/Images.xcassets/AppIcon.appiconset/appicon_120.png
  64. BIN objectivec/Tests/iOSTestHarness/Images.xcassets/AppIcon.appiconset/appicon_152.png
  65. BIN objectivec/Tests/iOSTestHarness/Images.xcassets/AppIcon.appiconset/appicon_167.png
  66. BIN objectivec/Tests/iOSTestHarness/Images.xcassets/AppIcon.appiconset/appicon_180.png
  67. BIN objectivec/Tests/iOSTestHarness/Images.xcassets/AppIcon.appiconset/appicon_20.png
  68. BIN objectivec/Tests/iOSTestHarness/Images.xcassets/AppIcon.appiconset/appicon_29.png
  69. BIN objectivec/Tests/iOSTestHarness/Images.xcassets/AppIcon.appiconset/appicon_40.png
  70. BIN objectivec/Tests/iOSTestHarness/Images.xcassets/AppIcon.appiconset/appicon_58.png
  71. BIN objectivec/Tests/iOSTestHarness/Images.xcassets/AppIcon.appiconset/appicon_60.png
  72. BIN objectivec/Tests/iOSTestHarness/Images.xcassets/AppIcon.appiconset/appicon_76.png
  73. BIN objectivec/Tests/iOSTestHarness/Images.xcassets/AppIcon.appiconset/appicon_80.png
  74. BIN objectivec/Tests/iOSTestHarness/Images.xcassets/AppIcon.appiconset/appicon_87.png
  75. BIN objectivec/Tests/iOSTestHarness/Images.xcassets/AppIcon.appiconset/iPad6.png
  76. BIN objectivec/Tests/iOSTestHarness/Images.xcassets/AppIcon.appiconset/iPad6_2x.png
  77. BIN objectivec/Tests/iOSTestHarness/Images.xcassets/AppIcon.appiconset/iPad7.png
  78. BIN objectivec/Tests/iOSTestHarness/Images.xcassets/AppIcon.appiconset/iPad7_2x.png
  79. BIN objectivec/Tests/iOSTestHarness/Images.xcassets/AppIcon.appiconset/iPhone6.png
  80. BIN objectivec/Tests/iOSTestHarness/Images.xcassets/AppIcon.appiconset/iPhone6_2x.png
  81. BIN objectivec/Tests/iOSTestHarness/Images.xcassets/AppIcon.appiconset/iPhone7_2x.png
  82. BIN objectivec/Tests/iOSTestHarness/Images.xcassets/AppIcon.appiconset/iPhone7_3x.png
  83. +6 −19 objectivec/Tests/iOSTestHarness/Images.xcassets/LaunchImage.launchimage/Contents.json
  84. +1 −1 php/README.md
  85. +9 −0 php/ext/google/protobuf/encode_decode.c
  86. +1 −0 php/ext/google/protobuf/message.c
  87. +19 −3 php/ext/google/protobuf/package.xml
  88. +9 −20 php/ext/google/protobuf/protobuf.h
  89. +3 −4 php/src/Google/Protobuf/Any.php
  90. +15 −5 php/src/Google/Protobuf/Internal/Message.php
  91. +7 −0 php/tests/encode_decode_test.php
  92. +1 −1 post_process_dist.sh
  93. +10 −6 protoc-artifacts/README.md
  94. +13 −0 protoc-artifacts/build-protoc.sh
  95. +3 −1 protoc-artifacts/build-zip.sh
  96. +1 −1 protoc-artifacts/pom.xml
  97. +3 −0 python/MANIFEST.in
  98. +1 −1 python/google/protobuf/__init__.py
  99. +1 −1 python/google/protobuf/internal/well_known_types_test.py
  100. +12 −4 ruby/ext/google/protobuf_c/storage.c
  101. +1 −1 ruby/google-protobuf.gemspec
  102. +6 −0 ruby/tests/repeated_field_test.rb
  103. +3 −7 src/Makefile.am
  104. +2 −2 src/google/protobuf/any.pb.h
  105. +2 −2 src/google/protobuf/api.pb.h
  106. +1 −1 src/google/protobuf/compiler/command_line_interface.cc
  107. +1 −1 src/google/protobuf/compiler/command_line_interface_unittest.cc
  108. +1 −1 src/google/protobuf/compiler/importer.cc
  109. +11 −6 src/google/protobuf/compiler/objectivec/objectivec_helpers.cc
  110. +27 −9 src/google/protobuf/compiler/php/php_generator.cc
  111. +9 −0 src/google/protobuf/compiler/php/php_generator.h
  112. +1 −1 src/google/protobuf/compiler/plugin.cc
  113. +2 −2 src/google/protobuf/compiler/plugin.pb.h
  114. +2 −2 src/google/protobuf/descriptor.pb.h
  115. +2 −2 src/google/protobuf/duration.pb.h
  116. +2 −2 src/google/protobuf/empty.pb.h
  117. +2 −2 src/google/protobuf/field_mask.pb.h
  118. +0 −3 src/google/protobuf/io/zero_copy_stream_impl.cc
  119. +0 −3 src/google/protobuf/io/zero_copy_stream_unittest.cc
  120. +1 −1 src/google/protobuf/message_unittest.cc
  121. +2 −2 src/google/protobuf/source_context.pb.h
  122. +2 −2 src/google/protobuf/struct.pb.h
  123. +2 −7 src/google/protobuf/stubs/atomicops.h
  124. +0 −122 src/google/protobuf/stubs/atomicops_internals_atomicword_compat.h
  125. +8 −0 src/google/protobuf/stubs/atomicops_internals_generic_gcc.h
  126. +5 −5 src/google/protobuf/stubs/common.h
  127. +2 −2 src/google/protobuf/stubs/io_win32.cc
  128. +0 −6 src/google/protobuf/stubs/io_win32.h
  129. +2 −2 src/google/protobuf/stubs/io_win32_unittest.cc
  130. +1 −1 src/google/protobuf/testing/file.cc
  131. +1 −1 src/google/protobuf/testing/googletest.cc
  132. +2 −2 src/google/protobuf/timestamp.pb.h
  133. +2 −2 src/google/protobuf/type.pb.h
  134. +2 −2 src/google/protobuf/wrappers.pb.h
  135. +5 −3 tests.sh
View
@@ -1,63 +1,74 @@
sudo: required
dist: trusty
# Note: travis currently does not support listing more than one language so
# this cheats and claims to only be cpp. If they add multiple language
# support, this should probably get updated to install steps and/or
# rvm/gemfile/jdk/etc. entries rather than manually doing the work.
# Everything is driven by the test.sh, so the language doesn't really
# matter, it just controls the default install/script/etc. steps on
# travis.
language: cpp
os:
- osx
# The Objective C build needs Xcode 7.0 or later.
osx_image: xcode8.3
script:
- ./tests.sh $CONFIG
env:
- CONFIG=cpp
- CONFIG=cpp_distcheck
- CONFIG=golang
- CONFIG=java_jdk7
- CONFIG=java_oracle7
- CONFIG=javanano_jdk7
- CONFIG=javanano_oracle7
- CONFIG=javascript
# iOS build log was starting to choke travis UI, so split to cover the
# Xcode Debug and Release Configurations independently.
- CONFIG=objectivec_ios_debug
- CONFIG=objectivec_ios_release
- CONFIG=objectivec_osx
- CONFIG=objectivec_cocoapods_integration
- CONFIG=python
- CONFIG=python_cpp
- CONFIG=ruby21
- CONFIG=ruby22
- CONFIG=jruby
- CONFIG=php5.6_mac
- CONFIG=php7.0_mac
script: ./tests.sh $CONFIG
# The test matrix is manually built to cover a mix of linux and macOS
# hosted setups; this lets some extra settings be done specific to each
# host/language instead of forcing common values on all the tests.
matrix:
exclude:
# It's nontrivial to programmatically install a new JDK from the command
# line on OS X, so we rely on testing on Linux for Java code.
include:
# -----------------------------------------------------------------
# macOS hosted tests for Objective-C
- os: osx
env: CONFIG=objectivec_osx
osx_image: xcode9.1
language: objective-c
# iOS build log was starting to choke travis UI, so split to cover the
# Xcode Debug and Release Configurations independently.
- os: osx
env: CONFIG=java_jdk7
env: CONFIG=objectivec_ios_debug
osx_image: xcode9.1
language: objective-c
- os: osx
env: CONFIG=java_oracle7
env: CONFIG=objectivec_ios_release
osx_image: xcode9.1
language: objective-c
- os: osx
env: CONFIG=javanano_jdk7
env: CONFIG=objectivec_cocoapods_integration
osx_image: xcode9.1
language: objective-c
# -----------------------------------------------------------------
# macOS hosted tests for other languages.
- os: osx
env: CONFIG=javanano_oracle7
# Requires installing golang, currently travis.sh is doing that with apt-get
# which doesn't work on OS X.
env: CONFIG=cpp
- os: osx
env: CONFIG=golang
include:
env: CONFIG=cpp_distcheck
- os: osx
env: CONFIG=javascript
- os: osx
env: CONFIG=python
- os: osx
env: CONFIG=python_cpp
- os: osx
env: CONFIG=php5.6_mac
# Xcode versions force a host version of macOS:
# https://docs.travis-ci.com/user/reference/osx/#OS-X-Version
# Force macOS 10.12, the default travis image is going to be
# updated "soon", at which point this came come out:
# https://blog.travis-ci.com/2017-10-16-a-new-default-os-x-image-is-coming
osx_image: xcode8.3
- os: osx
env: CONFIG=php7.0_mac
# Same note about macOS version as on the php5.6_mac config.
osx_image: xcode8.3
# -----------------------------------------------------------------
# Linux hosted tests
# The dotnet environment requires Ubuntu 14.04 or 16.04. This
# configuration is effectively an "extra" one, outside the
# autogenerated matrix.
- os: linux
env: CONFIG=csharp
language: csharp
dist: trusty
dotnet: 1.0.1
sudo: required
dotnet: 1.0.4
mono: none
# This test is kept on travis because it doesn't play nicely with other
# tests on jenkins running in parallel.
@@ -67,25 +78,14 @@ matrix:
# fetch pre-built Linux protoc binaries in the test.
- os: linux
env: CONFIG=java_compatibility
sudo: required
dist: trusty
# The Python compatibility test currently only runs on Linux because it will
# fetch pre-built Linux protoc binaries in the test.
- os: linux
env: CONFIG=python_compatibility
allow_failures:
# These currently do not work on OS X but are being worked on by @haberman.
- os: osx
env: CONFIG=ruby22
- os: osx
env: CONFIG=jruby
# https://github.com/google/protobuf/issues/1253 - Started failing when
# we moved to an OS X image that is 10.11.
- os: osx
env: CONFIG=python_cpp
# Mark the iOS test as flakey as xcodebuild some times fails to start the
# iOS Simulator.
- os: osx
env: CONFIG=objectivec_ios_debug
- os: osx
env: CONFIG=objectivec_ios_release
sudo: required
dist: trusty
notifications:
email: false
View
2 BUILD
@@ -24,6 +24,8 @@ COPTS = select({
"-Woverloaded-virtual",
"-Wno-sign-compare",
"-Wno-unused-function",
# Prevents ISO C++ const string assignment warnings for pyext sources.
"-Wno-writable-strings",
],
})
View
@@ -1,3 +1,79 @@
2017-11-13 version 3.5.0 (C++/Java/Python/PHP/Objective-C/C#/Ruby/JavaScript)
Planned Future Changes
* Make C++ implementation C++11 only: we plan to require C++11 to build
protobuf code starting from 3.6.0 release. Please join this github issue:
https://github.com/google/protobuf/issues/2780 to provide your feedback.
General
* Unknown fields are now preserved in proto3 for most of the language
implementations for proto3 by default. See the per-language section for
details.
* reserve keyword are now supported in enums
C++
* Proto3 messages are now preserving unknown fields by default. If you rely on
unknowns fields being dropped. Please use DiscardUnknownFields() explicitly.
* Deprecated the unsafe_arena_release_* and unsafe_arena_add_allocated_*
methods for string fields.
* Added move constructor and move assignment to RepeatedField,
RepeatedPtrField and google::protobuf::Any.
* Added perfect forwarding in Arena::CreateMessage
* In-progress experimental support for implicit weak fields with lite protos.
This feature allows the linker to strip out more unused messages and reduce
binary size.
* Various performance optimizations.
Java
* Proto3 messages are now preserving unknown fields by default. If you’d like
to drop unknown fields, please use the DiscardUnknownFieldsParser API. For
example:
Parser<Foo> parser = DiscardUnknownFieldsParser.wrap(Foo.parser());
Foo foo = parser.parseFrom(input);
* Added a new CodedInputStream decoder for Iterable<ByteBuffer> with direct
ByteBuffers.
* TextFormat now prints unknown length-delimited fields as messages if
possible.
* FieldMaskUtil.merge() no longer creates unnecessary empty messages when a
message field is unset in both source message and destination message.
* Various performance optimizations.
Python
* Proto3 messages are now preserving unknown fields by default. Use
message.DiscardUnknownFields() to drop unknown fields.
* Add FieldDescriptor.file in generated code.
* Add descriptor pool FindOneofByName in pure python.
* Change unknown enum values into unknown field set .
* Add more Python dict/list compatibility for Struct/ListValue.
* Add utf-8 support for text_format.Merge()/Parse().
* Support numeric unknown enum values for proto3 JSON format.
* Add warning for Unexpected end-group tag in cpp extension.
PHP
* Proto3 messages are now preserving unknown fields.
* Provide well known type messages in runtime.
* Add prefix ‘PB’ to generated class of reserved names.
* Fixed all conformance tests for encode/decode json in php runtime. C
extension needs more work.
Objective-C
* Fixed some issues around copying of messages with unknown fields and then
mutating the unknown fields in the copy.
C#
* Added unknown field support in JsonParser.
* Fixed oneof message field merge.
* Simplify parsing messages from array slices.
Ruby
* Unknown fields are now preserved by default.
* Fixed several bugs for segment fault.
Javascript
* Decoder can handle both paced and unpacked data no matter how the proto is
defined.
* Decoder now accept long varint for 32 bit integers.
2017-08-14 version 3.4.0 (C++/Java/Python/PHP/Objective-C/C#/Ruby/JavaScript)
Planned Future Changes
* There are some changes that are not included in this release but are planned
@@ -92,7 +168,7 @@
* Note: AppEngine 2.5 is deprecated on June 2017 that AppEngine 2.5 will
never update protobuf runtime. Users who depend on AppEngine 2.5 should use
old protoc.
PHP
* Support PHP generic services. Specify file option php_generic_service=true
to enable generating service interface.
View
@@ -61,8 +61,13 @@ csharp_EXTRA_DIST= \
csharp/keys/Google.Protobuf.public.snk \
csharp/keys/Google.Protobuf.snk \
csharp/keys/README.md \
csharp/protos/README.md \
csharp/protos/map_unittest_proto3.proto \
csharp/protos/unittest_custom_options_proto3.proto \
csharp/protos/unittest_import_public_proto3.proto \
csharp/protos/unittest_import_proto3.proto \
csharp/protos/unittest_issues.proto \
csharp/protos/unittest_proto3.proto \
csharp/src/AddressBook/AddPerson.cs \
csharp/src/AddressBook/Addressbook.cs \
csharp/src/AddressBook/AddressBook.csproj \
@@ -281,6 +286,7 @@ java_EXTRA_DIST=
java/core/src/test/java/com/google/protobuf/CheckUtf8Test.java \
java/core/src/test/java/com/google/protobuf/CodedInputStreamTest.java \
java/core/src/test/java/com/google/protobuf/CodedOutputStreamTest.java \
java/core/src/test/java/com/google/protobuf/DecodeUtf8Test.java \
java/core/src/test/java/com/google/protobuf/DeprecatedFieldTest.java \
java/core/src/test/java/com/google/protobuf/DescriptorsTest.java \
java/core/src/test/java/com/google/protobuf/DiscardUnknownFieldsTest.java \
@@ -553,15 +559,20 @@ objectivec_EXTRA_DIST= \
objectivec/Tests/GPBWireFormatTests.m \
objectivec/Tests/iOSTestHarness/AppDelegate.m \
objectivec/Tests/iOSTestHarness/en.lproj/InfoPlist.strings \
objectivec/Tests/iOSTestHarness/Images.xcassets/AppIcon.appiconset/Contents.json \
objectivec/Tests/iOSTestHarness/Images.xcassets/AppIcon.appiconset/iPad6.png \
objectivec/Tests/iOSTestHarness/Images.xcassets/AppIcon.appiconset/iPad6_2x.png \
objectivec/Tests/iOSTestHarness/Images.xcassets/AppIcon.appiconset/iPad7.png \
objectivec/Tests/iOSTestHarness/Images.xcassets/AppIcon.appiconset/iPad7_2x.png \
objectivec/Tests/iOSTestHarness/Images.xcassets/AppIcon.appiconset/iPhone6.png \
objectivec/Tests/iOSTestHarness/Images.xcassets/AppIcon.appiconset/iPhone6_2x.png \
objectivec/Tests/iOSTestHarness/Images.xcassets/AppIcon.appiconset/iPhone7_2x.png \
objectivec/Tests/iOSTestHarness/Images.xcassets/AppIcon.appiconset/iPhone7_3x.png \
objectivec/Tests/iOSTestHarness/Images.xcassets/AppIcon.appiconset/appicon_20.png \
objectivec/Tests/iOSTestHarness/Images.xcassets/AppIcon.appiconset/appicon_29.png \
objectivec/Tests/iOSTestHarness/Images.xcassets/AppIcon.appiconset/appicon_40.png \
objectivec/Tests/iOSTestHarness/Images.xcassets/AppIcon.appiconset/appicon_58.png \
objectivec/Tests/iOSTestHarness/Images.xcassets/AppIcon.appiconset/appicon_60.png \
objectivec/Tests/iOSTestHarness/Images.xcassets/AppIcon.appiconset/appicon_76.png \
objectivec/Tests/iOSTestHarness/Images.xcassets/AppIcon.appiconset/appicon_80.png \
objectivec/Tests/iOSTestHarness/Images.xcassets/AppIcon.appiconset/appicon_87.png \
objectivec/Tests/iOSTestHarness/Images.xcassets/AppIcon.appiconset/appicon_120.png \
objectivec/Tests/iOSTestHarness/Images.xcassets/AppIcon.appiconset/appicon_152.png \
objectivec/Tests/iOSTestHarness/Images.xcassets/AppIcon.appiconset/appicon_167.png \
objectivec/Tests/iOSTestHarness/Images.xcassets/AppIcon.appiconset/appicon_180.png \
objectivec/Tests/iOSTestHarness/Images.xcassets/AppIcon.appiconset/appicon_1024.png \
objectivec/Tests/iOSTestHarness/Images.xcassets/AppIcon.appiconset/Contents.json \
objectivec/Tests/iOSTestHarness/Images.xcassets/LaunchImage.launchimage/Contents.json \
objectivec/Tests/iOSTestHarness/Info.plist \
objectivec/Tests/iOSTestHarness/LaunchScreen.xib \
View
@@ -5,7 +5,7 @@
# dependent projects use the :git notation to refer to the library.
Pod::Spec.new do |s|
s.name = 'Protobuf'
s.version = '3.4.1'
s.version = '3.5.0'
s.summary = 'Protocol Buffers v.3 runtime library for Objective-C.'
s.homepage = 'https://github.com/google/protobuf'
s.license = '3-Clause BSD License'
View
@@ -14,6 +14,7 @@ project(protobuf C CXX)
# Options
option(protobuf_BUILD_TESTS "Build tests" ON)
option(protobuf_BUILD_EXAMPLES "Build examples" OFF)
option(protobuf_BUILD_PROTOC_BINARIES "Build libprotoc and protoc compiler" ON)
if (BUILD_SHARED_LIBS)
set(protobuf_BUILD_SHARED_LIBS_DEFAULT ON)
else (BUILD_SHARED_LIBS)
@@ -184,8 +185,10 @@ endif (protobuf_UNICODE)
include(libprotobuf-lite.cmake)
include(libprotobuf.cmake)
include(libprotoc.cmake)
include(protoc.cmake)
if (protobuf_BUILD_PROTOC_BINARIES)
include(libprotoc.cmake)
include(protoc.cmake)
endif (protobuf_BUILD_PROTOC_BINARIES)
if (protobuf_BUILD_TESTS)
include(tests.cmake)
@@ -83,7 +83,6 @@ copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\stubs\atomicops.h" in
copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\stubs\atomicops_internals_arm64_gcc.h" include\google\protobuf\stubs\atomicops_internals_arm64_gcc.h
copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\stubs\atomicops_internals_arm_gcc.h" include\google\protobuf\stubs\atomicops_internals_arm_gcc.h
copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\stubs\atomicops_internals_arm_qnx.h" include\google\protobuf\stubs\atomicops_internals_arm_qnx.h
copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\stubs\atomicops_internals_atomicword_compat.h" include\google\protobuf\stubs\atomicops_internals_atomicword_compat.h
copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\stubs\atomicops_internals_generic_c11_atomic.h" include\google\protobuf\stubs\atomicops_internals_generic_c11_atomic.h
copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\stubs\atomicops_internals_generic_gcc.h" include\google\protobuf\stubs\atomicops_internals_generic_gcc.h
copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\stubs\atomicops_internals_mips_gcc.h" include\google\protobuf\stubs\atomicops_internals_mips_gcc.h
View
@@ -5,10 +5,12 @@ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/protobuf.pc.cmake
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/protobuf-lite.pc.cmake
${CMAKE_CURRENT_BINARY_DIR}/protobuf-lite.pc @ONLY)
foreach(_library
libprotobuf-lite
libprotobuf
libprotoc)
set(_protobuf_libraries libprotobuf-lite libprotobuf)
if (protobuf_BUILD_PROTOC_BINARIES)
list(APPEND _protobuf_libraries libprotoc)
endif (protobuf_BUILD_PROTOC_BINARIES)
foreach(_library ${_protobuf_libraries})
set_property(TARGET ${_library}
PROPERTY INTERFACE_INCLUDE_DIRECTORIES
$<BUILD_INTERFACE:${protobuf_source_dir}/src>
@@ -19,8 +21,10 @@ foreach(_library
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT ${_library})
endforeach()
install(TARGETS protoc EXPORT protobuf-targets
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT protoc)
if (protobuf_BUILD_PROTOC_BINARIES)
install(TARGETS protoc EXPORT protobuf-targets
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT protoc)
endif (protobuf_BUILD_PROTOC_BINARIES)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/protobuf.pc ${CMAKE_CURRENT_BINARY_DIR}/protobuf-lite.pc DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig")
@@ -101,10 +105,18 @@ configure_file(protobuf-options.cmake
${CMAKE_INSTALL_CMAKEDIR}/protobuf-options.cmake @ONLY)
# Allows the build directory to be used as a find directory.
export(TARGETS libprotobuf-lite libprotobuf libprotoc protoc
NAMESPACE protobuf::
FILE ${CMAKE_INSTALL_CMAKEDIR}/protobuf-targets.cmake
)
if (protobuf_BUILD_PROTOC_BINARIES)
export(TARGETS libprotobuf-lite libprotobuf libprotoc protoc
NAMESPACE protobuf::
FILE ${CMAKE_INSTALL_CMAKEDIR}/protobuf-targets.cmake
)
else (protobuf_BUILD_PROTOC_BINARIES)
export(TARGETS libprotobuf-lite libprotobuf
NAMESPACE protobuf::
FILE ${CMAKE_INSTALL_CMAKEDIR}/protobuf-targets.cmake
)
endif (protobuf_BUILD_PROTOC_BINARIES)
install(EXPORT protobuf-targets
DESTINATION "${CMAKE_INSTALL_CMAKEDIR}"
Oops, something went wrong.

0 comments on commit 0ba8eea

Please sign in to comment.