Upgrade fmtlib to 6.0.0
Test: None
Change-Id: I8f1bfae8a8d1cf4dd97ef022bb35c8996a7d0fb1
diff --git a/Android.bp b/Android.bp
new file mode 100644
index 0000000..85b1a6a
--- /dev/null
+++ b/Android.bp
@@ -0,0 +1,41 @@
+cc_defaults {
+ name: "fmtlib-defaults",
+ srcs: ["src/format.cc"],
+ cflags: [
+ "-fno-exceptions",
+ "-Wall",
+ "-Werror",
+ // If built without exceptions, libfmt uses assert.
+ "-UNDEBUG",
+ ],
+ sanitize: {
+ misc_undefined: ["integer"],
+ },
+ local_include_dirs: ["include"],
+ export_include_dirs: ["include"],
+}
+
+// This is built into libbase. If you want to use this library, link to libbase instead.
+cc_library_static {
+ name: "fmtlib",
+ defaults: ["fmtlib-defaults"],
+ vendor_available: true,
+ recovery_available: true,
+ host_supported: true,
+ native_bridge_supported: true,
+ target: {
+ linux_bionic: {
+ enabled: true,
+ },
+ windows: {
+ enabled: true,
+ },
+ },
+}
+
+cc_library_static {
+ name: "fmtlib_ndk",
+ defaults: ["fmtlib-defaults"],
+ sdk_version: "current",
+ stl: "c++_static",
+}
diff --git a/METADATA b/METADATA
new file mode 100644
index 0000000..157fb95
--- /dev/null
+++ b/METADATA
@@ -0,0 +1,18 @@
+name: "fmtlib"
+description: "{fmt} is an open-source formatting library for C++. It can be used as a safe and fast alternative to (s)printf and iostreams."
+third_party {
+ url {
+ type: HOMEPAGE
+ value: "https://github.com/fmtlib/fmt"
+ }
+ url {
+ type: GIT
+ value: "https://github.com/fmtlib/fmt.git"
+ }
+ version: "6.0.0"
+ last_upgrade_date {
+ year: 2019
+ month: 8
+ day: 26
+ }
+}
diff --git a/MODULE_LICENSE_BSD b/MODULE_LICENSE_BSD
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/MODULE_LICENSE_BSD
diff --git a/NOTICE b/NOTICE
new file mode 100644
index 0000000..eb6be65
--- /dev/null
+++ b/NOTICE
@@ -0,0 +1,23 @@
+Copyright (c) 2012 - 2016, Victor Zverovich
+
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+
+1. Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+2. Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following disclaimer in the documentation
+ and/or other materials provided with the distribution.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/support/Android.mk b/support/Android.mk
index 84a3e32..0660b8a 100644
--- a/support/Android.mk
+++ b/support/Android.mk
@@ -1,15 +1,4 @@
-LOCAL_PATH := $(call my-dir)
-include $(CLEAR_VARS)
-
-LOCAL_MODULE := fmt_static
-LOCAL_MODULE_FILENAME := libfmt
-
-LOCAL_SRC_FILES := ../src/format.cc
-
-LOCAL_C_INCLUDES := $(LOCAL_PATH)
-LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)
-
-LOCAL_CFLAGS += -std=c++11 -fexceptions
-
-include $(BUILD_STATIC_LIBRARY)
-
+# The Android.mk provided by the upstream fmtlib repository is for use with the
+# NDK and is not appropriate for the platform build. When integrating changes
+# from upstream, omit their Android.mk and leave the existing Android.bp
+# instead.