summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2009-11-08 00:34:22 +0000
committerDaniel Dunbar <daniel@zuster.org>2009-11-08 00:34:22 +0000
commit36206182e12bb2728f88eaebf3082eb66d637635 (patch)
tree992e37a326123988296a9bda1db347d26df67cb6 /CMakeLists.txt
parent31bc849123011b8eae6bb3c79876d9a3c26a6a1d (diff)
downloadllvm-36206182e12bb2728f88eaebf3082eb66d637635.tar.gz
llvm-36206182e12bb2728f88eaebf3082eb66d637635.tar.bz2
llvm-36206182e12bb2728f88eaebf3082eb66d637635.tar.xz
Prevent warning spew about -fPIC when using CMake generated Xcode project files.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86427 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt20
1 files changed, 13 insertions, 7 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 5b30309bf3..794e8e951c 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -164,13 +164,19 @@ option(LLVM_ENABLE_PIC "Build Position-Independent Code" ON)
set(ENABLE_PIC 0)
if( LLVM_ENABLE_PIC )
- if( SUPPORTS_FPIC_FLAG )
- message(STATUS "Building with -fPIC")
- add_llvm_definitions(-fPIC)
- set(ENABLE_PIC 1)
- else( SUPPORTS_FPIC_FLAG )
- message(STATUS "Warning: -fPIC not supported.")
- endif()
+ if( XCODE )
+ # Xcode has -mdynamic-no-pic on by default, which overrides -fPIC. I don't
+ # know how to disable this, so just force ENABLE_PIC off for now.
+ message(STATUS "Warning: -fPIC not supported with Xcode.")
+ else( XCODE )
+ if( SUPPORTS_FPIC_FLAG )
+ message(STATUS "Building with -fPIC")
+ add_llvm_definitions(-fPIC)
+ set(ENABLE_PIC 1)
+ else( SUPPORTS_FPIC_FLAG )
+ message(STATUS "Warning: -fPIC not supported.")
+ endif()
+ endif()
endif()
set( CMAKE_RUNTIME_OUTPUT_DIRECTORY ${LLVM_TOOLS_BINARY_DIR} )