Skip to content

Commit

Permalink
New g++ -Werror failure
Browse files Browse the repository at this point in the history
The current gn code still has this problem, so upgrading gn isn't useful.
Hence a custom patch.
  • Loading branch information
HinTak committed Dec 27, 2024
1 parent ca2de71 commit 2fa072e
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 0 deletions.
35 changes: 35 additions & 0 deletions patch/0001-Fix-for-Werror-redundant-move-for-newer-g.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
From b34a4e2f812e916f806f61412dc3f70f31a32fd0 Mon Sep 17 00:00:00 2001
From: Hin-Tak Leung <htl10@users.sourceforge.net>
Date: Fri, 27 Dec 2024 02:08:12 +0000
Subject: [PATCH] Fix for -Werror=redundant-move for newer g++

Signed-off-by: Hin-Tak Leung <htl10@users.sourceforge.net>
---
src/gn/desc_builder.cc | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/gn/desc_builder.cc b/src/gn/desc_builder.cc
index 444a5e02..3ef170c3 100644
--- a/src/gn/desc_builder.cc
+++ b/src/gn/desc_builder.cc
@@ -167,7 +167,7 @@ class BaseDescBuilder {
base::ListValue res;
for (const auto& v : vector)
res.GetList().emplace_back(ToBaseValue(v));
- return std::move(res);
+ return res;
}

base::Value ToBaseValue(const Scope* scope) {
@@ -176,7 +176,7 @@ class BaseDescBuilder {
scope->GetCurrentScopeValues(&map);
for (const auto& v : map)
res.SetKey(v.first, ToBaseValue(v.second));
- return std::move(res);
+ return res;
}

base::Value ToBaseValue(const Value& val) {
--
2.47.1

1 change: 1 addition & 0 deletions scripts/build_Linux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ fi
git clone https://gn.googlesource.com/gn && \
cd gn && \
git checkout fe330c0ae1ec29db30b6f830e50771a335e071fb && \
patch -p1 < ../patch/0001-Fix-for-Werror-redundant-move-for-newer-g.patch && \
python3 build/gen.py && \
ninja -C out gn && \
cd ..
Expand Down

0 comments on commit 2fa072e

Please sign in to comment.