From 394d351ad783e370318967cfab70f065e4267840 Mon Sep 17 00:00:00 2001 From: Saleem Abdulrasool Date: Thu, 1 Sep 2016 20:49:54 +0000 Subject: [PATCH] build: don't add -fPIC on Windows `-fPIC` doesn't make much sense for Windows, since Windows DLLs aren't compiled position independent and are instead relocated at runtime. Patch by Shoaib Meenai! llvm-svn: 280413 --- libcxx/lib/CMakeLists.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libcxx/lib/CMakeLists.txt b/libcxx/lib/CMakeLists.txt index e6f9ff68348c..dd0f663740d5 100644 --- a/libcxx/lib/CMakeLists.txt +++ b/libcxx/lib/CMakeLists.txt @@ -72,7 +72,9 @@ add_library_flags_if(LIBCXX_HAS_GCC_S_LIB gcc_s) add_library_flags_if(LIBCXX_HAVE_CXX_ATOMICS_WITH_LIB atomic) # Setup flags. -add_flags_if_supported(-fPIC) +if (NOT WIN32) + add_flags_if_supported(-fPIC) +endif() add_link_flags_if_supported(-nodefaultlibs) if ( APPLE AND (LIBCXX_CXX_ABI_LIBNAME STREQUAL "libcxxabi" OR