Merge tag 'v6.5.1'
[xcsoar.git] / build / flags.mk
blob9137b5a5d2a346d4ee9820746ba11557d8cf65ca
1 CXX_FEATURES = -fno-exceptions -fno-rtti
2 CXX_FEATURES += -std=gnu++0x
3 CXX_FEATURES += -fno-threadsafe-statics
4 CXX_FEATURES += -fmerge-all-constants
6 ifeq ($(CLANG),n)
7 CXX_FEATURES += -fconserve-space -fno-operator-names
8 endif
10 ifneq ($(TARGET),WINE)
11 C_FEATURES = -std=gnu99
12 else
13 # libwine fails with -std=gnu99 due to funny "extern inline" tricks in
14 # winnt.h
15 C_FEATURES =
16 endif
18 ifeq ($(HAVE_WIN32),n)
19 CXX_FEATURES += -fvisibility=hidden
20 C_FEATURES += -fvisibility=hidden
21 endif
23 ifeq ($(DEBUG)$(HAVE_WIN32)$(TARGET_IS_DARWIN),nnn)
24 CXX_FEATURES += -ffunction-sections
25 C_FEATURES += -ffunction-sections
26 TARGET_LDFLAGS += -Wl,--gc-sections
27 endif
29 ALL_CPPFLAGS = $(TARGET_INCLUDES) $(INCLUDES) $(TARGET_CPPFLAGS) $(CPPFLAGS) $(EXTRA_CPPFLAGS)
30 ALL_CXXFLAGS = $(OPTIMIZE) $(FLAGS_PROFILE) $(CXX_FEATURES) $(CXXFLAGS) $(EXTRA_CXXFLAGS)
31 ALL_CFLAGS = $(OPTIMIZE) $(FLAGS_PROFILE) $(C_FEATURES) $(CFLAGS) $(EXTRA_CFLAGS)
33 ALL_LDFLAGS = $(filter-out -emit-llvm,$(OPTIMIZE)) $(TARGET_LDFLAGS) $(FLAGS_PROFILE) $(LDFLAGS)
34 ALL_LDLIBS = $(TARGET_LDLIBS) $(COVERAGE_LDLIBS) $(LDLIBS)