summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2011-07-14 23:42:32 +0000
committerDouglas Gregor <dgregor@apple.com>2011-07-14 23:42:32 +0000
commitd7f2f9d07b0d61bbe12ab118d4402ef22882ce5b (patch)
tree684bca282d893f52e1b49de92908e0aacc158507
parentdafd598f05b1a4cc3d8c7276d188e573c949e985 (diff)
downloadbcm5719-llvm-d7f2f9d07b0d61bbe12ab118d4402ef22882ce5b.tar.gz
bcm5719-llvm-d7f2f9d07b0d61bbe12ab118d4402ef22882ce5b.zip
Tweak the CMake build so that building a project just containing Clang
(and linking to an already-build LLVM) works with Xcode. The resulting Xcode project for Clang is quite a bit smaller and builds/loads faster. llvm-svn: 135216
-rw-r--r--clang/CMakeLists.txt13
1 files changed, 11 insertions, 2 deletions
diff --git a/clang/CMakeLists.txt b/clang/CMakeLists.txt
index aa89823e76f..3ad60eaff51 100644
--- a/clang/CMakeLists.txt
+++ b/clang/CMakeLists.txt
@@ -20,7 +20,11 @@ if( CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR )
endif()
if( NOT EXISTS "${CLANG_PATH_TO_LLVM_BUILD}/bin/tblgen${CMAKE_EXECUTABLE_SUFFIX}" )
- message(FATAL_ERROR "Please set CLANG_PATH_TO_LLVM_BUILD to a directory containing a LLVM build.")
+ # Looking for bin/Debug/tblgen is a complete hack. How can we get
+ # around this?
+ if( NOT EXISTS "${CLANG_PATH_TO_LLVM_BUILD}/bin/Debug/tblgen${CMAKE_EXECUTABLE_SUFFIX}" )
+ message(FATAL_ERROR "Please set CLANG_PATH_TO_LLVM_BUILD to a directory containing a LLVM build.")
+ endif()
endif()
list(APPEND CMAKE_MODULE_PATH "${CLANG_PATH_TO_LLVM_BUILD}/share/llvm/cmake")
@@ -42,7 +46,12 @@ if( CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR )
include_directories("${PATH_TO_LLVM_BUILD}/include" "${LLVM_MAIN_INCLUDE_DIR}")
link_directories("${PATH_TO_LLVM_BUILD}/lib")
- set(LLVM_TABLEGEN_EXE "${PATH_TO_LLVM_BUILD}/bin/tblgen")
+ if( EXISTS "${CLANG_PATH_TO_LLVM_BUILD}/bin/tblgen${CMAKE_EXECUTABLE_SUFFIX}" )
+ set(LLVM_TABLEGEN_EXE "${PATH_TO_LLVM_BUILD}/bin/tblgen")
+ else()
+ # FIXME: This is an utter hack.
+ set(LLVM_TABLEGEN_EXE "${PATH_TO_LLVM_BUILD}/bin/Debug/tblgen")
+ endif()
set( CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin )
set( CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib )
OpenPOWER on IntegriCloud