[libc++] Localize CMake code only related to the shared library

Summary:
There's a lot of CMake logic that's only relevant to the shared library,
yet it was using a code path and setting variables that impact both the
shared and the static libraries. This patch moves this logic so that it
clearly only impacts the shared library.

Reviewers: phosek, smeenai, EricWF

Subscribers: mgorny, christof, jkorous, dexonsmith, libcxx-commits

Tags: #libc

Differential Revision: https://reviews.llvm.org/D60276

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@357811 91177308-0d34-0410-b5e6-96231b3b80d8
1 file changed