build: add centroiding C++ support

Centroiding source is in C++. This CL removes -W flags only for building
C files from CFLAGS and also prevents typedef existing C++ keyword
wchar_t.

BUG=b:120961468
BRANCH=none
TEST=make buildall

Change-Id: Ifb8793a8e7e69b26a742b7dbf70289747a0ee7b3
Signed-off-by: Rong Chang <rongchang@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1372874
Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com>
Reviewed-by: Tai-Hsu Lin <sheckylin@chromium.org>
This commit is contained in:
Rong Chang 2018-12-10 17:18:55 +08:00 committed by chrome-bot
parent ebb25bc556
commit 8d8e6eb819
3 changed files with 5 additions and 2 deletions

View File

@ -78,7 +78,7 @@ cmd_fuzz_exe = $(CXX) $^ $(HOST_TEST_LDFLAGS) $(LDFLAGS_EXTRA) -o $@
cmd_run_fuzz = build/host/$*/$*.exe -seed=1 -runs=1 $(silent) \
$(silent_err) || (echo "Test $* failed!" && false)
cmd_exe = $(CC) $(ro-objs) $(HOST_TEST_LDFLAGS) -o $@
cmd_c_to_o = $(CC) $(CFLAGS) -MMD -MP -MF $@.d -c $< -o $(@D)/$(@F)
cmd_c_to_o = $(CC) $(C_WARN) $(CFLAGS) -MMD -MP -MF $@.d -c $< -o $(@D)/$(@F)
cmd_cxx_to_o = $(CXX) -std=c++11 $(CFLAGS) $(CXXFLAGS) -MMD -MP -MF $@.d -c $< \
-o $(@D)/$(@F)
cmd_c_to_build = $(BUILDCC) $(BUILD_CFLAGS) \

View File

@ -92,7 +92,7 @@ ifneq ($(BOARD),host)
CPPFLAGS+=-ffreestanding -fno-builtin -nostdinc -nostdlib
CPPFLAGS+=-Ibuiltin/
endif
CFLAGS=$(CPPFLAGS) $(CFLAGS_CPU) $(CFLAGS_DEBUG) $(CFLAGS_WARN) $(CFLAGS_y)
CFLAGS=$(CPPFLAGS) $(CFLAGS_CPU) $(CFLAGS_DEBUG) $(COMMON_WARN) $(CFLAGS_y)
CFLAGS+= -ffunction-sections -fshort-wchar
ifneq ($(cc-name),clang)
# TODO(chromium:854924): LLVM support for this flag is coming soon.

View File

@ -25,7 +25,10 @@ typedef __SIZE_TYPE__ ssize_t;
#ifndef __WCHAR_TYPE__
#define __WCHAR_TYPE__ int
#endif
#ifndef __cplusplus
typedef __WCHAR_TYPE__ wchar_t;
#endif
/* This macro definition is duplicated in compile_time_macros.h. It still needs
* to be defined here to support code that expects offsetof to be defined in the