[llvm-dev] Question about the build

Michael Kruse via llvm-dev llvm-dev at lists.llvm.org
Tue Jan 5 14:10:15 PST 2021


Am Di., 5. Jan. 2021 um 05:02 Uhr schrieb James Henderson via llvm-dev
<llvm-dev at lists.llvm.org>:
> Note that c:\llvm\build\native\release\bin\llvm-tblgen.exe exists and the project build to build that executable says there is nothing to update. When investigating this last year, I found that applying a small change to CrossCompile.cmake to add ".exe" to the end of the output_path for the optimized tablegen output was sufficient to fix things, but I don't think that's a realistic long-term solution, as it's not cross-platform.

To just get the extension, one can make use of CMAKE_EXECUTABLE_SUFFIX
(https://cmake.org/cmake/help/latest/variable/CMAKE_EXECUTABLE_SUFFIX.html)
within cmake. The idiomatic solution within the same cmake build would
be to use the `$<TARGET_FILE:llvm-tblgen>` generator expression.

Additionally, tblgen-gen should check whether content of the target
file is identical before overwriting an existing file, such that its
time stamp does not change and dependent files do not need to be
rebuilt. This also seems to not always work, but I don't know whether
this is a limitation of Visual Studio/MSBuild, e.g. does not re-check
whether files in a dependency chain actually have changed. In my
experience, it is often that the mlir-tablegen dependees are rebuilt
regardless, but clang-tblgen and llvm-tblgen seem to work.

Michael


More information about the llvm-dev mailing list