Blob Blame History Raw
diff -pruN mozc-2.29.5111.102.orig/base/absl.gyp mozc-2.29.5111.102/base/absl.gyp
--- mozc-2.29.5111.102.orig/base/absl.gyp	2023-06-15 19:21:31.000000000 +0900
+++ mozc-2.29.5111.102/base/absl.gyp	2023-06-23 21:49:27.352060589 +0900
@@ -35,12 +35,25 @@
   'targets': [
     {
       'target_name': 'absl_base',
-      'type': 'static_library',
       'toolsets': ['host', 'target'],
-      'sources': [
-        '<!@(<(glob_absl) base "**/*.cc"' +
-        ' --exclude "**/*_benchmark.cc" "**/*_test*.cc")',
-        '<(absl_srcdir)/profiling/internal/exponential_biased.cc',
+      'conditions': [
+        ['use_system_abseil_cpp==1', {
+          'type': 'none',
+          'all_dependent_settings': {
+            'link_settings': {
+              'libraries': [
+                '-labsl_base -labsl_log_severity -labsl_raw_logging_internal -labsl_spinlock_wait -labsl_malloc_internal -labsl_throw_delegate -labsl_exponential_biased -labsl_periodic_sampler -labsl_scoped_set_env -labsl_strerror',
+              ],
+            },
+          },
+        }, {
+          'type': 'static_library',
+          'sources': [
+            '<!@(<(glob_absl) base "**/*.cc"' +
+            ' --exclude "**/*_benchmark.cc" "**/*_test*.cc")',
+            '<(absl_srcdir)/profiling/internal/exponential_biased.cc',
+          ],
+        }],
       ],
       'dependencies': [
         'absl_hash_internal',
@@ -54,18 +67,44 @@
     },
     {
       'target_name': 'absl_crc',
-      'type': 'static_library',
       'toolsets': ['host', 'target'],
-      'sources': [
-        '<!@(<(glob_absl) crc "**/*.cc")',
+      'conditions': [
+        ['use_system_abseil_cpp==1', {
+          'type': 'none',
+          'all_dependent_settings': {
+            'link_settings': {
+              'libraries': [
+                '-labsl_crc32c -labsl_crc_cord_state -labsl_crc_cpu_detect -labsl_crc_internal',
+              ],
+            },
+          },
+        }, {
+          'type': 'static_library',
+          'sources': [
+            '<!@(<(glob_absl) crc "**/*.cc")',
+          ],
+        }],
       ],
     },
     {
       'target_name': 'absl_debugging',
-      'type': 'static_library',
       'toolsets': ['host', 'target'],
-      'sources': [
-        '<!@(<(glob_absl) debugging "**/*.cc")',
+      'conditions': [
+        ['use_system_abseil_cpp==1', {
+          'type': 'none',
+          'all_dependent_settings': {
+            'link_settings': {
+              'libraries': [
+                '-labsl_debugging_internal',
+              ],
+            },
+          },
+        }, {
+          'type': 'static_library',
+          'sources': [
+            '<!@(<(glob_absl) debugging "**/*.cc")',
+          ],
+        }],
       ],
       'dependencies': [
         'absl_base',
@@ -73,10 +112,23 @@
     },
     {
       'target_name': 'absl_flags',
-      'type': 'static_library',
       'toolsets': ['host', 'target'],
-      'sources': [
-        '<!@(<(glob_absl) flags "*.cc")',
+      'conditions': [
+        ['use_system_abseil_cpp==1', {
+          'type': 'none',
+          'all_dependent_settings': {
+            'link_settings': {
+              'libraries': [
+                '-labsl_flags_program_name -labsl_flags_config -labsl_flags_marshalling -labsl_flags_commandlineflag_internal -labsl_flags_commandlineflag -labsl_flags_private_handle_accessor -labsl_flags_reflection -labsl_flags_internal -labsl_flags_usage_internal -labsl_flags_usage -labsl_flags_parse',
+              ],
+            },
+          },
+        }, {
+          'type': 'static_library',
+          'sources': [
+            '<!@(<(glob_absl) flags "*.cc")',
+          ],
+        }],
       ],
       'dependencies': [
         'absl_flags_internal',
@@ -86,10 +138,23 @@
     },
     {
       'target_name': 'absl_flags_internal',
-      'type': 'static_library',
       'toolsets': ['host', 'target'],
-      'sources': [
-        '<!@(<(glob_absl) flags/internal "*.cc" --exclude size_tester.cc)',
+      'conditions': [
+        ['use_system_abseil_cpp==1', {
+          'type': 'none',
+          'all_dependent_settings': {
+            'link_settings': {
+              'libraries': [
+                '-labsl_flags_commandlineflag_internal -labsl_flags_internal -labsl_flags_private_handle_accessor -labsl_flags_program_name -labsl_flags_usage_internal',
+              ],
+            },
+          },
+        }, {
+          'type': 'static_library',
+          'sources': [
+            '<!@(<(glob_absl) flags/internal "*.cc" --exclude size_tester.cc)',
+          ],
+        }],
       ],
       'dependencies': [
         'absl_strings',
@@ -98,19 +163,44 @@
     {
       'target_name': 'absl_hash_internal',
       'toolsets': ['host', 'target'],
-      'type': 'static_library',
-      'sources': [
-        '<(absl_srcdir)/container/internal/raw_hash_set.cc',
-        '<(absl_srcdir)/hash/internal/city.cc',
-        '<(absl_srcdir)/hash/internal/hash.cc',
-        '<(absl_srcdir)/hash/internal/low_level_hash.cc',
+      'conditions': [
+        ['use_system_abseil_cpp==1', {
+          'type': 'none',
+          'all_dependent_settings': {
+            'link_settings': {
+              'libraries': [
+                '-labsl_raw_hash_set -labsl_hash -labsl_city -labsl_low_level_hash',
+              ],
+            },
+          },
+        }, {
+          'type': 'static_library',
+          'sources': [
+            '<(absl_srcdir)/container/internal/raw_hash_set.cc',
+            '<(absl_srcdir)/hash/internal/city.cc',
+            '<(absl_srcdir)/hash/internal/hash.cc',
+            '<(absl_srcdir)/hash/internal/low_level_hash.cc',
+          ],
+        }],
       ],
     },
     {
       'target_name': 'absl_hash_testing',
       'toolsets': ['host', 'target'],
-      'type': 'static_library',
-      'sources': [],
+      'conditions': [
+        ['use_system_abseil_cpp==1', {
+          'type': 'none',
+          'all_dependent_settings': {
+            'link_settings': {
+              'libraries': [
+              ],
+            },
+          },
+        }, {
+          'type': 'static_library',
+          'sources': [],
+        }],
+      ],
       'dependencies': [
           'absl_strings',
           'absl_types',
@@ -118,13 +208,26 @@
     },
     {
       'target_name': 'absl_log',
-      'type': 'static_library',
       'toolsets': ['host', 'target'],
-      'sources': [
-        '<!@(<(glob_absl) log "*.cc")',
-      ],
-      'sources!': [
-        '<(absl_srcdir)/log/scoped_mock_log.cc',
+      'conditions': [
+        ['use_system_abseil_cpp==1', {
+          'type': 'none',
+          'all_dependent_settings': {
+            'link_settings': {
+              'libraries': [
+                '-labsl_log_entry -labsl_log_flags -labsl_log_globals -labsl_log_initialize -labsl_log_internal_check_op -labsl_log_internal_conditions -labsl_log_internal_format -labsl_log_internal_globals -labsl_log_internal_proto -labsl_log_internal_message -labsl_log_internal_sink_set -labsl_log_internal_nullguard -labsl_die_if_null -labsl_log_sink',
+              ],
+            },
+          },
+        }, {
+          'type': 'static_library',
+          'sources': [
+            '<!@(<(glob_absl) log "*.cc")',
+          ],
+          'sources!': [
+            '<(absl_srcdir)/log/scoped_mock_log.cc',
+          ],
+        }],
       ],
       'dependencies': [
         'absl_base',
@@ -134,10 +237,23 @@
     },
     {
       'target_name': 'absl_log_internal',
-      'type': 'static_library',
       'toolsets': ['host', 'target'],
-      'sources': [
-        '<!@(<(glob_absl) log/internal "*.cc")',
+      'conditions': [
+        ['use_system_abseil_cpp==1', {
+          'type': 'none',
+          'all_dependent_settings': {
+            'link_settings': {
+              'libraries': [
+                '-labsl_log_internal_check_op -labsl_log_internal_conditions -labsl_log_internal_format -labsl_log_internal_globals -labsl_log_internal_proto -labsl_log_internal_message -labsl_log_internal_sink_set -labsl_log_internal_nullguard',
+              ],
+            },
+          },
+        }, {
+          'type': 'static_library',
+          'sources': [
+            '<!@(<(glob_absl) log/internal "*.cc")',
+          ],
+        }],
       ],
       'dependencies': [
         'absl_base',
@@ -146,10 +262,23 @@
     },
     {
       'target_name': 'absl_numeric',
-      'type': 'static_library',
       'toolsets': ['host', 'target'],
-      'sources': [
-        '<(absl_srcdir)/numeric/int128.cc',
+      'conditions': [
+        ['use_system_abseil_cpp==1', {
+          'type': 'none',
+          'all_dependent_settings': {
+            'link_settings': {
+              'libraries': [
+                '-labsl_int128',
+              ],
+            },
+          },
+        }, {
+          'type': 'static_library',
+          'sources': [
+            '<(absl_srcdir)/numeric/int128.cc',
+          ],
+        }],
       ],
       'dependencies': [
         'absl_base',
@@ -157,14 +286,27 @@
     },
     {
       'target_name': 'absl_random',
-      'type': 'static_library',
       'toolsets': ['host', 'target'],
-      'sources': [
-        '<!@(<(glob_absl) random "**/*.cc"' +
-        ' --exclude "**/*benchmark*.cc" "**/*generator*.cc")',
-      ],
-      'sources!': [
-        '<(absl_srcdir)/random/internal/gaussian_distribution_gentables.cc',
+      'conditions': [
+        ['use_system_abseil_cpp==1', {
+          'type': 'none',
+          'all_dependent_settings': {
+            'link_settings': {
+              'libraries': [
+                '-labsl_random_distributions -labsl_random_internal_distribution_test_util -labsl_random_internal_platform -labsl_random_internal_pool_urbg -labsl_random_internal_randen -labsl_random_internal_randen_hwaes -labsl_random_internal_randen_hwaes_impl -labsl_random_internal_randen_slow -labsl_random_internal_seed_material -labsl_random_seed_gen_exception -labsl_random_seed_sequences',
+              ],
+            },
+          },
+        }, {
+          'type': 'static_library',
+          'sources': [
+            '<!@(<(glob_absl) random "**/*.cc"' +
+            ' --exclude "**/*benchmark*.cc" "**/*generator*.cc")',
+          ],
+          'sources!': [
+            '<(absl_srcdir)/random/internal/gaussian_distribution_gentables.cc',
+          ],
+        }],
       ],
       'dependencies': [
         'absl_base',
@@ -172,10 +314,23 @@
     },
     {
       'target_name': 'absl_status',
-      'type': 'static_library',
       'toolsets': ['host', 'target'],
-      'sources': [
-        '<!@(<(glob_absl) status "*.cc")',
+      'conditions': [
+        ['use_system_abseil_cpp==1', {
+          'type': 'none',
+          'all_dependent_settings': {
+            'link_settings': {
+              'libraries': [
+                '-labsl_status -labsl_statusor',
+              ],
+            },
+          },
+        }, {
+          'type': 'static_library',
+          'sources': [
+            '<!@(<(glob_absl) status "*.cc")',
+          ],
+        }],
       ],
       'dependencies': [
         'absl_base',
@@ -184,15 +339,28 @@
     },
     {
       'target_name': 'absl_strings_internal',
-      'type': 'static_library',
       'toolsets': ['host', 'target'],
-      'sources': [
-        '<!@(<(glob_absl) strings/internal "**/*.cc")',
-      ],
-      'sources!': [
-        '<(absl_srcdir)/strings/internal/str_format/benchmarks.cc',
-        '<(absl_srcdir)/strings/internal/str_format/extension_test_class.cc',
-        '<(absl_srcdir)/strings/internal/str_format/parser_fuzzer.cc',
+      'conditions': [
+        ['use_system_abseil_cpp==1', {
+          'type': 'none',
+          'all_dependent_settings': {
+            'link_settings': {
+              'libraries': [
+                '-labsl_strings_internal -labsl_str_format_internal',
+              ],
+            },
+          },
+        }, {
+          'type': 'static_library',
+          'sources': [
+            '<!@(<(glob_absl) strings/internal "**/*.cc")',
+          ],
+          'sources!': [
+            '<(absl_srcdir)/strings/internal/str_format/benchmarks.cc',
+            '<(absl_srcdir)/strings/internal/str_format/extension_test_class.cc',
+            '<(absl_srcdir)/strings/internal/str_format/parser_fuzzer.cc',
+          ],
+        }],
       ],
       'dependencies': [
         'absl_base',
@@ -201,10 +369,23 @@
     },
     {
       'target_name': 'absl_strings',
-      'type': 'static_library',
       'toolsets': ['host', 'target'],
-      'sources': [
-        '<!@(<(glob_absl) strings "*.cc")',
+      'conditions': [
+        ['use_system_abseil_cpp==1', {
+          'type': 'none',
+          'all_dependent_settings': {
+            'link_settings': {
+              'libraries': [
+                '-labsl_strings',
+              ],
+            },
+          },
+        }, {
+          'type': 'static_library',
+          'sources': [
+            '<!@(<(glob_absl) strings "*.cc")',
+          ],
+        }],
       ],
       'dependencies': [
         'absl_base',
@@ -215,10 +396,23 @@
     },
     {
       'target_name': 'absl_synchronization',
-      'type': 'static_library',
       'toolsets': ['host', 'target'],
-      'sources': [
-        '<!@(<(glob_absl) synchronization "**/*.cc")',
+      'conditions': [
+        ['use_system_abseil_cpp==1', {
+          'type': 'none',
+          'all_dependent_settings': {
+            'link_settings': {
+              'libraries': [
+                '-labsl_synchronization',
+              ],
+            },
+          },
+        }, {
+          'type': 'static_library',
+          'sources': [
+            '<!@(<(glob_absl) synchronization "**/*.cc")',
+          ],
+        }],
       ],
       'cflags': [
         '-Wno-error',
@@ -232,12 +426,25 @@
     },
     {
       'target_name': 'absl_time',
-      'type': 'static_library',
       'toolsets': ['host', 'target'],
-      'sources': [
-        '<!@(<(glob_absl) time "*.cc")',
-        '<!@(<(glob_absl) time/internal/cctz/src "*.cc"' +
-        ' --exclude time_tool.cc)',
+      'conditions': [
+        ['use_system_abseil_cpp==1', {
+          'type': 'none',
+          'all_dependent_settings': {
+            'link_settings': {
+              'libraries': [
+                '-labsl_time -labsl_civil_time -labsl_time_zone',
+              ],
+            },
+          },
+        }, {
+          'type': 'static_library',
+          'sources': [
+            '<!@(<(glob_absl) time "*.cc")',
+            '<!@(<(glob_absl) time/internal/cctz/src "*.cc"' +
+            ' --exclude time_tool.cc)',
+          ],
+        }],
       ],
       'cflags': [
         '-Wno-error',
@@ -250,10 +457,23 @@
     },
     {
       'target_name': 'absl_types',
-      'type': 'static_library',
       'toolsets': ['host', 'target'],
-      'sources': [
-        '<!@(<(glob_absl) types "**/*.cc")',
+      'conditions': [
+        ['use_system_abseil_cpp==1', {
+          'type': 'none',
+          'all_dependent_settings': {
+            'link_settings': {
+              'libraries': [
+                '-labsl_bad_optional_success -labsl_bad_variant_access',
+              ],
+            },
+          },
+        }, {
+          'type': 'static_library',
+          'sources': [
+            '<!@(<(glob_absl) types "**/*.cc")',
+          ],
+        }],
       ],
       'cflags': [
         '-Wno-error',
diff -pruN mozc-2.29.5111.102.orig/gyp/defines.gypi mozc-2.29.5111.102/gyp/defines.gypi
--- mozc-2.29.5111.102.orig/gyp/defines.gypi	2023-01-10 15:13:50.000000000 +0900
+++ mozc-2.29.5111.102/gyp/defines.gypi	2023-06-23 21:47:02.371727143 +0900
@@ -68,6 +68,10 @@
     # use_libibus represents if ibus library is used or not.
     # This option is only for Linux.
     'use_libibus%': '0',
+
+    # use_system_abseil_cpp represents if system version or bundled version
+    # of abseil-cpp library is used.
+    'use_system_abseil_cpp%': '0',
   },
   'target_defaults': {
     'defines': [
diff -pruN mozc-2.29.5111.102.orig/gyp/directories.gypi mozc-2.29.5111.102/gyp/directories.gypi
--- mozc-2.29.5111.102.orig/gyp/directories.gypi	2023-06-15 19:21:31.000000000 +0900
+++ mozc-2.29.5111.102/gyp/directories.gypi	2023-06-23 21:47:02.371727143 +0900
@@ -62,6 +62,11 @@
       ['target_platform=="Windows"', {
         'wtl_dir': '<(third_party_dir)/wtl',
       }],
+      ['use_system_abseil_cpp==1', {
+        'absl_include_dirs': [],
+      },{
+        'absl_include_dirs': ['<(absl_dir)'],
+      }]
     ],
 
     # glob command to get files.