Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7a1ca598 authored by Steven Moreland's avatar Steven Moreland
Browse files

libutils: split out libutils_binder

Dependencies of libbinder, so we can build
a core libbinder library, libbinder_sdk.

This is preparing the way to move this part of libbinder
together with binder code into a single project.

Bug: 302720583
Change-Id: Icff078ac6e36c7f2b91cf815d5b9ed19b2e706e1
parent 0666c3a6
Loading
Loading
Loading
Loading
+2 −46
Original line number Diff line number Diff line
@@ -132,25 +132,19 @@ cc_defaults {
    ],
    native_bridge_supported: true,

    whole_static_libs: ["libutils_binder"],

    srcs: [
        "Errors.cpp",
        "FileMap.cpp",
        "JenkinsHash.cpp",
        "LightRefBase.cpp",
        "NativeHandle.cpp",
        "Printer.cpp",
        "RefBase.cpp",
        "SharedBuffer.cpp",
        "StopWatch.cpp",
        "String8.cpp",
        "String16.cpp",
        "StrongPointer.cpp",
        "SystemClock.cpp",
        "Threads.cpp",
        "Timers.cpp",
        "Tokenizer.cpp",
        "Unicode.cpp",
        "VectorImpl.cpp",
        "misc.cpp",
    ],

@@ -273,24 +267,6 @@ cc_fuzz {
    srcs: ["FileMap_fuzz.cpp"],
}

cc_fuzz {
    name: "libutils_fuzz_string8",
    defaults: ["libutils_fuzz_defaults"],
    srcs: ["String8_fuzz.cpp"],
}

cc_fuzz {
    name: "libutils_fuzz_string16",
    defaults: ["libutils_fuzz_defaults"],
    srcs: ["String16_fuzz.cpp"],
}

cc_fuzz {
    name: "libutils_fuzz_vector",
    defaults: ["libutils_fuzz_defaults"],
    srcs: ["Vector_fuzz.cpp"],
}

cc_fuzz {
    name: "libutils_fuzz_printer",
    defaults: ["libutils_fuzz_defaults"],
@@ -315,12 +291,6 @@ cc_fuzz {
    ],
}

cc_fuzz {
    name: "libutils_fuzz_refbase",
    defaults: ["libutils_fuzz_defaults"],
    srcs: ["RefBase_fuzz.cpp"],
}

cc_fuzz {
    name: "libutils_fuzz_lrucache",
    defaults: ["libutils_fuzz_defaults"],
@@ -340,18 +310,11 @@ cc_test {
    srcs: [
        "BitSet_test.cpp",
        "CallStack_test.cpp",
        "Errors_test.cpp",
        "FileMap_test.cpp",
        "LruCache_test.cpp",
        "Mutex_test.cpp",
        "SharedBuffer_test.cpp",
        "Singleton_test.cpp",
        "String16_test.cpp",
        "String8_test.cpp",
        "StrongPointer_test.cpp",
        "Timers_test.cpp",
        "Unicode_test.cpp",
        "Vector_test.cpp",
    ],

    target: {
@@ -373,7 +336,6 @@ cc_test {
        linux: {
            srcs: [
                "Looper_test.cpp",
                "RefBase_test.cpp",
            ],
        },
        host: {
@@ -427,9 +389,3 @@ cc_test_library {
    shared_libs: ["libutils_test_singleton1"],
    header_libs: ["libutils_headers"],
}

cc_benchmark {
    name: "libutils_benchmark",
    srcs: ["Vector_benchmark.cpp"],
    shared_libs: ["libutils"],
}
+3 −0
Original line number Diff line number Diff line
@@ -2,6 +2,9 @@
  "presubmit": [
    {
      "name": "libutils_test"
    },
    {
      "name": "libutils_binder_test"
    }
  ]
}
+126 −0
Original line number Diff line number Diff line
package {
    default_applicable_licenses: ["system_core_libutils_license"],
}

cc_defaults {
    name: "libutils_binder_impl_defaults",
    defaults: [
        "libutils_defaults",
        "apex-lowest-min-sdk-version",
    ],
    native_bridge_supported: true,

    srcs: [
        "Errors.cpp",
        "RefBase.cpp",
        "SharedBuffer.cpp",
        "String16.cpp",
        "String8.cpp",
        "StrongPointer.cpp",
        "Unicode.cpp",
        "VectorImpl.cpp",
    ],

    apex_available: [
        "//apex_available:anyapex",
        "//apex_available:platform",
    ],

    afdo: true,
}

cc_library {
    name: "libutils_binder",
    defaults: ["libutils_binder_impl_defaults"],
}

cc_library {
    name: "libutils_binder_test_compile",
    defaults: ["libutils_binder_impl_defaults"],

    cflags: [
        "-DDEBUG_REFS=1",
    ],

    visibility: [":__subpackages__"],
}

cc_fuzz {
    name: "libutils_fuzz_string8",
    defaults: ["libutils_fuzz_defaults"],
    srcs: ["String8_fuzz.cpp"],
}

cc_fuzz {
    name: "libutils_fuzz_string16",
    defaults: ["libutils_fuzz_defaults"],
    srcs: ["String16_fuzz.cpp"],
}

cc_fuzz {
    name: "libutils_fuzz_vector",
    defaults: ["libutils_fuzz_defaults"],
    srcs: ["Vector_fuzz.cpp"],
}

cc_fuzz {
    name: "libutils_fuzz_refbase",
    defaults: ["libutils_fuzz_defaults"],
    srcs: ["RefBase_fuzz.cpp"],
}

cc_test {
    name: "libutils_binder_test",
    host_supported: true,

    srcs: [
        "Errors_test.cpp",
        "SharedBuffer_test.cpp",
        "String16_test.cpp",
        "String8_test.cpp",
        "StrongPointer_test.cpp",
        "Unicode_test.cpp",
        "Vector_test.cpp",
    ],

    target: {
        android: {
            shared_libs: [
                "libbase",
                "libcutils",
                "liblog",
                "liblzma",
                "libutils", // which includes libutils_binder
                "libz",
            ],
        },
        linux: {
            srcs: [
                "RefBase_test.cpp",
            ],
        },
        host: {
            static_libs: [
                "libbase",
                "liblog",
                "liblzma",
                "libutils", // which includes libutils_binder
            ],
        },
    },

    cflags: [
        "-Wall",
        "-Wextra",
        "-Werror",
        "-Wthread-safety",
    ],

    test_suites: ["device-tests"],
}

cc_benchmark {
    name: "libutils_binder_benchmark",
    srcs: ["Vector_benchmark.cpp"],
    shared_libs: ["libutils"],
}
+0 −0

File moved.

Loading