Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(31)

Unified Diff: Makefile.standalone

Issue 1572863003: Fix the g++ build. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Remove comment Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/IceELFObjectWriter.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Makefile.standalone
diff --git a/Makefile.standalone b/Makefile.standalone
index 64796c9b184aad1621269eff8b1fa4da043b87b6..eb9a3aa61b7272c9ad01f4a40886afa4d9cfac47 100644
--- a/Makefile.standalone
+++ b/Makefile.standalone
@@ -94,17 +94,6 @@ else
OBJDIR := $(OBJDIR)+Asserts
endif
-# Use g++ to compile, to check for errors/warnings that clang++ might have
-# missed. It's unlikely to link, unless LLVM was also built with g++, so the
-# compile_only target should be used.
-ifdef GPLUSPLUS
- CXX = CCACHE_CPP2=yes $(CCACHE) g++
- STDLIB_FLAGS =
- LLVM_EXTRA_WARNINGS="-Wno-unknown-pragmas -Wno-unused-parameter \
- -Wno-comment -Wno-enum-compare -Wno-strict-aliasing"
- OBJDIR := $(OBJDIR)+Gplusplus
-endif
-
ifdef UBSAN
OBJDIR := $(OBJDIR)+UBSan
CXX_EXTRA += -fsanitize=undefined -fno-sanitize=vptr \
@@ -192,6 +181,20 @@ SB_TRANSLATE := $(PNACL_BIN_PATH)/pnacl-translate
# Extra warnings that LLVM's build system adds in addition to -Wall.
LLVM_EXTRA_WARNINGS := -Wcovered-switch-default
+# Use g++ to compile, to check for errors/warnings that clang++ might have
+# missed. It's unlikely to link, unless LLVM was also built with g++, so the
+# compile_only target should be used. Note: This ifdef section is deliberately
+# placed here instead of with the other ifdef sections, so that its redefinition
+# of CXX/STDLIB_FLAGS/LLVM_EXTRA_WARNINGS follows their normal definitions.
+ifdef GPLUSPLUS
+ CXX := CCACHE_CPP2=yes $(CCACHE) g++
+ STDLIB_FLAGS :=
+ LLVM_EXTRA_WARNINGS := -Wno-unknown-pragmas -Wno-unused-parameter \
+ -Wno-comment -Wno-enum-compare -Wno-strict-aliasing \
+ -Wno-return-type
+ OBJDIR := $(OBJDIR)+Gplusplus
+endif
+
BASE_CXXFLAGS := -std=gnu++11 -Wall -Wextra -Werror -fno-rtti \
-fno-exceptions $(OPTLEVEL) $(ASSERTIONS) -g -pedantic \
$(LLVM_EXTRA_WARNINGS) $(CXX_EXTRA)
« no previous file with comments | « no previous file | src/IceELFObjectWriter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698