[llvm] r309029 - [CMake] Allow TableGen.cmake to be included multiple times

don hinton via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 25 14:06:12 PDT 2017


Even better, thanks...

On Tue, Jul 25, 2017 at 2:03 PM, Chris Bieneman <beanz at apple.com> wrote:

> Yep. See r309030.
>
> -Chris
>
> On Jul 25, 2017, at 2:00 PM, don hinton <hintonda at gmail.com> wrote:
>
> This causes a warning:
>
> CMake Warning (dev) in cmake/modules/TableGen.cmake:
>   A logical block opening on the line
>
>     /Users/dhinton/projects/llvm_project/llvm/cmake/modules/TableGen.cmake:113
> (if)
>
>   closes on the line
>
>     /Users/dhinton/projects/llvm_project/llvm/cmake/modules/TableGen.cmake:124
> (endif)
>
>   with mis-matching arguments.
> Call Stack (most recent call first):
>   CMakeLists.txt:833 (include)
> This warning is for project developers.  Use -Wno-dev to suppress it.
>
>
> I think you just need to:
>
> diff --git a/cmake/modules/TableGen.cmake b/cmake/modules/TableGen.cmake
> index 8ee7f970991..7a3c50bb63f 100644
> --- a/cmake/modules/TableGen.cmake
> +++ b/cmake/modules/TableGen.cmake
> @@ -121,7 +121,7 @@ if(LLVM_USE_HOST_TOOLS AND NOT TARGET
> NATIVE_LIB_LLVMTABLEGEN)
>        COMMENT "Building libLLVMTableGen for native TableGen..."
>        USES_TERMINAL)
>    add_custom_target(NATIVE_LIB_LLVMTABLEGEN DEPENDS LIB_LLVMTABLEGEN)
> -endif(LLVM_USE_HOST_TOOLS)
> +endif(LLVM_USE_HOST_TOOLS AND NOT TARGET NATIVE_LIB_LLVMTABLEGEN)
>
>  macro(add_tablegen target project)
>    set(${target}_OLD_LLVM_LINK_COMPONENTS ${LLVM_LINK_COMPONENTS})
>
>
>
> On Tue, Jul 25, 2017 at 1:53 PM, Chris Bieneman via llvm-commits <
> llvm-commits at lists.llvm.org> wrote:
>
>> Author: cbieneman
>> Date: Tue Jul 25 13:53:31 2017
>> New Revision: 309029
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=309029&view=rev
>> Log:
>> [CMake] Allow TableGen.cmake to be included multiple times
>>
>> This patch allows TableGen.cmake to be safely included multiple times in
>> sub-projects.
>>
>> Modified:
>>     llvm/trunk/cmake/modules/TableGen.cmake
>>
>> Modified: llvm/trunk/cmake/modules/TableGen.cmake
>> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/cmake/modules
>> /TableGen.cmake?rev=309029&r1=309028&r2=309029&view=diff
>> ============================================================
>> ==================
>> --- llvm/trunk/cmake/modules/TableGen.cmake (original)
>> +++ llvm/trunk/cmake/modules/TableGen.cmake Tue Jul 25 13:53:31 2017
>> @@ -110,7 +110,7 @@ function(add_public_tablegen_target targ
>>    set(LLVM_COMMON_DEPENDS ${LLVM_COMMON_DEPENDS} ${target} PARENT_SCOPE)
>>  endfunction()
>>
>> -if(LLVM_USE_HOST_TOOLS)
>> +if(LLVM_USE_HOST_TOOLS AND NOT TARGET NATIVE_LIB_LLVMTABLEGEN)
>>    llvm_ExternalProject_BuildCmd(tblgen_build_cmd LLVMSupport
>>      ${LLVM_NATIVE_BUILD}
>>      CONFIGURATION Release)
>>
>>
>> _______________________________________________
>> llvm-commits mailing list
>> llvm-commits at lists.llvm.org
>> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
>>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170725/87dd36ac/attachment.html>


More information about the llvm-commits mailing list