summaryrefslogtreecommitdiffstats
path: root/tools/gn/target_unittest.cc
diff options
context:
space:
mode:
authorthakis@chromium.org <thakis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-11-03 04:51:00 +0000
committerthakis@chromium.org <thakis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-11-03 04:51:00 +0000
commit404b9863075145cde48e00b47169e3d0446266b6 (patch)
treee027cb14e3e099f42838e860cb196438940d7dfb /tools/gn/target_unittest.cc
parent3f2358ec87d2422c790b75e000d4771288089018 (diff)
downloadchromium_src-404b9863075145cde48e00b47169e3d0446266b6.zip
chromium_src-404b9863075145cde48e00b47169e3d0446266b6.tar.gz
chromium_src-404b9863075145cde48e00b47169e3d0446266b6.tar.bz2
Revert 232657 "GN: toolchain threading cleanup"
Broke linux clang bots: ../../tools/gn/ninja_helper_unittest.cc:20:9:error: field 'settings' will be initialized after field 'toolchain' [-Werror,-Wreorder] This happened on your try jobs too. > GN: toolchain threading cleanup > > Remove the thread-unsafe toolchain pointer on the otherwise-threadsafe Settings object. I replaced it with the toolchain label, and moved the is_default flag from the toolchain to the Settings object. > > This required that I pass the toolchain around in a few more places, but also simplifies some other cases. > > I removed the toolchain prefix from Ninja rules for the default toolchain since that's not necessary any more for GYP compat. > > This fixes an annoying double-free in the toolchain manager. I think my current refactor will clean this up in a later phase. > > R=scottmg@chromium.org > > Review URL: https://codereview.chromium.org/51693002 TBR=brettw@chromium.org Review URL: https://codereview.chromium.org/46313006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@232661 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'tools/gn/target_unittest.cc')
-rw-r--r--tools/gn/target_unittest.cc13
1 files changed, 6 insertions, 7 deletions
diff --git a/tools/gn/target_unittest.cc b/tools/gn/target_unittest.cc
index ef213b5..ea1700f 100644
--- a/tools/gn/target_unittest.cc
+++ b/tools/gn/target_unittest.cc
@@ -15,17 +15,16 @@ class TargetTest : public testing::Test {
public:
TargetTest()
: build_settings_(),
- settings_(&build_settings_, std::string()),
- toolchain_(&settings_, Label(SourceDir("//tc/"), "tc")) {
- settings_.set_toolchain_label(toolchain_.label());
+ toolchain_(Label(SourceDir("//tc/"), "tc")),
+ settings_(&build_settings_, &toolchain_, std::string()) {
}
virtual ~TargetTest() {
}
protected:
BuildSettings build_settings_;
- Settings settings_;
Toolchain toolchain_;
+ Settings settings_;
};
} // namespace
@@ -123,15 +122,15 @@ TEST_F(TargetTest, DependentConfigs) {
b.deps().push_back(LabelTargetPair(&c));
// Normal non-inherited config.
- Config config(&settings_, Label(SourceDir("//foo/"), "config"));
+ Config config(Label(SourceDir("//foo/"), "config"));
c.configs().push_back(LabelConfigPair(&config));
// All dependent config.
- Config all(&settings_, Label(SourceDir("//foo/"), "all"));
+ Config all(Label(SourceDir("//foo/"), "all"));
c.all_dependent_configs().push_back(LabelConfigPair(&all));
// Direct dependent config.
- Config direct(&settings_, Label(SourceDir("//foo/"), "direct"));
+ Config direct(Label(SourceDir("//foo/"), "direct"));
c.direct_dependent_configs().push_back(LabelConfigPair(&direct));
c.OnResolved();