Build: Provide analyzer definitions
[BuildOptions]
# While there are no PCDs as of now, there at least are some custom macros.
DEFINE OCPKG_BUILD_OPTIONS_GEN = -D DISABLE_NEW_DEPRECATED_INTERFACES $(OCPKG_BUILD_OPTIONS)
+ DEFINE OCPKG_ANAL_OPTIONS_GEN = -DANALYZER_UNREACHABLE='__builtin_unreachable' -DANALYZER_NORETURN='__attribute__((noreturn))'
- GCC:DEBUG_*_*_CC_FLAGS = $(OCPKG_BUILD_OPTIONS_GEN) -D OC_DEBUG_TARGET
- GCC:NOOPT_*_*_CC_FLAGS = $(OCPKG_BUILD_OPTIONS_GEN) -D OC_NOOPT_TARGET
- GCC:RELEASE_*_*_CC_FLAGS = $(OCPKG_BUILD_OPTIONS_GEN) -D OC_RELEASE_TARGET
+ GCC:DEBUG_*_*_CC_FLAGS = $(OCPKG_BUILD_OPTIONS_GEN) $(OCPKG_ANAL_OPTIONS_GEN) -D OC_DEBUG_TARGET
+ GCC:NOOPT_*_*_CC_FLAGS = $(OCPKG_BUILD_OPTIONS_GEN) $(OCPKG_ANAL_OPTIONS_GEN) -D OC_NOOPT_TARGET
+ GCC:RELEASE_*_*_CC_FLAGS = $(OCPKG_BUILD_OPTIONS_GEN) $(OCPKG_ANAL_OPTIONS_GEN) -D OC_RELEASE_TARGET
MSFT:DEBUG_*_*_CC_FLAGS = $(OCPKG_BUILD_OPTIONS_GEN) -D OC_DEBUG_TARGET
MSFT:NOOPT_*_*_CC_FLAGS = $(OCPKG_BUILD_OPTIONS_GEN) -D OC_NOOPT_TARGET
MSFT:RELEASE_*_*_CC_FLAGS = $(OCPKG_BUILD_OPTIONS_GEN) -D OC_RELEASE_TARGET
- XCODE:DEBUG_*_*_CC_FLAGS = $(OCPKG_BUILD_OPTIONS_GEN) -D OC_DEBUG_TARGET
- XCODE:NOOPT_*_*_CC_FLAGS = $(OCPKG_BUILD_OPTIONS_GEN) -D OC_NOOPT_TARGET
- XCODE:RELEASE_*_*_CC_FLAGS = -Oz -flto $(OCPKG_BUILD_OPTIONS_GEN) -D OC_RELEASE_TARGET
+ XCODE:DEBUG_*_*_CC_FLAGS = $(OCPKG_BUILD_OPTIONS_GEN) $(OCPKG_ANAL_OPTIONS_GEN) -D OC_DEBUG_TARGET
+ XCODE:NOOPT_*_*_CC_FLAGS = $(OCPKG_BUILD_OPTIONS_GEN) $(OCPKG_ANAL_OPTIONS_GEN) -D OC_NOOPT_TARGET
+ XCODE:RELEASE_*_*_CC_FLAGS = $(OCPKG_BUILD_OPTIONS_GEN) $(OCPKG_ANAL_OPTIONS_GEN) -D OC_RELEASE_TARGET -Oz -flto
