Lines Matching +full:llvm +full:- +full:project
7 # Clear out any pre-existing compile_commands file before processing. This
11 function(tablegen project ofn)
14 # Override ${project} with ${project}_TABLEGEN_PROJECT
15 if(NOT "${${project}_TABLEGEN_PROJECT}" STREQUAL "")
16 set(project ${${project}_TABLEGEN_PROJECT}) variable
20 if(NOT ${project}_TABLEGEN_EXE)
21 message(FATAL_ERROR "${project}_TABLEGEN_EXE not set")
34 -o ${ofn_rel}
35 -d ${ofn_rel}.d
43 file(GLOB_RECURSE global_tds "${LLVM_MAIN_INCLUDE_DIR}/llvm/*.td")
45 -o ${CMAKE_CURRENT_BINARY_DIR}/${ofn}
55 if (LLVM_ENABLE_DAGISEL_COV AND "-gen-dag-isel" IN_LIST ARGN)
56 list(APPEND LLVM_TABLEGEN_FLAGS "-instrument-coverage")
58 if (LLVM_ENABLE_GISEL_COV AND "-gen-global-isel" IN_LIST ARGN)
59 list(APPEND LLVM_TABLEGEN_FLAGS "-instrument-gisel-coverage")
60 list(APPEND LLVM_TABLEGEN_FLAGS "-gisel-coverage-file=${LLVM_GISEL_COV_PREFIX}all")
62 if (LLVM_OMIT_DAGISEL_COMMENTS AND "-gen-dag-isel" IN_LIST ARGN)
63 list(APPEND LLVM_TABLEGEN_FLAGS "-omit-comments")
68 # char literals, instead. If we're cross-compiling, then conservatively assume
70 # [1] https://docs.microsoft.com/en-us/cpp/cpp/compiler-limits?view=vs-2017
71 if (MSVC AND project STREQUAL LLVM)
72 list(APPEND LLVM_TABLEGEN_FLAGS "--long-string-literals=0")
75 # Visual Studio has problems with llvm-tblgen's native --write-if-changed
77 # pass --write-if-changed there.
80 set(tblgen_change_flag "--write-if-changed")
84 list(APPEND LLVM_TABLEGEN_FLAGS "-no-warn-on-unused-template-args")
89 # a tablegen change, as cmake does not propagate file-level dependencies
94 # ("${${project}_TABLEGEN_TARGET}" STREQUAL "${${project}_TABLEGEN_EXE}")
114 # This file is used by the TableGen LSP Language Server (tblgen-lsp-server).
116 "--- !FileInfo:\n"
121 # Filter out empty items before prepending each entry with -I
123 list(TRANSFORM tblgen_includes PREPEND -I)
125 set(tablegen_exe ${${project}_TABLEGEN_EXE})
126 set(tablegen_depends ${${project}_TABLEGEN_TARGET} ${tablegen_exe})
135 COMMAND ${tablegen_exe} ${ARG_UNPARSED_ARGUMENTS} -I ${CMAKE_CURRENT_SOURCE_DIR}
175 macro(add_tablegen target project)
185 set(${project}_TABLEGEN_DEFAULT "${target}")
188 … set(${project}_TABLEGEN_DEFAULT "${LLVM_NATIVE_TOOL_DIR}/${target}${LLVM_HOST_EXECUTABLE_SUFFIX}")
192 # FIXME: Quick fix to reflect LLVM_TABLEGEN to llvm-min-tblgen
193 if("${target}" STREQUAL "llvm-min-tblgen"
195 AND NOT "${LLVM_TABLEGEN}" STREQUAL "llvm-tblgen")
196 set(${project}_TABLEGEN_DEFAULT "${LLVM_TABLEGEN}")
200 set(${project}_TABLEGEN "${${project}_TABLEGEN_DEFAULT}" CACHE
201 STRING "Native TableGen executable. Saves building one when cross-compiling.")
204 set(${project}_TABLEGEN "${${project}_TABLEGEN_DEFAULT}")
209 set(${project}_TABLEGEN_EXE ${${project}_TABLEGEN} PARENT_SCOPE)
210 set(${project}_TABLEGEN_TARGET ${${project}_TABLEGEN} PARENT_SCOPE)
213 if( ${${project}_TABLEGEN} STREQUAL "${target}" )
217 build_native_tool(${target} ${project}_TABLEGEN_EXE DEPENDS ${target})
218 set(${project}_TABLEGEN_EXE ${${project}_TABLEGEN_EXE} PARENT_SCOPE)
220 add_custom_target(${target}-host DEPENDS ${${project}_TABLEGEN_EXE})
222 set_target_properties(${target}-host PROPERTIES FOLDER "${subproject_title}/Native")
223 set(${project}_TABLEGEN_TARGET ${target}-host PARENT_SCOPE)
244 add_llvm_install_targets("install-${target}"