Skip to content

Commit

Permalink
The TableGen parts of the CMake build are seriously broken. This fixes
Browse files Browse the repository at this point in the history
one aspect of them by having them use the (annoying, if not broken)
proper library dependency model for adding the LLVMTableGen library as
a dependency. This could manifest as a link order issue in the presence
of separate LLVM / Clang source builds with CMake and a linker that
really cares about such things.

Also, add the Support dependency to llvm-tblgen itself so that it
doesn't rely on TableGen's transitive Support dependency. A parallel
change for clang-tblgen will be forthcoming.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@143531 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
chandlerc committed Nov 2, 2011
1 parent 3f2b2c2 commit 1bfc9f8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
4 changes: 3 additions & 1 deletion cmake/modules/TableGen.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,10 @@ endif()
macro(add_tablegen target project)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${LLVM_TOOLS_BINARY_DIR})

set(${target}_OLD_LLVM_LINK_COMPONENTS ${LLVM_LINK_COMPONENTS})
set(LLVM_LINK_COMPONENTS ${LLVM_LINK_COMPONENTS} TableGen)
add_llvm_utility(${target} ${ARGN})
set(LLVM_LINK_COMPONENTS ${target}_OLD_LLVM_LINK_COMPONENTS)

set(${project}_TABLEGEN "${target}" CACHE
STRING "Native TableGen executable. Saves building one when cross-compiling.")
Expand Down Expand Up @@ -110,7 +113,6 @@ macro(add_tablegen target project)
endif()
endif()

target_link_libraries(${target} LLVMSupport LLVMTableGen)
if( MINGW )
target_link_libraries(${target} imagehlp psapi)
if(CMAKE_SIZEOF_VOID_P MATCHES "8")
Expand Down
1 change: 1 addition & 0 deletions utils/TableGen/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
set(LLVM_REQUIRES_EH 1)
set(LLVM_REQUIRES_RTTI 1)
set(LLVM_LINK_COMPONENTS Support)

add_tablegen(llvm-tblgen LLVM
ARMDecoderEmitter.cpp
Expand Down

0 comments on commit 1bfc9f8

Please sign in to comment.