google / lyra

A Very Low-Bitrate Codec for Speech Compression
Apache License 2.0
3.8k stars 354 forks source link

Fixed an issue where Android example would not compile on Mac. #96

Closed lilinxiong closed 1 year ago

lilinxiong commented 1 year ago

I think "fail to build lyra_android_example" is a better solution to this problem. I changed it like this, 1st. Modify WORKSPACE in:WORKSPACE#L36-L40:

git_repository(
    name = "com_google_absl",
    remote = "https://github.com/abseil/abseil-cpp.git",
    tag = "20210324.2",
    # Remove after https://github.com/abseil/abseil-cpp/issues/326 is solved.
    patches = [
        "@//third_party:com_google_absl_f863b622fe13612433fdf43f76547d5edda0c93001.diff"
    ],
    patch_args = [
        "-p1",
    ]
)

2end.

mkdir third_party
cd third_party
touch BUILD
touch com_google_absl_f863b622fe13612433fdf43f76547d5edda0c93001.diff

The content in BUILD is:

licenses(["notice"])  # Apache License 2.0

exports_files(["LICENSE"])

package(default_visibility = ["//visibility:public"])

The content in com_google_absl_f863b622fe13612433fdf43f76547d5edda0c93001.diff is:

diff --git a/absl/time/internal/cctz/BUILD.bazel b/absl/time/internal/cctz/BUILD.bazel
index 9fceffe..e7f9d01 100644
--- a/absl/time/internal/cctz/BUILD.bazel
+++ b/absl/time/internal/cctz/BUILD.bazel
@@ -69,8 +69,5 @@ cc_library(
         "include/cctz/zone_info_source.h",
     ],
     linkopts = select({
-        ":osx": [
-            "-framework Foundation",
-        ],
         ":ios": [
             "-framework Foundation",
         ],

(I learned from mediapipe#WORKSPCE#L25-L40... (:

lilinxiong commented 1 year ago

@mchinen hello do you have time to review?

mchinen commented 1 year ago

Thanks, so this should fix mac-host/android-target. From the CI, it appears this does not cause issues for the mac-host/mac-target, so I'm happy to merge this.

lilinxiong commented 1 year ago

@mchinen hello, I have already dealt with it, please review again~

lilinxiong commented 1 year ago

@mchinen Hi~ It seems to have finished executing, is there anything else I need to do?

mchinen commented 1 year ago

Thanks @lilinxiong , merged.