X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=CMakeLists.txt;h=2072c703715d959407d318c2375df69433179fd1;hb=f6727b01a527369ecdbcf6ea0863dc776091f50c;hp=940326e732d3fcf07081b9cdf38654a3e9490cfb;hpb=6307b9440a3b8814bae8a29611fab5a57156576b;p=oota-llvm.git diff --git a/CMakeLists.txt b/CMakeLists.txt index 940326e732d..2072c703715 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 )