[llvm] r288770 - [CMake] Cleanup TableGen include flags
Chris Bieneman via llvm-commits
llvm-commits at lists.llvm.org
Tue Dec 6 09:16:36 PST 2016
Yes, that's my fault. I'll get a fix in shortly!
-Chris
> On Dec 6, 2016, at 9:15 AM, NAKAMURA Takumi <geek4civic at gmail.com> wrote:
>
> I am afraid if it broke clang standalone build. Investigating.
> See also; http://bb.pgr.jp/builders/msbuild-llvmclang-x64-msc19-DA/builds/1565 <http://bb.pgr.jp/builders/msbuild-llvmclang-x64-msc19-DA/builds/1565>
> On Tue, Dec 6, 2016 at 1:55 PM Chris Bieneman via llvm-commits <llvm-commits at lists.llvm.org <mailto:llvm-commits at lists.llvm.org>> wrote:
> Author: cbieneman
> Date: Mon Dec 5 22:45:11 2016
> New Revision: 288770
>
> URL: http://llvm.org/viewvc/llvm-project?rev=288770&view=rev <http://llvm.org/viewvc/llvm-project?rev=288770&view=rev>
> Log:
> [CMake] Cleanup TableGen include flags
>
> It is kinda crazy to have llvm/include and llvm/lib/Target in the include path for every tablegen invocation for every tablegen-like tool.
>
> This patch removes those flags from the tablgen function that is called everywhere by instead creating a variable LLVM_TABLEGEN_FLAGS which is setup in the LLVM source directories.
>
> This removes TableGen.cmake's dependency on LLVM_MAIN_SRC_DIR, and LLVM_MAIN_INCLUDE_DIR.
>
> Modified:
> llvm/trunk/CMakeLists.txt
> llvm/trunk/cmake/modules/TableGen.cmake
> llvm/trunk/lib/Target/CMakeLists.txt
>
> Modified: llvm/trunk/CMakeLists.txt
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/CMakeLists.txt?rev=288770&r1=288769&r2=288770&view=diff <http://llvm.org/viewvc/llvm-project/llvm/trunk/CMakeLists.txt?rev=288770&r1=288769&r2=288770&view=diff>
> ==============================================================================
> --- llvm/trunk/CMakeLists.txt (original)
> +++ llvm/trunk/CMakeLists.txt Mon Dec 5 22:45:11 2016
> @@ -803,6 +803,8 @@ endif()
> include(AddLLVM)
> include(TableGen)
>
> +set(LLVM_TABLEGEN_FLAGS -I ${LLVM_MAIN_INCLUDE_DIR})
> +
> if( MINGW )
> # People report that -O3 is unreliable on MinGW. The traditional
> # build also uses -O2 for that reason:
>
> Modified: llvm/trunk/cmake/modules/TableGen.cmake
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/cmake/modules/TableGen.cmake?rev=288770&r1=288769&r2=288770&view=diff <http://llvm.org/viewvc/llvm-project/llvm/trunk/cmake/modules/TableGen.cmake?rev=288770&r1=288769&r2=288770&view=diff>
> ==============================================================================
> --- llvm/trunk/cmake/modules/TableGen.cmake (original)
> +++ llvm/trunk/cmake/modules/TableGen.cmake Mon Dec 5 22:45:11 2016
> @@ -6,15 +6,9 @@ include(LLVMExternalProjectUtils)
>
> function(tablegen project ofn)
> # Validate calling context.
> - foreach(v
> - ${project}_TABLEGEN_EXE
> - LLVM_MAIN_SRC_DIR
> - LLVM_MAIN_INCLUDE_DIR
> - )
> - if(NOT ${v})
> - message(FATAL_ERROR "${v} not set")
> - endif()
> - endforeach()
> + if(NOT ${project}_TABLEGEN_EXE)
> + message(FATAL_ERROR "${project}_TABLEGEN_EXE not set")
> + endif()
>
> file(GLOB local_tds "*.td")
> file(GLOB_RECURSE global_tds "${LLVM_MAIN_INCLUDE_DIR}/llvm/*.td")
> @@ -28,7 +22,7 @@ function(tablegen project ofn)
> add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${ofn}.tmp
> # Generate tablegen output in a temporary file.
> COMMAND ${${project}_TABLEGEN_EXE} ${ARGN} -I ${CMAKE_CURRENT_SOURCE_DIR}
> - -I ${LLVM_MAIN_SRC_DIR}/lib/Target -I ${LLVM_MAIN_INCLUDE_DIR}
> + ${LLVM_TABLEGEN_FLAGS}
> ${LLVM_TARGET_DEFINITIONS_ABSOLUTE}
> -o ${CMAKE_CURRENT_BINARY_DIR}/${ofn}.tmp
> # The file in LLVM_TARGET_DEFINITIONS may be not in the current
>
> Modified: llvm/trunk/lib/Target/CMakeLists.txt
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/CMakeLists.txt?rev=288770&r1=288769&r2=288770&view=diff <http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/CMakeLists.txt?rev=288770&r1=288769&r2=288770&view=diff>
> ==============================================================================
> --- llvm/trunk/lib/Target/CMakeLists.txt (original)
> +++ llvm/trunk/lib/Target/CMakeLists.txt Mon Dec 5 22:45:11 2016
> @@ -1,5 +1,7 @@
> list(APPEND LLVM_COMMON_DEPENDS intrinsics_gen)
>
> +list(APPEND LLVM_TABLEGEN_FLAGS -I ${LLVM_MAIN_SRC_DIR}/lib/Target)
> +
> add_llvm_library(LLVMTarget
> Target.cpp
> TargetIntrinsicInfo.cpp
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at lists.llvm.org <mailto:llvm-commits at lists.llvm.org>
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits <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/20161206/34b1f392/attachment.html>
More information about the llvm-commits
mailing list