-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Cleanup the setting of C and C++ compiler flags: * (Almost) all compiler flags are set uniformly in the system/bt/Android.mk file. * Enable by default breaking the compilation if there is a compilation warning: -Werror * Enable most compilation warnings: -Wall -Wextra * Renamed Android.mk related flags: - bdroid_C_INCLUDES -> bluetooth_C_INCLUDES - bdroid_CFLAGS -> bluetooth_CFLAGS * Introduce variables for C-only and C++ only compiler: - bluetooth_CFLAGS: common C and C++ compiler flags - bluetooth_CONLYFLAGS: C only compiler flags - bluetooth_CPPFLAGS: C++ only compiler flags * Disable warnings for existing issues - to be removed as issues are resolved * Add a workaround for libchrome and -DNDEBUG usage. Bug: 26879229 Change-Id: Ie7595965ca0c8ead0e95e983e76c327e7891b2c3
- Loading branch information
Pavlin Radoslavov
authored and
Andre Eisenbach
committed
Feb 18, 2016
1 parent
0ec558b
commit 0b60bb0
Showing
27 changed files
with
317 additions
and
159 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,64 @@ | ||
LOCAL_PATH := $(call my-dir) | ||
|
||
# Setup bdroid local make variables for handling configuration | ||
# Setup Bluetooth local make variables for handling configuration | ||
ifneq ($(BOARD_BLUETOOTH_BDROID_BUILDCFG_INCLUDE_DIR),) | ||
bdroid_C_INCLUDES := $(BOARD_BLUETOOTH_BDROID_BUILDCFG_INCLUDE_DIR) | ||
bdroid_CFLAGS += -DHAS_BDROID_BUILDCFG | ||
bluetooth_C_INCLUDES := $(BOARD_BLUETOOTH_BDROID_BUILDCFG_INCLUDE_DIR) | ||
bluetooth_CFLAGS += -DHAS_BDROID_BUILDCFG | ||
else | ||
bdroid_C_INCLUDES := | ||
bdroid_CFLAGS += -DHAS_NO_BDROID_BUILDCFG | ||
bluetooth_C_INCLUDES := | ||
bluetooth_CFLAGS += -DHAS_NO_BDROID_BUILDCFG | ||
endif | ||
|
||
ifneq ($(BOARD_BLUETOOTH_BDROID_HCILP_INCLUDED),) | ||
bdroid_CFLAGS += -DHCILP_INCLUDED=$(BOARD_BLUETOOTH_BDROID_HCILP_INCLUDED) | ||
bluetooth_CFLAGS += -DHCILP_INCLUDED=$(BOARD_BLUETOOTH_BDROID_HCILP_INCLUDED) | ||
endif | ||
|
||
ifneq ($(TARGET_BUILD_VARIANT),user) | ||
bdroid_CFLAGS += -DBLUEDROID_DEBUG | ||
bluetooth_CFLAGS += -DBLUEDROID_DEBUG | ||
endif | ||
|
||
bdroid_CFLAGS += -DEXPORT_SYMBOL="__attribute__((visibility(\"default\")))" | ||
bluetooth_CFLAGS += -DEXPORT_SYMBOL="__attribute__((visibility(\"default\")))" | ||
|
||
bdroid_CFLAGS += \ | ||
# | ||
# Common C/C++ compiler flags. | ||
# | ||
# - gnu-variable-sized-type-not-at-end is needed for a variable-size header in | ||
# a struct. | ||
# - constant-logical-operand is needed for code in l2c_utils.c that looks | ||
# intentional. | ||
# | ||
bluetooth_CFLAGS += \ | ||
-fvisibility=hidden \ | ||
-Wall \ | ||
-Wunused-but-set-variable \ | ||
-Werror=format-security \ | ||
-Werror=pointer-to-int-cast \ | ||
-Werror=int-to-pointer-cast \ | ||
-Werror=implicit-function-declaration \ | ||
-Wextra \ | ||
-Werror \ | ||
-Wno-typedef-redefinition \ | ||
-Wno-gnu-variable-sized-type-not-at-end \ | ||
-Wno-unused-parameter \ | ||
-Wno-maybe-uninitialized \ | ||
-Wno-uninitialized \ | ||
-Wno-missing-field-initializers \ | ||
-Wno-unused-variable \ | ||
-Wno-non-literal-null-conversion \ | ||
-Wno-sign-compare \ | ||
-Wno-incompatible-pointer-types \ | ||
-Wno-unused-function \ | ||
-Wno-missing-braces \ | ||
-Wno-enum-conversion \ | ||
-Wno-logical-not-parentheses \ | ||
-Wno-parentheses \ | ||
-Wno-constant-logical-operand \ | ||
-Wno-format \ | ||
-UNDEBUG \ | ||
-DLOG_NDEBUG=1 | ||
|
||
bluetooth_CONLYFLAGS += -std=c99 | ||
bluetooth_CPPFLAGS := | ||
|
||
include $(call all-subdir-makefiles) | ||
|
||
# Cleanup our locals | ||
bdroid_C_INCLUDES := | ||
bdroid_CFLAGS := | ||
bluetooth_C_INCLUDES := | ||
bluetooth_CFLAGS := | ||
bluetooth_CONLYFLAGS := | ||
bluetooth_CPPFLAGS := |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,3 @@ | ||
LOCAL_PATH := $(call my-dir) | ||
|
||
include $(call all-subdir-makefiles) | ||
|
||
# Cleanup our locals | ||
#bdroid_C_INCLUDES := | ||
#bdroid_CFLaGS := |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,3 @@ | ||
LOCAL_PATH := $(call my-dir) | ||
|
||
include $(call all-subdir-makefiles) | ||
|
||
# Cleanup our locals | ||
#bdroid_C_INCLUDES := | ||
#bdroid_CFLaGS := |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.