Sharing cc_defaults across multiple levels of Android.bp

572 views
Skip to first unread message

krzysztof....@volvocars.com

unread,
Oct 12, 2017, 12:49:21 PM10/12/17
to Android Building
Hello,

I am working on the project, which is build as part of whole AOSP.

I have noticed that many levels of our build files repeat same compiler flags, multilib config, they are all vendor etc.

So I tried to create sth like:

cc_defaults {
    name: "product_defaults",
    compile_multilib: "64",
    cflags: ["-fexceptions", "-Wall", "-Wextra"],
    vendor: true,
}

optional_subdirs = ["*"]

but I am not able to references it out of the top level projects:

error: vendor/product/submodule/Android.bp:14:1: "target_library" depends on undefined module "product_defaults"

Is it possible to share common configuration using cc_defaults module outside single Android.bp? And if not what would be the best equivalent?

Best Regards,
Krzysztof Wesolowski


Colin Cross

unread,
Oct 12, 2017, 12:54:08 PM10/12/17
to android-...@googlegroups.com
cc_defaults are normal modules in the global namespace, so if it can't find it either you typo'd the name or the Android.bp you defined it in is not being parsed.

--
--
You received this message because you are subscribed to the "Android Building" mailing list.
To post to this group, send email to android-building@googlegroups.com
To unsubscribe from this group, send email to
android-building+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-building?hl=en

---
You received this message because you are subscribed to the Google Groups "Android Building" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-building+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Wesolowski, Krzysztof

unread,
Oct 12, 2017, 1:52:47 PM10/12/17
to android-...@googlegroups.com
Hi Colin,

Thanks for you help - I found that toplevel Android.bp in my repo includes vendor/*/*, so you were right - Android.bp in vendor/company/Android.bp was not parsed.

BR, K.

From: ccr...@google.com <ccr...@google.com> on behalf of Colin Cross <ccr...@android.com>
Sent: Thursday, October 12, 2017 6:53:48 PM
To: android-...@googlegroups.com
Subject: Re: [android-building] Sharing cc_defaults across multiple levels of Android.bp
 
To post to this group, send email to android-...@googlegroups.com

To unsubscribe from this group, send email to

For more options, visit this group at
http://groups.google.com/group/android-building?hl=en

---
You received this message because you are subscribed to the Google Groups "Android Building" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-buildi...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages