Skip to content

Commit 9666fa7

Browse files
committed
[CMake][Windows] Fix Debug config build when using MSBuild
Commit 95d4506 caused a failure in a debug-build with MSBuild. That commit conditionally makes an assignment to a cmake variable, but suppresses the assignment when LLVM_TABLEGEN is precicely "llvm-tblgen". This commit updates that change, so that the assignment is suppressed when LLVM_TABLEGEN logically is "llvm-tblgen" (i.e., it also suppresses it for "llvm-tblgen.exe", or for a full pathname that ends with llvm-tblgen" or "llvm-tblgen.exe").
1 parent 1bb52e9 commit 9666fa7

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

llvm/cmake/modules/TableGen.cmake

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -191,9 +191,13 @@ macro(add_tablegen target project)
191191

192192
# FIXME: Quick fix to reflect LLVM_TABLEGEN to llvm-min-tblgen
193193
if("${target}" STREQUAL "llvm-min-tblgen"
194-
AND NOT "${LLVM_TABLEGEN}" STREQUAL ""
195-
AND NOT "${LLVM_TABLEGEN}" STREQUAL "llvm-tblgen")
196-
set(${project}_TABLEGEN_DEFAULT "${LLVM_TABLEGEN}")
194+
AND NOT "${LLVM_TABLEGEN}" STREQUAL "")
195+
# Extract base filename from full path.
196+
get_filename_component(RAW_LLVM_TABLEGEN ${LLVM_TABLEGEN} NAME_WE)
197+
if(NOT "${RAW_LLVM_TABLEGEN}" STREQUAL ""
198+
AND NOT "${RAW_LLVM_TABLEGEN}" STREQUAL "llvm-tblgen")
199+
set(${project}_TABLEGEN_DEFAULT "${LLVM_TABLEGEN}")
200+
endif()
197201
endif()
198202

199203
if(ADD_TABLEGEN_EXPORT)

0 commit comments

Comments
 (0)