bp2build conversion for rscript srcs in cc modules
Bazel does not support using .rscrip/.fs files as cc srcs.
For a module foo with foo srcs, Bp2build will create a bazel
target of rule class rscript_to_cpp with name foo_renderscript
which will have only the renderscript files as srcs.
Bp2build will also create a target foo with the expected cc rule class.
The foo target will have all other src files as srcs and will also
have the target foo_renderscript as another src.
Bug: 210509914
Test: bp2build testing & b build target rstest-latency
Change-Id: Ifdc55051a3595f5fcf54eab8b59e11e9351e141c
diff --git a/cc/config/global.go b/cc/config/global.go
index 8ff5f55..e450ba7 100644
--- a/cc/config/global.go
+++ b/cc/config/global.go
@@ -448,11 +448,12 @@
pctx.StaticVariable("RSLLVMPrebuiltsPath", "${RSClangBase}/${HostPrebuiltTag}/${RSClangVersion}/bin")
pctx.StaticVariable("RSIncludePath", "${RSLLVMPrebuiltsPath}/../lib64/clang/${RSReleaseVersion}/include")
- pctx.PrefixedExistentPathsForSourcesVariable("RsGlobalIncludes", "-I",
- []string{
- "external/clang/lib/Headers",
- "frameworks/rs/script_api/include",
- })
+ rsGlobalIncludes := []string{
+ "external/clang/lib/Headers",
+ "frameworks/rs/script_api/include",
+ }
+ pctx.PrefixedExistentPathsForSourcesVariable("RsGlobalIncludes", "-I", rsGlobalIncludes)
+ exportedVars.ExportStringList("RsGlobalIncludes", rsGlobalIncludes)
pctx.VariableFunc("CcWrapper", func(ctx android.PackageVarContext) string {
if override := ctx.Config().Getenv("CC_WRAPPER"); override != "" {