Rewrite handling of LLVM_ENABLE_PIC. It was being processed after
config.h was generated, so it had no effect on it.
Thanks to arrowdodger for pointing out this and a tentative patch.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123119 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/cmake/config-ix.cmake b/cmake/config-ix.cmake
index 27f2964..f0e1176 100755
--- a/cmake/config-ix.cmake
+++ b/cmake/config-ix.cmake
@@ -162,12 +162,9 @@
# Define LLVM_MULTITHREADED if gcc atomic builtins exists.
include(CheckAtomic)
+set(ENABLE_PIC ${LLVM_ENABLE_PIC})
+
include(CheckCXXCompilerFlag)
-# On windows all code is position-independent and mingw warns if -fPIC
-# is in the command-line.
-if( NOT WIN32 )
- check_cxx_compiler_flag("-fPIC" SUPPORTS_FPIC_FLAG)
-endif()
check_cxx_compiler_flag("-Wno-variadic-macros" SUPPORTS_NO_VARIADIC_MACROS_FLAG)