* Find and add abseil even when BUILD_GEOCODER=OFF
* Treat boolean variables as conditions
* Expose BUILD_SHARED_LIBS as a user configurable option
* Add BUILD_TESTING option
* Wrap test dependencies and targets in if (BUILD_TESTING)
* Refactor library build procedure to respect user defined configurations
* Export cmake package config files so downstream projects can use the library without creating a FindLibPhonenumber
* Bump version number to 8.13.0
Co-authored-by: penmetsaa <penmetsaa@google.com>
Currently, CMake is configured to download and build abseil from source
whenever `BUILD_GEOCODER` is set to `ON`. Let's allow users to use a
pre-existing installation of abseil by checking for one first before
attempting to download and build another one.
If CMake finds a pre-existing installation of abseil, it will use that
instead.
We need to allow the user to override `CMAKE_CXX_STANDARD` because they
may have built abseil with a newer standard than C++11. Attempting to
build libphonenumber with C++11 will fail if abseil was built with a
newer C++ standard.
Closes#2772.
It is used in the library with #2734, and not linking with it
breaks users of the library: https://bugs.debian.org/1008817
Co-authored-by: penmetsaa <penmetsaa@google.com>
- Faced link errors stemmed from mismatch of api definitions of absl::node_hash_set. So explicitly mentioned this lib as dependency during linking. This is common case/solution for absl hash set lib's link errors as per community.
- Decided to continued to have wrapper (stringutil), so that in future it's easy if we decided to change implementation; client code is safe. Changed most of the implementations & data structures in stringutil, to use abseil stuffs more.
- Though absl::string_view is suitable for most cases where we want immutable/read-only string structures, limiting to stringutil apis, not changing public API signatures (even though no compliance issue); reason: reduce dependency on abseil libs.
- Abseil specific changes done:
- std::set => absl::node_hash_set
- std::map => absl::node_hash_map
- Using absl alternatives for “SplitStringUsing” API and “StringHolder” class impl.
- Replaced manual impl of prefix and suffix checks with absl::StartsWith() and absl::EndsWith.
- Similarly used absl::StrReplaceAll, absl::StrCat, absl::StrAppend where possible; and for type conversion apis.
- Note: Tried applying parameter packs to replace manually written duplicate ```StrCat``` apis (for accommodating more number of parameters of same type), but it did not go well when different type arguments passed. Eg char, int types to be converted to StringHolder; faced constructor implicit conversion issues.
@API updates:
- Migrating from associative containers to more performant types. Eg: map to absl::btree_map.
- Synchronise the write access to map "AreaCodeMaps" using absl::Mutex locking api.
- Use more of absl:strings packages like absl::StrReplaceAll
@Build updates:
- To build (CMake) against absl packages, the minimum version of compiler is CPP11+, whereas earlier we are not mandating this.
- We are upgrading CMAKE version also to automate building the external absl packages.
The change is announced. Please report issues in case of any breakages.
https://issuetracker.google.com/issues?q=componentid:192347%20555
Sep 19, 2016: libphonenumber-7.7.0
Code changes:
Removed the dependency on protobuf (protobuf-javanano) from the Java library, resurrecting java/libphonenumber/src/com/google/i18n/phonenumbers/Phonemetadata.java which was present until libphonenumber-7.1.1.
Does not affect the C++ or JavaScript libraries.
Aug 24, 2016: libphonenumber-7.6.0
Code changes:
Refactored metadata loading and closed all streams after loading.
Made isNumberGeographical public, and changed the geocoder to use this when checking whether to give a detailed answer or country-level only.
Build changes:
Use protobuf-javanano 3.0.0-alpha-7 from Maven Central.
Metadata changes:
Updated phone metadata for region code(s): EH, ET, JM, MA, SK, SN, SY, ZM
Updated short number metadata for region code(s): ZA
Updated geocoding data for country calling code(s): 212 (en)
New carrier data for country calling code(s): 86 (zh, zh_Hant), 852 (zh, zh_Hant), 963 (en)
Updated carrier data for country calling code(s): 86 (en), 212 (en), 251 (en), 421 (en)
Deleted unsupported SingleFilePhoneNumberMetadataProto
This is similar to the fix of #822.
Also update README to cover Mac installation.
This rolls back the cmake minimum version bump in #975 since it was
backwards-incompatible, and the following #984. Not expected to cause
any new user-facing regressions, but expected to solve any that were
introduced with #975.
This is necessary to guarantee that parallel builds will succeed, all
top-level targets that include geocoding_data.cc in their builds need
explicitly listed dependencies on generate_geocoding_data to ensure that
generation of the file has finished before it is being used.
This reverts commit df876cedb5.
This commit broke internal builds with the error message:
----
CMake Error at CMakeLists.txt:422 (target_link_libraries):
Cannot specify link libraries for target "phonenumber" which is not built
by this project.
----