Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3)

Issue 11231046: Linux: add an option to build with system protobuf. (Closed)

Created:
8 years, 2 months ago by Paweł Hajdan Jr.
Modified:
8 years, 1 month ago
Reviewers:
ncarter (slow), agl
CC:
chromium-reviews
Visibility:
Public.

Description

Linux: add an option to build with system protobuf. This doesn't work yet without upstream protobuf changes, but with this infrastructure in place it's going to be easier to test further updates. Google Chrome will of course use the bundled version, there's no change here. BUG=157155 TEST=none Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=165257

Patch Set 1 #

Total comments: 1

Patch Set 2 : fix gyp #

Patch Set 3 : rewrap #

Patch Set 4 : rebased #

Unified diffs Side-by-side diffs Delta from patch set Stats (+400 lines, -351 lines) Patch
M build/common.gypi View 1 2 3 1 chunk +3 lines, -0 lines 0 comments Download
M build/protoc.gypi View 1 chunk +7 lines, -1 line 0 comments Download
M third_party/protobuf/protobuf.gyp View 1 2 3 1 chunk +390 lines, -350 lines 0 comments Download

Messages

Total messages: 9 (0 generated)
Paweł Hajdan Jr.
8 years, 2 months ago (2012-10-22 16:14:08 UTC) #1
agl
We need unknown field retention, which upstream aren't going to accept. So building with the ...
8 years, 2 months ago (2012-10-22 16:16:17 UTC) #2
Paweł Hajdan Jr.
PTAL assuming https://codereview.chromium.org/11228038/ gets landed.
8 years, 2 months ago (2012-10-22 22:55:59 UTC) #3
agl
LGTM https://codereview.chromium.org/11231046/diff/1/third_party/protobuf/protobuf.gyp File third_party/protobuf/protobuf.gyp (right): https://codereview.chromium.org/11231046/diff/1/third_party/protobuf/protobuf.gyp#newcode375 third_party/protobuf/protobuf.gyp:375: # This macro must be defined to suppress ...
8 years, 2 months ago (2012-10-23 13:58:44 UTC) #4
Paweł Hajdan Jr.
I wasn't sure how to rewrap the rest (really commented code instead of a text ...
8 years, 1 month ago (2012-10-29 21:17:50 UTC) #5
Paweł Hajdan Jr.
ping
8 years, 1 month ago (2012-10-31 18:02:35 UTC) #6
agl
lgtm
8 years, 1 month ago (2012-10-31 18:09:12 UTC) #7
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/phajdan.jr@chromium.org/11231046/7004
8 years, 1 month ago (2012-10-31 22:35:24 UTC) #8
commit-bot: I haz the power
8 years, 1 month ago (2012-10-31 22:35:26 UTC) #9
Failed to apply patch for third_party/protobuf/protobuf.gyp:
While running patch -p1 --forward --force --no-backup-if-mismatch;
  patching file third_party/protobuf/protobuf.gyp
  Hunk #1 FAILED at 4.
  1 out of 1 hunk FAILED -- saving rejects to file
third_party/protobuf/protobuf.gyp.rej

