Right now this script works because add_compiler_rt_object_libraries
unconditionally adds CMAKE_CXX_FLAGS to every target, even though
CMake will do this automatically for C++ files. Doing this breaks
when using -Werror=unused-command-line-argument and when
CMAKE_CXX_FLAGS contains flags that are not valid for building C or
assembly code (like -stdlib).
This change is needed because I'm changing the default -stdlib for
Android, and this build needs to use an explicit stdlib to revert to
the old behavior since it uses an old NDK.
This change needs to land in four parts:
- This change: use CMAKE_ASM_FLAGS.
- Remove the explicit CMAKE_CXX_FLAGS from add_compiler_rt_object_libraries.
- Reland the change to use an explicit -stdlib.
- Reland the change to make Android default to -stdlib=libc++.