Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9262b6fe authored by Dan Albert's avatar Dan Albert
Browse files

Disable availability macros in libc++ on Darwin.

libc++'s headers are annotated with availability macros that indicate
which version of Mac OS was the first to ship with a libc++ feature
available in its *system's* libc++.dylib. We do not use the system's
library, but rather ship our own. As such, these availability
attributes are meaningless for us but cause build breaks when we try
to use code that would not be available in the system's dylib.

Test: removed the darwin check and checked showcommands on linux
Bug: None
Change-Id: I5f69f337baa29fcdf84b5e2fe46bf4f85904d1cd
parent 08e71596
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -74,6 +74,16 @@ my_cxx_ldlibs :=
ifneq ($(filter $(my_cxx_stl),libc++ libc++_static),)
    my_cflags += -D_USING_LIBCXX

    ifeq ($($(my_prefix)OS),darwin)
        # libc++'s headers are annotated with availability macros that indicate
        # which version of Mac OS was the first to ship with a libc++ feature
        # available in its *system's* libc++.dylib. We do not use the system's
        # library, but rather ship our own. As such, these availability
        # attributes are meaningless for us but cause build breaks when we try
        # to use code that would not be available in the system's dylib.
        my_cppflags += -D_LIBCPP_DISABLE_AVAILABILITY
    endif

    # Note that the structure of this means that LOCAL_CXX_STL := libc++ will
    # use the static libc++ for static executables.
    ifeq ($(my_link_type),dynamic)