Index: third_party/cld_2/cld_2.gyp |
diff --git a/third_party/cld_2/cld_2.gyp b/third_party/cld_2/cld_2.gyp |
index cde2bd3ac43a244d4cb734d71298c87a72874c3b..eff7ab47d66aa760735e42570c1d1e5caac06b3b 100644 |
--- a/third_party/cld_2/cld_2.gyp |
+++ b/third_party/cld_2/cld_2.gyp |
@@ -34,7 +34,8 @@ |
'src/internal/compact_lang_det.cc', |
'src/internal/compact_lang_det_hint_code.cc', |
'src/internal/compact_lang_det_hint_code.h', |
- 'src/internal/compact_lang_det_impl.cc', |
+ # Omitted intentionally: compact_lang_det_impl.cc, which has IFDEFs that |
+ # depend upon build flags. See cld2_core_impl_sources, below. |
'src/internal/compact_lang_det_impl.h', |
'src/internal/debug.h', |
'src/internal/debug_empty.cc', |
@@ -68,6 +69,10 @@ |
'src/public/compact_lang_det.h', |
'src/public/encodings.h', |
], |
+ 'cld2_core_impl_sources': [ |
+ # Compilation is dependent upon flags. |
+ 'src/internal/compact_lang_det_impl.cc', |
+ ], |
'cld2_dynamic_data_loader_sources': [ |
'src/internal/cld2_dynamic_data.h', |
'src/internal/cld2_dynamic_data.cc', |
@@ -108,26 +113,26 @@ |
'sources': [ |
# Note: sources list duplicated in GN build. |
'<@(cld2_core_sources)', |
+ '<@(cld2_core_impl_sources)', |
'<@(cld2_data_sources)', |
'<@(cld2_dynamic_data_loader_sources)', |
'src/internal/cld2_dynamic_data_extractor.h', |
'src/internal/cld2_dynamic_data_extractor.cc', |
'src/internal/cld2_dynamic_data_tool.cc', |
], |
+ 'defines': ['CLD2_DYNAMIC_MODE'], |
}, |
{ |
# GN version: //third_party/cld_2 |
+ # Depending upon cld_2 will provide core headers and function definitions, |
+ # but no data. You must also declare on one of the following two targets: |
+ # cld2_static - for a statically-linked data set built into the executable |
+ # cld2_dynamic - for a dynamic data set loaded at runtime |
'target_name': 'cld_2', |
'type': 'static_library', |
- 'sources': [], |
+ 'sources': ['<@(cld2_core_sources)'], |
'dependencies': [], |
- 'conditions': [ |
- ['cld2_data_source=="static"', |
- {'dependencies': ['cld2_static']}, |
- {'dependencies': ['cld2_dynamic']} |
- ], |
- ], |
}, |
{ |
@@ -140,6 +145,7 @@ |
], |
'sources': [ |
'<@(cld2_core_sources)', |
+ '<@(cld2_core_impl_sources)', |
'<@(cld2_data_sources)', |
], |
}, |
@@ -154,12 +160,10 @@ |
], |
'sources': [ |
'<@(cld2_core_sources)', |
+ '<@(cld2_core_impl_sources)', |
'<@(cld2_dynamic_data_loader_sources)', |
], |
'defines': ['CLD2_DYNAMIC_MODE'], |
- 'all_dependent_settings': { |
- 'defines': ['CLD2_DYNAMIC_MODE'], |
- }, |
}, |
], |
} |