Commit 67e8c60e authored by liaoyuke's avatar liaoyuke Committed by Commit bot

[Refactor Xcode Objects] Allow extra attributes for native targets.

This CL refactors xcode objects to allow specifying extra attributes for native
targets, which enables configuring the build settings.

BUG=614818

Review-Url: https://codereview.chromium.org/2591893002
Cr-Commit-Position: refs/heads/master@{#440184}
parent 13ed2e69
...@@ -679,7 +679,8 @@ void PBXProject::AddNativeTarget(const std::string& name, ...@@ -679,7 +679,8 @@ void PBXProject::AddNativeTarget(const std::string& name,
const std::string& type, const std::string& type,
const std::string& output_name, const std::string& output_name,
const std::string& output_type, const std::string& output_type,
const std::string& shell_script) { const std::string& shell_script,
const PBXAttributes& extra_attributes) {
base::StringPiece ext = FindExtension(&output_name); base::StringPiece ext = FindExtension(&output_name);
PBXFileReference* product = static_cast<PBXFileReference*>( PBXFileReference* product = static_cast<PBXFileReference*>(
products_->AddChild(base::MakeUnique<PBXFileReference>( products_->AddChild(base::MakeUnique<PBXFileReference>(
...@@ -691,7 +692,7 @@ void PBXProject::AddNativeTarget(const std::string& name, ...@@ -691,7 +692,7 @@ void PBXProject::AddNativeTarget(const std::string& name,
? output_name.substr(0, ext_offset - 1) ? output_name.substr(0, ext_offset - 1)
: output_name; : output_name;
PBXAttributes attributes; PBXAttributes attributes = extra_attributes;
attributes["CODE_SIGNING_REQUIRED"] = "NO"; attributes["CODE_SIGNING_REQUIRED"] = "NO";
attributes["CONFIGURATION_BUILD_DIR"] = "."; attributes["CONFIGURATION_BUILD_DIR"] = ".";
attributes["PRODUCT_NAME"] = product_name; attributes["PRODUCT_NAME"] = product_name;
......
...@@ -297,7 +297,8 @@ class PBXProject : public PBXObject { ...@@ -297,7 +297,8 @@ class PBXProject : public PBXObject {
const std::string& type, const std::string& type,
const std::string& output_name, const std::string& output_name,
const std::string& output_type, const std::string& output_type,
const std::string& shell_script); const std::string& shell_script,
const PBXAttributes& extra_attributes = PBXAttributes());
void SetProjectDirPath(const std::string& project_dir_path); void SetProjectDirPath(const std::string& project_dir_path);
void SetProjectRoot(const std::string& project_root); void SetProjectRoot(const std::string& project_root);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment