From: NAKAMURA Takumi Date: Sat, 17 Jun 2017 13:45:55 +0000 (+0000) Subject: [CMake] Get rid of generating obj.*-tblgen if CMake >= 3.9 for Ninja generator. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5b6663a260689c3f1756f409c8a3f7edf015b313;p=llvm [CMake] Get rid of generating obj.*-tblgen if CMake >= 3.9 for Ninja generator. 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 --- diff --git a/cmake/modules/TableGen.cmake b/cmake/modules/TableGen.cmake index 21421e4fdbd..66d36fa5b50 100644 --- a/cmake/modules/TableGen.cmake +++ b/cmake/modules/TableGen.cmake @@ -104,7 +104,8 @@ macro(add_tablegen target project) 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()