从源代码安装后如何卸载 libc++?

How to uninstall libc++ after installing from source?

我使用以下脚本从源代码安装了 libc++。不支持 make uninstall。卸载它的最佳方法是什么?

git clone --depth=1 https://github.com/llvm-mirror/llvm.git llvm-source
git clone --depth=1 https://github.com/llvm-mirror/libcxx.git llvm-source/projects/libcxx
git clone --depth=1 https://github.com/llvm-mirror/libcxxabi.git llvm-source/projects/libcxxabi

export C_COMPILER=clang
export COMPILER=clang++

# Build and install libc++ 
mkdir llvm-build && cd llvm-build
cmake -DCMAKE_C_COMPILER=${C_COMPILER} -DCMAKE_CXX_COMPILER=${COMPILER} \
      -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX=/usr \
      ../llvm-source
make cxx
sudo make install-cxxabi install-cxx

好吧,经过大量搜索,很明显在make unintsall没有实现的情况下,没有自动甚至半自动卸载的方法。有两种方法可以解决这个问题:

  1. 如果使用 cmake,则 运行 再次安装,但将标志设置为 -DCMAKE_INSTALL_PREFIX=./output。这将导致 cmake 将所有文件放在 ./output 中。现在您可以观察文件,并手动删除它们。我认为默认情况下 cmake 会将这些文件放在 /usr/local.

  2. 如果生成 install_manifest.txt 文件,您可以使用另一个 cool trickcat install_manifest.txt | xargs echo sudo rm | sh.