This patch updates and modifies some of the CMake support for building on Darwin platforms with the goal of adding support for iOS and making the code more managable. The following changes are present:
- Updated add_compiler_rt_object_libraries to properly handle setting architectures
- Added cmake/Modules/CompilerRTDarwinUtils.cmake to contain darwin-specific functions for detecting toolchain features
- Added iOS-specific flags
- Re-structured the code for setting platform-specific flags and enabling platforms
- Updated call sites of add_compiler_rt_darwin_dynamic_runtime to use SANITIZER_COMMON_DARWIN_${os}_ARCHES
- Added COMPILER_RT_ENABLE_IOS option (default value is Off) to control building for iOS
This looks weird. It's just a coincidence that -stdlib=libc++ is both linker and compile flag. Not all compiler flags might be passed here.