aboutsummaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorOscar Fuentes <ofv@wanadoo.es>2008-11-20 19:13:51 +0000
committerOscar Fuentes <ofv@wanadoo.es>2008-11-20 19:13:51 +0000
commit64fb4c8ccd4b8dbf3105f5fbbec03dea7c908f59 (patch)
treea244fbef6b0fd9838265d05ac403e0cbf3bfb265 /CMakeLists.txt
parentf13dcc2db8256d35648e9fa03bfcff6793ee9d7a (diff)
CMake: Option for building with -fPIC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59739 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt11
1 files changed, 11 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 940326e732..2072c70371 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -104,6 +104,17 @@ endif( EXISTS ${LLVM_TOOLS_BINARY_DIR}/llvm-config )
include(config-ix)
+option(LLVM_ENABLE_PIC "Build Position-Independent Code" OFF)
+
+if( LLVM_ENABLE_PIC )
+ if( SUPPORTS_FPIC_FLAG )
+ message(STATUS "Building with -fPIC")
+ add_definitions(-fPIC)
+ else( SUPPORTS_FPIC_FLAG )
+ message(STATUS "Warning: -fPIC not supported.")
+ endif()
+endif()
+
set( CMAKE_RUNTIME_OUTPUT_DIRECTORY ${LLVM_TOOLS_BINARY_DIR} )
set( CMAKE_LIBRARY_OUTPUT_DIRECTORY ${LLVM_BINARY_DIR}/lib )
set( CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${LLVM_BINARY_DIR}/lib )