In 395271a, I simplified how we handled the target triple for the
runtimes. However, in doing so, we stopped considering the default
in CMAKE_CXX_COMPILER_TARGET, so we'd use the LLVM_DEFAULT_TARGET_TRIPLE
(which is the host triple) even if CMAKE_CXX_COMPILER_TARGET was specified.
This commit fixes that problem and also refactors the code so that it's
easy to see what the default value is.
The fact that nobody seems to have been broken by this makes me think
that perhaps nobody is using CMAKE_CXX_COMPILER_TARGET to specify the
triple -- but it should still work.
This changes the semantics slightly. Previously the values of LIBCXX_TARGET_TRIPLE, LIBCXX_SYSROOT, and LIBCXX_GCC_TOOLCHAIN wouldn't be cached, so if you changed CMAKE_CXX_COMPILER_TARGET, CMAKE_SYSROOT, or CMAKE_CXX_COMPILER_EXTERNAL_TOOLCHAIN those changes would be immediately picked. Now, you'll have to modify LIBCXX_TARGET_TRIPLE, LIBCXX_SYSROOT, and LIBCXX_GCC_TOOLCHAIN instead because any subsequent changes to CMAKE_CXX_COMPILER_TARGET, CMAKE_SYSROOT, or CMAKE_CXX_COMPILER_EXTERNAL_TOOLCHAIN would be ignored.