| # Copyright 2020 The Chromium OS Authors. All rights reserved. |
| # Use of this source code is governed by a BSD-style license that can be |
| # found in the LICENSE file. |
| |
| import("//common-mk/pkg_config.gni") |
| |
| group("all") { |
| deps = [ |
| ":libneuralnetworks", |
| ] |
| if (use.test) { |
| deps += [ ":chromeos_testrunner" ] |
| } |
| } |
| |
| shared_library("libneuralnetworks") { |
| configs += [ ":target_defaults" ] |
| deps = [ |
| ":common_random", |
| ":runtime", |
| ] |
| libs = [ |
| "tensorflowlite", |
| ] |
| } |
| |
| pkg_config("target_defaults") { |
| cflags = [ |
| "-Wall", |
| "-Werror", |
| "-Wextra", |
| ] |
| cflags_cc = [ |
| "-std=c++17", |
| # All of the HIDL generated interfaces are missing override directives. |
| "-Wno-inconsistent-missing-override" |
| ] |
| include_dirs = [ "${sysroot}/usr/include/aosp" ] |
| defines = [ |
| "__ANDROID_API__=30", # Android R |
| ] |
| pkg_deps = [ "libnnapi-support" ] |
| } |
| |
| pkg_config("common_defaults") { |
| configs = [ |
| ":target_defaults", |
| ] |
| include_dirs = [ |
| "chromeos/includes", |
| "common/include", |
| "${sysroot}/usr/include/eigen3", |
| "${sysroot}/usr/include/tensorflow", |
| "common/random", |
| ] |
| defines = [] |
| pkg_deps = [ "libnnapi-support" ] |
| } |
| |
| static_library("common_random") { |
| configs += [ |
| ":common_defaults", |
| "//common-mk:pic", |
| ] |
| sources = [ |
| "common/random/guarded_philox_random.cc", |
| "common/random/random.cc", |
| "common/random/simple_philox.cc", |
| ] |
| } |
| |
| static_library("runtime") { |
| configs += [ |
| ":target_defaults", |
| "//common-mk:pic", |
| ] |
| include_dirs = [ |
| "common/include", |
| "runtime/include", |
| ] |
| sources = [ |
| # Commented out files require one or more of these to be fixed: |
| # b/157383102 - Port libfmq to ChromeOS |
| # b/157388904 - Implementation of hardware buffers API |
| # "runtime/BurstBuilder.cpp", |
| "runtime/Callbacks.cpp", |
| # "runtime/CompilationBuilder.cpp", |
| # "runtime/ExecutionBuilder.cpp", |
| # "runtime/ExecutionPlan.cpp", |
| # "runtime/Manager.cpp", |
| # "runtime/Memory.cpp", |
| "runtime/ModelArgumentInfo.cpp", |
| "runtime/ModelBuilder.cpp", |
| # "runtime/NeuralNetworks.cpp", |
| # "runtime/TypeManager.cpp", |
| # "runtime/VersionedInterfaces.cpp", |
| ] |
| } |
| |
| if (use.test) { |
| executable("chromeos_testrunner") { |
| include_dirs = [ |
| "common/random", |
| ] |
| configs += [ |
| ":common_defaults", |
| "//common-mk:test", |
| ] |
| deps = [ |
| ":common_random", |
| "//common-mk/testrunner:testrunner", |
| ] |
| sources = [ |
| "chromeos/tests/common/includes_test.cc", |
| "chromeos/tests/common/random_test.cc" |
| ] |
| } |
| } |