Returns flags that need to be added to .cc, and .mm compilations.
(self, configname)
| 706 | return cflags_c |
| 707 | |
| 708 | def GetCflagsCC(self, configname): |
| 709 | """Returns flags that need to be added to .cc, and .mm compilations.""" |
| 710 | self.configname = configname |
| 711 | cflags_cc = [] |
| 712 | |
| 713 | clang_cxx_language_standard = self._Settings().get( |
| 714 | "CLANG_CXX_LANGUAGE_STANDARD" |
| 715 | ) |
| 716 | # Note: Don't make c++0x to c++11 so that c++0x can be used with older |
| 717 | # clangs that don't understand c++11 yet (like Xcode 4.2's). |
| 718 | if clang_cxx_language_standard: |
| 719 | cflags_cc.append("-std=%s" % clang_cxx_language_standard) |
| 720 | |
| 721 | self._Appendf(cflags_cc, "CLANG_CXX_LIBRARY", "-stdlib=%s") |
| 722 | |
| 723 | if self._Test("GCC_ENABLE_CPP_RTTI", "NO", default="YES"): |
| 724 | cflags_cc.append("-fno-rtti") |
| 725 | if self._Test("GCC_ENABLE_CPP_EXCEPTIONS", "NO", default="YES"): |
| 726 | cflags_cc.append("-fno-exceptions") |
| 727 | if self._Test("GCC_INLINES_ARE_PRIVATE_EXTERN", "YES", default="NO"): |
| 728 | cflags_cc.append("-fvisibility-inlines-hidden") |
| 729 | if self._Test("GCC_THREADSAFE_STATICS", "NO", default="YES"): |
| 730 | cflags_cc.append("-fno-threadsafe-statics") |
| 731 | # Note: This flag is a no-op for clang, it only has an effect for gcc. |
| 732 | if self._Test("GCC_WARN_ABOUT_INVALID_OFFSETOF_MACRO", "NO", default="YES"): |
| 733 | cflags_cc.append("-Wno-invalid-offsetof") |
| 734 | |
| 735 | other_ccflags = [] |
| 736 | |
| 737 | for flag in self._Settings().get("OTHER_CPLUSPLUSFLAGS", ["$(inherited)"]): |
| 738 | # TODO: More general variable expansion. Missing in many other places too. |
| 739 | if flag in ("$inherited", "$(inherited)", "${inherited}"): |
| 740 | flag = "$OTHER_CFLAGS" |
| 741 | if flag in ("$OTHER_CFLAGS", "$(OTHER_CFLAGS)", "${OTHER_CFLAGS}"): |
| 742 | other_ccflags += self._Settings().get("OTHER_CFLAGS", []) |
| 743 | else: |
| 744 | other_ccflags.append(flag) |
| 745 | cflags_cc += other_ccflags |
| 746 | |
| 747 | self.configname = None |
| 748 | return cflags_cc |
| 749 | |
| 750 | def _AddObjectiveCGarbageCollectionFlags(self, flags): |
| 751 | gc_policy = self._Settings().get("GCC_ENABLE_OBJC_GC", "unsupported") |