Revert "[libc++] Do not force building with -fPIC"
This reverts commit r355764.
CMake does not turn -fPIC on for us by default. so this patch breaks
standalone builds. The only reason it hasn't broken any bots is because
LLVM turns on and specifies '-fPIC' for us.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@355756 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt
index 1b10bc6..22a9bf3 100644
--- a/lib/CMakeLists.txt
+++ b/lib/CMakeLists.txt
@@ -105,6 +105,10 @@
endif()
# Setup flags.
+if (NOT WIN32)
+ add_flags_if_supported(-fPIC)
+endif()
+
add_link_flags_if_supported(-nodefaultlibs)
if (LIBCXX_TARGETING_MSVC)