diff options
author | 2020-10-03 00:22:49 +0000 | |
---|---|---|
committer | 2020-10-03 00:22:49 +0000 | |
commit | 4e7b26a4341797d375403d5dbc4619c58ddebfe1 (patch) | |
tree | 01527122bb3463e17225fd5f0b28d27d8d298172 /cc | |
parent | e934c5ba7efe058a08a15545241050413ec06929 (diff) | |
parent | bc9e421215be5ef92080ae239302c12f8821dcc1 (diff) |
Merge "rust: Allow rust_bindgen to use cc_defaults."
Diffstat (limited to 'cc')
-rw-r--r-- | cc/cc.go | 2 | ||||
-rw-r--r-- | cc/compiler.go | 40 |
2 files changed, 42 insertions, 0 deletions
@@ -3166,6 +3166,8 @@ func DefaultsFactory(props ...interface{}) android.Module { <OProperties{}, &PgoProperties{}, &android.ProtoProperties{}, + // RustBindgenProperties is included here so that cc_defaults can be used for rust_bindgen modules. + &RustBindgenClangProperties{}, ) android.InitDefaultsModule(module) diff --git a/cc/compiler.go b/cc/compiler.go index bb5c7bf2a..21da2fc60 100644 --- a/cc/compiler.go +++ b/cc/compiler.go @@ -652,3 +652,43 @@ func isThirdParty(path string) bool { } return true } + +// Properties for rust_bindgen related to generating rust bindings. +// This exists here so these properties can be included in a cc_default +// which can be used in both cc and rust modules. +type RustBindgenClangProperties struct { + // list of directories relative to the Blueprints file that will + // be added to the include path using -I + Local_include_dirs []string `android:"arch_variant,variant_prepend"` + + // list of static libraries that provide headers for this binding. + Static_libs []string `android:"arch_variant,variant_prepend"` + + // list of shared libraries that provide headers for this binding. + Shared_libs []string `android:"arch_variant"` + + // list of clang flags required to correctly interpret the headers. + Cflags []string `android:"arch_variant"` + + // list of c++ specific clang flags required to correctly interpret the headers. + // This is provided primarily to make sure cppflags defined in cc_defaults are pulled in. + Cppflags []string `android:"arch_variant"` + + // C standard version to use. Can be a specific version (such as "gnu11"), + // "experimental" (which will use draft versions like C1x when available), + // or the empty string (which will use the default). + // + // If this is set, the file extension will be ignored and this will be used as the std version value. Setting this + // to "default" will use the build system default version. This cannot be set at the same time as cpp_std. + C_std *string + + // C++ standard version to use. Can be a specific version (such as + // "gnu++11"), "experimental" (which will use draft versions like C++1z when + // available), or the empty string (which will use the default). + // + // If this is set, the file extension will be ignored and this will be used as the std version value. Setting this + // to "default" will use the build system default version. This cannot be set at the same time as c_std. + Cpp_std *string + + //TODO(b/161141999) Add support for headers from cc_library_header modules. +} |