Support relative_install_path for cc modules

Support specifying an install path relative to the default install
path for cc libraries and binaries.

Change-Id: I47a97de9beaedde27d99c498c3f26c9d36358d94
This commit is contained in:
Colin Cross
2015-04-21 17:37:37 -07:00
parent 30e076af2e
commit 41c187b3d4
2 changed files with 19 additions and 15 deletions

View File

@@ -11,19 +11,20 @@ const (
) )
var stringProperties = map[string]string{ var stringProperties = map[string]string{
"LOCAL_MODULE": "name", "LOCAL_MODULE": "name",
"LOCAL_MODULE_STEM": "stem", "LOCAL_MODULE_STEM": "stem",
"LOCAL_MODULE_CLASS": "class", "LOCAL_MODULE_CLASS": "class",
"LOCAL_CXX_STL": "stl", "LOCAL_CXX_STL": "stl",
"LOCAL_STRIP_MODULE": "strip", "LOCAL_STRIP_MODULE": "strip",
"LOCAL_MULTILIB": "compile_multilib", "LOCAL_MULTILIB": "compile_multilib",
"LOCAL_ARM_MODE_HACK": "instruction_set", "LOCAL_ARM_MODE_HACK": "instruction_set",
"LOCAL_SDK_VERSION": "sdk_version", "LOCAL_SDK_VERSION": "sdk_version",
"LOCAL_NDK_STL_VARIANT": "stl", "LOCAL_NDK_STL_VARIANT": "stl",
"LOCAL_JAR_MANIFEST": "manifest", "LOCAL_JAR_MANIFEST": "manifest",
"LOCAL_JARJAR_RULES": "jarjar_rules", "LOCAL_JARJAR_RULES": "jarjar_rules",
"LOCAL_CERTIFICATE": "certificate", "LOCAL_CERTIFICATE": "certificate",
"LOCAL_PACKAGE_NAME": "name", "LOCAL_PACKAGE_NAME": "name",
"LOCAL_MODULE_RELATIVE_PATH": "relative_install_path",
} }
var listProperties = map[string]string{ var listProperties = map[string]string{

View File

@@ -211,6 +211,9 @@ type ccProperties struct {
// Minimum sdk version supported when compiling against the ndk // Minimum sdk version supported when compiling against the ndk
Sdk_version string Sdk_version string
// relative_install_path: install to a subdirectory of the default install path for the module
Relative_install_path string
} }
type unusedProperties struct { type unusedProperties struct {
@@ -1079,7 +1082,7 @@ func (c *CCLibrary) installSharedLibrary(ctx common.AndroidModuleContext, flags
installDir = "lib64" installDir = "lib64"
} }
ctx.InstallFile(installDir, c.out) ctx.InstallFile(filepath.Join(installDir, c.properties.Relative_install_path), c.out)
} }
func (c *CCLibrary) installModule(ctx common.AndroidModuleContext, flags CCFlags) { func (c *CCLibrary) installModule(ctx common.AndroidModuleContext, flags CCFlags) {
@@ -1280,7 +1283,7 @@ func (c *CCBinary) compileModule(ctx common.AndroidModuleContext,
} }
func (c *CCBinary) installModule(ctx common.AndroidModuleContext, flags CCFlags) { func (c *CCBinary) installModule(ctx common.AndroidModuleContext, flags CCFlags) {
ctx.InstallFile("bin", c.out) ctx.InstallFile(filepath.Join("bin", c.properties.Relative_install_path), c.out)
} }
type ccTest struct { type ccTest struct {