[llvm] [CMake][Windows] Fix Debug config build when using MSBuild (PR #111765)
via llvm-commits
llvm-commits at lists.llvm.org
Thu Oct 17 00:36:09 PDT 2024
wjristow wrote:
One additional thought. After thinking about the explanation I wrote up yesterday, I feel like there's a cleaner way to implement the fix. Here is a diff, showing the change that I think is cleaner:
```
diff --git llvm/cmake/modules/TableGen.cmake llvm/cmake/modules/TableGen.cmake
index ffcc718b4777..f782cf112fac 100644
--- llvm/cmake/modules/TableGen.cmake
+++ llvm/cmake/modules/TableGen.cmake
@@ -190,9 +190,13 @@ macro(add_tablegen target project)
endif()
# FIXME: Quick fix to reflect LLVM_TABLEGEN to llvm-min-tblgen
+ set(RAW_LLVM_TABLEGEN ${LLVM_TABLEGEN})
+ if(NOT "${RAW_LLVM_TABLEGEN}" STREQUAL "")
+ get_filename_component(RAW_LLVM_TABLEGEN ${RAW_LLVM_TABLEGEN} NAME_WE)
+ endif()
if("${target}" STREQUAL "llvm-min-tblgen"
- AND NOT "${LLVM_TABLEGEN}" STREQUAL ""
- AND NOT "${LLVM_TABLEGEN}" STREQUAL "llvm-tblgen")
+ AND NOT "${RAW_LLVM_TABLEGEN}" STREQUAL ""
+ AND NOT "${RAW_LLVM_TABLEGEN}" STREQUAL "llvm-tblgen")
set(${project}_TABLEGEN_DEFAULT "${LLVM_TABLEGEN}")
endif()
```
I haven't updated the commit in this PR, but I'll do that tomorrow, for clarity. This updated approach, sets `RAW_LLVM_TABLEGEN` to be a "cleaned up" version of `LLVM_TABLEGEN` (removing the extension and the the full path, if any), and then uses that cleaned up version instead of `LLVM_TABLEGEN` directly.
https://github.com/llvm/llvm-project/pull/111765
More information about the llvm-commits
mailing list