summaryrefslogtreecommitdiffstats
path: root/llvm
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
commit073b0b12a5714a73f38cae8d446a523e1e186f6c (patch)
treed852b06a1556e077e84ea0507eef085231cf2c30 /llvm
parentd4081c697a54d2be237261219f40ee19bdbf2897 (diff)
downloadbcm5719-llvm-073b0b12a5714a73f38cae8d446a523e1e186f6c.tar.gz
bcm5719-llvm-073b0b12a5714a73f38cae8d446a523e1e186f6c.zip
CMake: Option for building with -fPIC.
llvm-svn: 59739
Diffstat (limited to 'llvm')
-rw-r--r--llvm/CMakeLists.txt11
1 files changed, 11 insertions, 0 deletions
diff --git a/llvm/CMakeLists.txt b/llvm/CMakeLists.txt
index 940326e732d..2072c703715 100644
--- a/llvm/CMakeLists.txt
+++ b/llvm/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 )
OpenPOWER on IntegriCloud