Browse Source

Original commit from Timur Kristóf (#2363) (#2482)

Add ability for the C++ library to link against protobuf-lite. .
pull/2564/head
Gilles Vollant 5 years ago
committed by GitHub
parent
commit
940bd9d0af
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 3 deletions
  1. +10
    -3
      cpp/CMakeLists.txt

+ 10
- 3
cpp/CMakeLists.txt View File

@ -81,6 +81,7 @@ endfunction (find_required_program)
option ("BUILD_GEOCODER" "Build the offline phone number geocoder" "ON") option ("BUILD_GEOCODER" "Build the offline phone number geocoder" "ON")
option ("REGENERATE_METADATA" "Regenerate metadata instead of using it from the source tree" "ON") option ("REGENERATE_METADATA" "Regenerate metadata instead of using it from the source tree" "ON")
option ("USE_ALTERNATE_FORMATS" "Use alternate formats" "ON") option ("USE_ALTERNATE_FORMATS" "Use alternate formats" "ON")
option ("USE_PROTOBUF_LITE" "Link to protobuf-lite" "OFF")
option ("USE_BOOST" "Use Boost" "ON") option ("USE_BOOST" "Use Boost" "ON")
option ("USE_ICU_REGEXP" "Use ICU regexp engine" "ON") option ("USE_ICU_REGEXP" "Use ICU regexp engine" "ON")
option ("USE_LITE_METADATA" "Use lite metadata" "OFF") option ("USE_LITE_METADATA" "Use lite metadata" "OFF")
@ -126,9 +127,15 @@ if (${USE_RE2} STREQUAL "ON")
find_required_library (RE2 re2/re2.h re2 "Google RE2") find_required_library (RE2 re2/re2.h re2 "Google RE2")
endif () endif ()
find_required_library (PROTOBUF google/protobuf/message_lite.h protobuf
"Google Protocol Buffers")
check_library_version (PC_PROTOBUF protobuf>=2.4)
if (${USE_PROTOBUF_LITE} STREQUAL "ON")
find_required_library (PROTOBUF google/protobuf/message_lite.h protobuf-lite
"Google Protocol Buffers")
check_library_version (PC_PROTOBUF protobuf-lite>=2.4)
else ()
find_required_library (PROTOBUF google/protobuf/message_lite.h protobuf
"Google Protocol Buffers")
check_library_version (PC_PROTOBUF protobuf>=2.4)
endif ()
find_required_library (ICU_UC unicode/uchar.h icuuc "ICU") find_required_library (ICU_UC unicode/uchar.h icuuc "ICU")
check_library_version (PC_ICU_UC icu-uc>=4.4) check_library_version (PC_ICU_UC icu-uc>=4.4)


Loading…
Cancel
Save