aboutsummaryrefslogtreecommitdiffhomepage
path: root/Firestore/core/src/firebase/firestore/util/CMakeLists.txt
diff options
context:
space:
mode:
authorGravatar Gil <mcg@google.com>2018-01-08 08:57:36 -0800
committerGravatar GitHub <noreply@github.com>2018-01-08 08:57:36 -0800
commit0f6103e4048242aa066b4ae0e0473578b50b559c (patch)
tree7f5e450db0a866f29a5bd0e64f7a40e6a264825e /Firestore/core/src/firebase/firestore/util/CMakeLists.txt
parentbc74670afec651c3f912cb6b7e54f5b68bd507f5 (diff)
Port StringPrintf from //base (#624)
* Port StringPrintf from //base. Prefer this to approaches based on variadic templates. While the variadic template mechanisms are strictly safer, they result in binary bloat we can't afford. This is essentially the same StringPrintf previously open sourced as a part of protobuf, though updated for C++11 which saves a copy and a temporary buffer on the heap. * Add abseil as a subdirectory of Firestore This saves having to redefine all the libraries that abseil defines as imported libraries. * Rename firebase_firesture_util_log_* targets Cut the log out of the name to reflect that these will get more components besides just logging.
Diffstat (limited to 'Firestore/core/src/firebase/firestore/util/CMakeLists.txt')
-rw-r--r--Firestore/core/src/firebase/firestore/util/CMakeLists.txt41
1 files changed, 31 insertions, 10 deletions
diff --git a/Firestore/core/src/firebase/firestore/util/CMakeLists.txt b/Firestore/core/src/firebase/firestore/util/CMakeLists.txt
index d70397d..a2da3b4 100644
--- a/Firestore/core/src/firebase/firestore/util/CMakeLists.txt
+++ b/Firestore/core/src/firebase/firestore/util/CMakeLists.txt
@@ -12,50 +12,71 @@
# See the License for the specific language governing permissions and
# limitations under the License.
+# firebase_firestore_util is the interface of this module. The rest of the
+# libraries in here are an implementation detail of making this a
+# mutli-platform build.
+
add_library(
- firebase_firestore_util
- autoid.cc
+ firebase_firestore_util_base
secure_random_arc4random.cc
+ string_printf.cc
+)
+target_link_libraries(
+ firebase_firestore_util_base
+ PRIVATE
+ absl_base
)
-# log_stdio can be built and tested everywhere
+# stdio-dependent bits can be built and tested everywhere
add_library(
- firebase_firestore_util_log_stdio
+ firebase_firestore_util_stdio
log_stdio.cc
)
+target_link_libraries(
+ firebase_firestore_util_stdio
+ PUBLIC
+ firebase_firestore_util_base
+)
-# log_apple can only built and tested on apple plaforms
+# apple-dependent bits can only built and tested on apple plaforms
if(APPLE)
add_library(
- firebase_firestore_util_log_apple
+ firebase_firestore_util_apple
log_apple.mm
)
target_compile_options(
- firebase_firestore_util_log_apple
+ firebase_firestore_util_apple
PRIVATE
${OBJC_FLAGS}
)
target_link_libraries(
- firebase_firestore_util_log_apple
+ firebase_firestore_util_apple
PUBLIC
FirebaseCore
)
endif(APPLE)
+add_library(
+ firebase_firestore_util
+ autoid.cc
+)
+
# Export a dependency on the correct logging library for this platform. All
# buildable libraries are built and tested but only the best fit is exported.
if(APPLE)
target_link_libraries(
firebase_firestore_util
PUBLIC
- firebase_firestore_util_log_apple
+ firebase_firestore_util_apple
+ firebase_firestore_util_base
)
else(NOT APPLE)
target_link_libraries(
firebase_firestore_util
PUBLIC
- firebase_firestore_util_log_stdio
+ firebase_firestore_util_stdio
+ firebase_firestore_util_base
)
endif(APPLE)