CMake-3.9 doesn't let compilation units depend on their dependent libraries.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305635
91177308-0d34-0410-b5e6-
96231b3b80d8
set(${target}_OLD_LLVM_LINK_COMPONENTS ${LLVM_LINK_COMPONENTS})
set(LLVM_LINK_COMPONENTS ${LLVM_LINK_COMPONENTS} TableGen)
- if(NOT XCODE)
+ # CMake-3.9 doesn't let compilation units depend on their dependent libraries.
+ if(NOT (CMAKE_GENERATOR STREQUAL "Ninja" AND NOT CMAKE_VERSION VERSION_LESS 3.9) AND NOT XCODE)
# FIXME: It leaks to user, callee of add_tablegen.
set(LLVM_ENABLE_OBJLIB ON)
endif()