OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "tools/gn/gyp_binary_target_writer.h" | 5 #include "tools/gn/gyp_binary_target_writer.h" |
6 | 6 |
7 #include <set> | 7 #include <set> |
8 | 8 |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/strings/string_util.h" | 10 #include "base/strings/string_util.h" |
(...skipping 455 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
466 | 466 |
467 // Architecture. GYP reads this value and uses it to generate the -arch | 467 // Architecture. GYP reads this value and uses it to generate the -arch |
468 // flag, so we always want to remove it from the cflags (which is a side | 468 // flag, so we always want to remove it from the cflags (which is a side |
469 // effect of what GetMacArch does), even in cases where we don't use the | 469 // effect of what GetMacArch does), even in cases where we don't use the |
470 // value (in the iOS arm below). | 470 // value (in the iOS arm below). |
471 std::string arch = GetMacArch(&flags.cflags); | 471 std::string arch = GetMacArch(&flags.cflags); |
472 if (IsIOS(target)) { | 472 if (IsIOS(target)) { |
473 // When writing an iOS "target" (not host) target, we set VALID_ARCHS | 473 // When writing an iOS "target" (not host) target, we set VALID_ARCHS |
474 // instead of ARCHS and always use this hardcoded value. This matches the | 474 // instead of ARCHS and always use this hardcoded value. This matches the |
475 // GYP build. | 475 // GYP build. |
476 Indent(indent + kExtraIndent) << "'VALID_ARCHS': 'armv7 i386',\n"; | 476 Indent(indent + kExtraIndent) << "'VALID_ARCHS': ['armv7', 'i386'],\n"; |
477 | 477 |
478 // Tell XCode to target both iPhone and iPad. GN has no such concept. | 478 // Tell XCode to target both iPhone and iPad. GN has no such concept. |
479 Indent(indent + kExtraIndent) << "'TARGETED_DEVICE_FAMILY': '1,2',\n"; | 479 Indent(indent + kExtraIndent) << "'TARGETED_DEVICE_FAMILY': '1,2',\n"; |
480 | 480 |
481 if (IsIOSSimulator(flags.cflags)) { | 481 if (IsIOSSimulator(flags.cflags)) { |
482 Indent(indent + kExtraIndent) << "'SDKROOT': 'iphonesimulator',\n"; | 482 Indent(indent + kExtraIndent) << "'SDKROOT': 'iphonesimulator',\n"; |
483 } else { | 483 } else { |
484 Indent(indent + kExtraIndent) << "'SDKROOT': 'iphoneos',\n"; | 484 Indent(indent + kExtraIndent) << "'SDKROOT': 'iphoneos',\n"; |
485 std::string min_ver = GetIPhoneVersionMin(&flags.cflags); | 485 std::string min_ver = GetIPhoneVersionMin(&flags.cflags); |
486 if (!min_ver.empty()) { | 486 if (!min_ver.empty()) { |
(...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
760 return; | 760 return; |
761 | 761 |
762 EscapeOptions options; | 762 EscapeOptions options; |
763 options.mode = ESCAPE_JSON; | 763 options.mode = ESCAPE_JSON; |
764 | 764 |
765 Indent(indent) << "'" << name << "': ["; | 765 Indent(indent) << "'" << name << "': ["; |
766 WriteArrayValues(out_, values); | 766 WriteArrayValues(out_, values); |
767 out_ << " ],\n"; | 767 out_ << " ],\n"; |
768 } | 768 } |
769 | 769 |
OLD | NEW |