Index: lib/CMakeLists.txt =================================================================== --- lib/CMakeLists.txt +++ lib/CMakeLists.txt @@ -51,6 +51,13 @@ # Setup flags. append_if(compile_flags LIBCXX_HAS_FPIC_FLAG -fPIC) +# If -nostdinc++ is present, then remove it from CMAKE_CXX_FLAGS and +# move it to compile_flags so that it doesn't get passed to the linker +# and cause an unused flag warning. +if (LIBCXX_HAS_NOSTDINCXX_FLAG) + list(APPEND compile_flags -nostdinc++) + string(REPLACE "-nostdinc++" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") +endif() append_if(link_flags LIBCXX_HAS_NODEFAULTLIBS_FLAG -nodefaultlibs) if ( APPLE )