blob: 3707a5fa1bb0fc68beedb72758e81e16d363fd1a [file] [log] [blame]
# Copyright 2019 The Chromium 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("//build/config/android/rules.gni")
import("//chrome/android/modules/buildflags.gni")
android_library("java") {
sources = [ "java/src/org/chromium/chrome/modules/stack_unwinder/StackUnwinderModuleContentsImpl.java" ]
annotation_processor_deps = [ "//base/android/jni_generator:jni_processor" ]
deps = [
"//base:base_java",
"//base:jni_java",
"//chrome/android/modules/stack_unwinder/public:java",
]
}
generate_jni("jni_headers") {
sources = [ "java/src/org/chromium/chrome/modules/stack_unwinder/StackUnwinderModuleContentsImpl.java" ]
}
generate_jni_registration("jni_registration") {
targets = [ ":java" ]
header_output = "$target_gen_dir/jni_registration.h"
namespace = "stack_unwinder"
no_transitive_deps = true
}
# This group is effectively an alias representing the module's native code,
# allowing it to be named "native" for clarity in module descriptors. The
# component target must be named according to the feature, so that the component
# build's .cr.co library is named properly (ie. libstack_unwinder.cr.so).
group("native") {
deps = [ ":stack_unwinder" ]
}
component("stack_unwinder") {
sources = [
"entrypoints.cc",
"stack_unwinder_module_contents_impl.cc",
]
deps = [
":jni_headers",
":jni_registration",
"//base",
"//base:native_unwinder_android",
"//chrome/android/features/stack_unwinder/public:native",
]
# stack unwinder native entrypoints belong in the partition.
if (use_native_partitions) {
cflags = [ "-fsymbol-partition=stack_unwinder_partition" ]
}
}
# Since loading of a partitioned library is not supported in an APK, a separate
# target without partition is necessary for testing.
source_set("stack_unwinder_for_testing") {
testonly = true
sources = [ "stack_unwinder_module_contents_impl.cc" ]
deps = [
":jni_headers",
"//base",
"//base:native_unwinder_android",
"//chrome/android/features/stack_unwinder/public:native",
]
}