| // Copyright (C) 2008 The Android Open Source Project |
| // |
| // Licensed under the Apache License, Version 2.0 (the "License"); |
| // you may not use this file except in compliance with the License. |
| // You may obtain a copy of the License at |
| // |
| // http://www.apache.org/licenses/LICENSE-2.0 |
| // |
| // Unless required by applicable law or agreed to in writing, software |
| // distributed under the License is distributed on an "AS IS" BASIS, |
| // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| // See the License for the specific language governing permissions and |
| // limitations under the License. |
| |
| cc_defaults { |
| name: "bsdiff_defaults", |
| host_supported: true, |
| static_libs: ["libbz"], |
| // Allow internal includes to be referenced with the "bsdiff/" prefix in the |
| // path. |
| include_dirs: ["external"], |
| export_include_dirs: [ |
| "include", |
| // TODO(deymo): Remove include/bsdiff when all callers use the "bsdiff/" |
| // prefix when including code. |
| "include/bsdiff", |
| ], |
| cflags: [ |
| "-D_FILE_OFFSET_BITS=64", |
| "-Wall", |
| "-Werror", |
| "-Wextra", |
| "-Wno-unused-parameter", |
| ], |
| } |
| |
| // Host and target static libraries. |
| cc_library_static { |
| name: "libbspatch", |
| defaults: ["bsdiff_defaults"], |
| |
| srcs: [ |
| "bspatch.cc", |
| "buffer_file.cc", |
| "extents.cc", |
| "extents_file.cc", |
| "file.cc", |
| "memory_file.cc", |
| "sink_file.cc", |
| ], |
| } |
| |
| cc_library_static { |
| name: "libbsdiff", |
| defaults: ["bsdiff_defaults"], |
| |
| srcs: [ |
| "bsdiff.cc", |
| "bz2_compressor.cc", |
| "patch_writer.cc", |
| ], |
| static_libs: [ |
| "libdivsufsort64", |
| "libdivsufsort", |
| ], |
| } |
| |
| // Host and target Executables. |
| cc_binary { |
| name: "bspatch", |
| defaults: ["bsdiff_defaults"], |
| |
| srcs: ["bspatch_main.cc"], |
| static_libs: [ |
| "libbspatch", |
| "libbz", |
| ], |
| } |
| |
| // Host executables, bsdiff is only built for the host. |
| cc_binary_host { |
| name: "bsdiff", |
| defaults: ["bsdiff_defaults"], |
| |
| srcs: ["bsdiff_main.cc"], |
| static_libs: [ |
| "libbsdiff", |
| "libdivsufsort64", |
| "libdivsufsort", |
| "libbz", |
| ], |
| } |
| |
| // Unit tests. |
| cc_test { |
| name: "bsdiff_unittest", |
| defaults: ["bsdiff_defaults"], |
| test_suites: ["device-tests"], |
| srcs: [ |
| "bsdiff_unittest.cc", |
| "bspatch_unittest.cc", |
| "extents_file_unittest.cc", |
| "extents_unittest.cc", |
| "test_utils.cc", |
| "testrunner.cc", |
| ], |
| cflags: ["-DBSDIFF_TARGET_UNITTEST"], |
| static_libs: [ |
| "libbsdiff", |
| "libbspatch", |
| "libgmock", |
| "libdivsufsort64", |
| "libdivsufsort", |
| "libbz", |
| ], |
| } |