Patch:       third_party/protobuf/protobuf.gyp
Index: third_party/protobuf/protobuf.gyp
diff --git a/third_party/protobuf/protobuf.gyp
b/third_party/protobuf/protobuf.gyp
index
6b060f2d5c6efad576562b588fbc8b5e2580159d..32f17cc79641add230b8ada23fcc943b95a692a9
100644
--- a/third_party/protobuf/protobuf.gyp
+++ b/third_party/protobuf/protobuf.gyp
@@ -4,357 +4,397 @@
 
 {
   'conditions': [
-    ['OS!="win"', {
-      'variables': {
-        'config_h_dir':
-          '.',  # crafted for gcc/linux.
-      },
-    }, {  # else, OS=="win"
-      'variables': {
-        'config_h_dir':
-          'vsprojects',  # crafted for msvc.
-      },
-      'target_defaults': {
-        'msvs_disabled_warnings': [
-          4018,  # signed/unsigned mismatch in comparison
-          4244,  # implicit conversion, possible loss of data
-          4355,  # 'this' used in base member initializer list
-        ],
-        'defines!': [
-          'WIN32_LEAN_AND_MEAN',  # Protobuf defines this itself.
-        ],
-      },
-    }]
-  ],
-  'targets': [
-    # The "lite" lib is about 1/7th the size of the heavy lib,
-    # but it doesn't support some of the more exotic features of
-    # protobufs, like reflection.  To generate C++ code that can link
-    # against the lite version of the library, add the option line:
-    #
-    #   option optimize_for = LITE_RUNTIME;
-    #
-    # to your .proto file.
-    {
-      'target_name': 'protobuf_lite',
-      'type': 'static_library',
-      'toolsets': ['host', 'target'],
-      'sources': [
-        'src/google/protobuf/stubs/atomicops.h',
-        'src/google/protobuf/stubs/atomicops_internals_arm_gcc.h',
-        'src/google/protobuf/stubs/atomicops_internals_atomicword_compat.h',
-        'src/google/protobuf/stubs/atomicops_internals_macosx.h',
-        'src/google/protobuf/stubs/atomicops_internals_mips_gcc.h',
-        'src/google/protobuf/stubs/atomicops_internals_x86_gcc.cc',
-        'src/google/protobuf/stubs/atomicops_internals_x86_gcc.h',
-        'src/google/protobuf/stubs/atomicops_internals_x86_msvc.cc',
-        'src/google/protobuf/stubs/atomicops_internals_x86_msvc.h',
-        'src/google/protobuf/stubs/common.h',
-        'src/google/protobuf/stubs/once.h',
-        'src/google/protobuf/stubs/platform_macros.h',
-        'src/google/protobuf/extension_set.h',
-        'src/google/protobuf/generated_message_util.h',
-        'src/google/protobuf/message_lite.h',
-        'src/google/protobuf/repeated_field.h',
-        'src/google/protobuf/unknown_field_set.cc',
-        'src/google/protobuf/unknown_field_set.h',
-        'src/google/protobuf/wire_format_lite.h',
-        'src/google/protobuf/wire_format_lite_inl.h',
-        'src/google/protobuf/io/coded_stream.h',
-        'src/google/protobuf/io/zero_copy_stream.h',
-        'src/google/protobuf/io/zero_copy_stream_impl_lite.h',
-
-        'src/google/protobuf/stubs/common.cc',
-        'src/google/protobuf/stubs/once.cc',
-        'src/google/protobuf/stubs/hash.h',
-        'src/google/protobuf/stubs/map-util.h',
-        'src/google/protobuf/stubs/stl_util-inl.h',
-        'src/google/protobuf/extension_set.cc',
-        'src/google/protobuf/generated_message_util.cc',
-        'src/google/protobuf/message_lite.cc',
-        'src/google/protobuf/repeated_field.cc',
-        'src/google/protobuf/wire_format_lite.cc',
-        'src/google/protobuf/io/coded_stream.cc',
-        'src/google/protobuf/io/coded_stream_inl.h',
-        'src/google/protobuf/io/zero_copy_stream.cc',
-        'src/google/protobuf/io/zero_copy_stream_impl_lite.cc',
-        '<(config_h_dir)/config.h',
-      ],
-      'include_dirs': [
-        '<(config_h_dir)',
-        'src',
-      ],
-      # This macro must be defined to suppress the use of dynamic_cast<>,
-      # which requires RTTI.
-      'defines': [
-        'GOOGLE_PROTOBUF_NO_RTTI',
-        'GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER',
+    ['use_system_protobuf==0', {
+      'conditions': [
+        ['OS!="win"', {
+          'variables': {
+            'config_h_dir':
+              '.',  # crafted for gcc/linux.
+          },
+        }, {  # else, OS=="win"
+          'variables': {
+            'config_h_dir':
+              'vsprojects',  # crafted for msvc.
+          },
+          'target_defaults': {
+            'msvs_disabled_warnings': [
+              4018,  # signed/unsigned mismatch in comparison
+              4244,  # implicit conversion, possible loss of data
+              4355,  # 'this' used in base member initializer list
+            ],
+            'defines!': [
+              'WIN32_LEAN_AND_MEAN',  # Protobuf defines this itself.
+            ],
+          },
+        }]
       ],
+      'targets': [
+        # The "lite" lib is about 1/7th the size of the heavy lib,
+        # but it doesn't support some of the more exotic features of
+        # protobufs, like reflection.  To generate C++ code that can link
+        # against the lite version of the library, add the option line:
+        #
+        #   option optimize_for = LITE_RUNTIME;
+        #
+        # to your .proto file.
+        {
+          'target_name': 'protobuf_lite',
+          'type': 'static_library',
+          'toolsets': ['host', 'target'],
+          'sources': [
+            'src/google/protobuf/stubs/atomicops.h',
+            'src/google/protobuf/stubs/atomicops_internals_arm_gcc.h',
+           
'src/google/protobuf/stubs/atomicops_internals_atomicword_compat.h',
+            'src/google/protobuf/stubs/atomicops_internals_macosx.h',
+            'src/google/protobuf/stubs/atomicops_internals_mips_gcc.h',
+            'src/google/protobuf/stubs/atomicops_internals_x86_gcc.cc',
+            'src/google/protobuf/stubs/atomicops_internals_x86_gcc.h',
+            'src/google/protobuf/stubs/atomicops_internals_x86_msvc.cc',
+            'src/google/protobuf/stubs/atomicops_internals_x86_msvc.h',
+            'src/google/protobuf/stubs/common.h',
+            'src/google/protobuf/stubs/once.h',
+            'src/google/protobuf/stubs/platform_macros.h',
+            'src/google/protobuf/extension_set.h',
+            'src/google/protobuf/generated_message_util.h',
+            'src/google/protobuf/message_lite.h',
+            'src/google/protobuf/repeated_field.h',
+            'src/google/protobuf/unknown_field_set.cc',
+            'src/google/protobuf/unknown_field_set.h',
+            'src/google/protobuf/wire_format_lite.h',
+            'src/google/protobuf/wire_format_lite_inl.h',
+            'src/google/protobuf/io/coded_stream.h',
+            'src/google/protobuf/io/zero_copy_stream.h',
+            'src/google/protobuf/io/zero_copy_stream_impl_lite.h',
 
-      'direct_dependent_settings': {
-        'include_dirs': [
-          '<(config_h_dir)',
-          'src',
-        ],
-        'defines': [
-          'GOOGLE_PROTOBUF_NO_RTTI',
-          'GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER',
-        ],
-      },
-    },
-    # This is the full, heavy protobuf lib that's needed for c++ .proto's
-    # that don't specify the LITE_RUNTIME option.  The protocol
-    # compiler itself (protoc) falls into that category.
-    #
-    # DO NOT LINK AGAINST THIS TARGET IN CHROME CODE  --agl
-    {
-      'target_name': 'protobuf_full_do_not_use',
-      'type': 'static_library',
-      'toolsets': ['host','target'],
-      'sources': [
-        'src/google/protobuf/descriptor.h',
-        'src/google/protobuf/descriptor.pb.h',
-        'src/google/protobuf/descriptor_database.h',
-        'src/google/protobuf/dynamic_message.h',
-        'src/google/protobuf/generated_message_reflection.h',
-        'src/google/protobuf/message.h',
-        'src/google/protobuf/reflection_ops.h',
-        'src/google/protobuf/service.h',
-        'src/google/protobuf/text_format.h',
-        'src/google/protobuf/wire_format.h',
-        'src/google/protobuf/io/gzip_stream.h',
-        'src/google/protobuf/io/printer.h',
-        'src/google/protobuf/io/tokenizer.h',
-        'src/google/protobuf/io/zero_copy_stream_impl.h',
-        'src/google/protobuf/compiler/code_generator.h',
-        'src/google/protobuf/compiler/command_line_interface.h',
-        'src/google/protobuf/compiler/importer.h',
-        'src/google/protobuf/compiler/parser.h',
+            'src/google/protobuf/stubs/common.cc',
+            'src/google/protobuf/stubs/once.cc',
+            'src/google/protobuf/stubs/hash.h',
+            'src/google/protobuf/stubs/map-util.h',
+            'src/google/protobuf/stubs/stl_util-inl.h',
+            'src/google/protobuf/extension_set.cc',
+            'src/google/protobuf/generated_message_util.cc',
+            'src/google/protobuf/message_lite.cc',
+            'src/google/protobuf/repeated_field.cc',
+            'src/google/protobuf/wire_format_lite.cc',
+            'src/google/protobuf/io/coded_stream.cc',
+            'src/google/protobuf/io/coded_stream_inl.h',
+            'src/google/protobuf/io/zero_copy_stream.cc',
+            'src/google/protobuf/io/zero_copy_stream_impl_lite.cc',
+            '<(config_h_dir)/config.h',
+          ],
+          'include_dirs': [
+            '<(config_h_dir)',
+            'src',
+          ],
+          # This macro must be defined to suppress the use of dynamic_cast<>,
+          # which requires RTTI.
+          'defines': [
+            'GOOGLE_PROTOBUF_NO_RTTI',
+            'GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER',
+          ],
 
-        'src/google/protobuf/stubs/strutil.cc',
-        'src/google/protobuf/stubs/strutil.h',
-        'src/google/protobuf/stubs/substitute.cc',
-        'src/google/protobuf/stubs/substitut…
(message too large)

Powered by Google App Engine
This is Rietveld 408576698