All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kelvin Zhang via Linux-erofs <linux-erofs@lists.ozlabs.org>
To: linux-erofs mailing list <linux-erofs@lists.ozlabs.org>,
	Miao Xie <miaoxie@huawei.com>, Fang Wei <fangwei1@huawei.com>
Cc: Kelvin Zhang <zhangkelvin@google.com>
Subject: [PATCH v2 1/2] erofs-utils: Add android build target to build erofs as library
Date: Mon, 29 Nov 2021 19:25:45 -0800	[thread overview]
Message-ID: <20211130032546.2825384-1-zhangkelvin@google.com> (raw)
In-Reply-To: <YaWYErBYsG4Yjboh@B-P7TQMD6M-0146.local>

Change-Id: I648ae5707ec94b0b5a13781dc22e2c47d488cb83
Signed-off-by: Kelvin Zhang <zhangkelvin@google.com>
---
 Android.bp | 38 ++++++++++++++++++++++++++++++++++++--
 1 file changed, 36 insertions(+), 2 deletions(-)

diff --git a/Android.bp b/Android.bp
index fc84e6e..7973555 100644
--- a/Android.bp
+++ b/Android.bp
@@ -52,7 +52,7 @@ genrule {
 }
 
 cc_defaults {
-    name: "erofs-utils_defaults",
+    name: "erofs-utils_export_defaults",
 
     cflags: [
         "-Wall",
@@ -60,7 +60,7 @@ cc_defaults {
         "-Wno-ignored-qualifiers",
         "-Wno-pointer-arith",
         "-Wno-unused-parameter",
-        "-include erofs-utils-version.h",
+        "-Wno-unused-function",
         "-DHAVE_FALLOCATE",
         "-DHAVE_LINUX_TYPES_H",
         "-DHAVE_LIBSELINUX",
@@ -69,6 +69,15 @@ cc_defaults {
         "-DLZ4HC_ENABLED",
         "-DWITH_ANDROID",
     ],
+}
+
+cc_defaults {
+    name: "erofs-utils_defaults",
+    defaults: ["erofs-utils_export_defaults"],
+
+    cflags: [
+        "-include erofs-utils-version.h",
+    ],
     local_include_dirs: [
         "include",
     ],
@@ -86,6 +95,22 @@ cc_defaults {
     ],
 }
 
+cc_library {
+    host_supported: true,
+    name: "liberofs",
+    defaults: ["erofs-utils_defaults"],
+    srcs: [
+        "lib/*.c",
+    ],
+    export_include_dirs: ["include"],
+
+    target: {
+        darwin: {
+            enabled: false,
+        },
+    },
+}
+
 cc_defaults {
     name: "mkfs-erofs_defaults",
 
@@ -95,6 +120,9 @@ cc_defaults {
         "lib/*.c",
         "mkfs/*.c",
     ],
+    static_libs: [
+        "liberofs",
+    ],
 
     target: {
         darwin: {
@@ -122,6 +150,9 @@ cc_binary_host {
         "lib/*.c",
         "dump/*.c",
     ],
+    static_libs: [
+        "liberofs",
+    ],
     target: {
         darwin: {
             enabled: false,
@@ -136,6 +167,9 @@ cc_binary_host {
         "lib/*.c",
         "fsck/*.c",
     ],
+    static_libs: [
+        "liberofs",
+    ],
     target: {
         darwin: {
             enabled: false,
-- 
2.34.0.rc2.393.gf8c9666880-goog


  reply	other threads:[~2021-11-30  3:26 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-30  3:01 [PATCH v1 0/2] Cosmetic changes to erofs-utils Kelvin Zhang via Linux-erofs
2021-11-30  3:01 ` [PATCH v1 1/2] Add android build target to build erofs as library Kelvin Zhang via Linux-erofs
2021-11-30  3:01 ` [PATCH v1 2/2] Make erofs-utils more C++ friendly Kelvin Zhang via Linux-erofs
2021-11-30  3:18 ` [PATCH v1 0/2] Cosmetic changes to erofs-utils Gao Xiang
2021-11-30  3:25   ` Kelvin Zhang via Linux-erofs [this message]
2021-11-30  3:25     ` [PATCH v2 2/2] erofs-utils: Make erofs-utils more C++ friendly Kelvin Zhang via Linux-erofs
2021-11-30  5:23       ` Gao Xiang
2021-11-30  5:56   ` [PATCH v3 1/2] erofs-utils: Add android build target to build erofs as library Kelvin Zhang via Linux-erofs
2021-11-30  5:56     ` [PATCH v3 2/2] erofs-utils: Make erofs-utils more C++ friendly Kelvin Zhang via Linux-erofs

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211130032546.2825384-1-zhangkelvin@google.com \
    --to=linux-erofs@lists.ozlabs.org \
    --cc=fangwei1@huawei.com \
    --cc=miaoxie@huawei.com \
    --cc=zhangkelvin@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.