-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move cras_processor out of cras/src/server/rust
BUG=b:372902037 TEST=devtools/rust_generate.py TEST=cargo build && SYSTEM_CRAS_RUST_LIB=$PWD/target/debug/libcras_rust.a bazel test --//:apm --//:system_cras_rust //... TEST=bazel test --//:apm //... TEST=FEATURES='test -usersandbox' emerge-amd64-generic cras_rust adhd TEST=bazel run //cras/server/processor:processor_test Change-Id: If509ca4356f421d7c82d2e184cb33cb56d95e47d Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/adhd/+/5922501 Reviewed-by: Hung-Hsien Chen <[email protected]> Tested-by: Li-Yu Yu <[email protected]> Tested-by: [email protected] <[email protected]> Commit-Queue: Li-Yu Yu <[email protected]>
- Loading branch information
Showing
21 changed files
with
207 additions
and
81 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
# Copyright 2024 The ChromiumOS Authors | ||
# Use of this source code is governed by a BSD-style license that can be | ||
# found in the LICENSE file. | ||
|
||
load("@crate_index//:defs.bzl", "all_crate_deps") | ||
load("@rules_cc//cc:defs.bzl", "cc_library", "cc_test") | ||
load("@rules_rust//cargo:defs.bzl", "cargo_build_script") | ||
load("@rules_rust//rust:defs.bzl", "rust_test") | ||
load("//:utils.bzl", "require_no_config") | ||
load("//rules/cbindgen:rules.bzl", "cras_cbindgen") | ||
load("//rules/rust:defs.bzl", "cras_rust_library") | ||
|
||
cras_rust_library( | ||
name = "processor", | ||
srcs = glob( | ||
include = ["src/**/*.rs"], | ||
), | ||
crate_name = "cras_processor", | ||
edition = "2021", | ||
visibility = ["//visibility:public"], | ||
deps = all_crate_deps(normal = True) + [ | ||
"//audio_processor", | ||
"//cras/server/s2", | ||
"//cras/server/platform/dlc", | ||
"//cras/common:rust_common", | ||
":build_script", | ||
], | ||
) | ||
|
||
rust_test( | ||
name = "processor_test", | ||
crate = ":processor", | ||
target_compatible_with = require_no_config("//:system_cras_rust_build"), | ||
) | ||
|
||
cras_cbindgen( | ||
name = "processor_h", | ||
srcs = ["src/lib.rs"], | ||
out = "processor.h", | ||
copyright_year = 2024, | ||
extra_args = [ | ||
"--with-include=audio_processor/c/plugin_processor.h", | ||
"--with-include=cras/common/rust_common.h", | ||
"--add-keyword-enum", | ||
], | ||
) | ||
|
||
cc_library( | ||
name = "cc", | ||
hdrs = ["processor.h"], | ||
visibility = ["//visibility:public"], | ||
deps = [ | ||
":processor", | ||
"//audio_processor/c:plugin_processor", | ||
"//cras/common:rust_common_cc", | ||
], | ||
) | ||
|
||
cc_test( | ||
name = "cras_processor_test", | ||
srcs = ["cras_processor_test.cc"], | ||
deps = [ | ||
":cc", | ||
"@pkg_config//gtest", | ||
"@pkg_config//gtest_main", | ||
], | ||
) | ||
|
||
cargo_build_script( | ||
name = "build_script", | ||
srcs = ["build.rs"], | ||
data = [ | ||
"proto/cras_processor.proto", | ||
], | ||
deps = all_crate_deps(build = True), | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
[package] | ||
name = "cras_processor" | ||
version = "0.1.0" | ||
edition = "2021" | ||
|
||
[dependencies] | ||
anyhow = { workspace = true } | ||
log = { workspace = true } | ||
protobuf = { workspace = true } | ||
|
||
audio_processor = { workspace = true } | ||
cras_common = { workspace = true } | ||
cras_dlc = { workspace = true } | ||
cras_s2 = { workspace = true } | ||
|
||
[build-dependencies] | ||
protobuf-codegen = { workspace = true } |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.