Skip to content

[mlir][cmake] Fix missing entries in tablegen_compile_commands.yml #147516

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions llvm/cmake/modules/TableGen.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,6 @@
# Adds the name of the generated file to TABLEGEN_OUTPUT.
include(LLVMDistributionSupport)

# Clear out any pre-existing compile_commands file before processing. This
# allows for generating a clean compile_commands on each configure.
file(REMOVE ${CMAKE_BINARY_DIR}/tablegen_compile_commands.yml)

function(tablegen project ofn)
cmake_parse_arguments(ARG "" "" "DEPENDS;EXTRA_INCLUDES" ${ARGN})

Expand Down Expand Up @@ -250,3 +246,11 @@ macro(add_tablegen target project)
set_property(GLOBAL APPEND PROPERTY ${export_upper}_EXPORTS ${target})
endif()
endmacro()

# Make sure 'tablegen_compile_commands.yml' is only deleted once the very
# first time this file is included.
include_guard(GLOBAL)

# Clear out any pre-existing compile_commands file before processing. This
# allows for generating a clean compile_commands on each configure.
file(REMOVE ${CMAKE_BINARY_DIR}/tablegen_compile_commands.yml)
1 change: 1 addition & 0 deletions mlir/cmake/modules/AddMLIR.cmake
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
include(TableGen)
include(GNUInstallDirs)
include(LLVMDistributionSupport)

Expand Down
Loading