[PATCH] D107898: [CMake] Fix recompile all .inc files with LLVM_OPTIMIZED_TABLEGEN in Visual Studio.

Shoaib Meenai via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 20 09:10:05 PDT 2021


smeenai added a comment.

In D107898#2956809 <https://reviews.llvm.org/D107898#2956809>, @beanz wrote:

> We should be able to unset them in the function scope, which should do the right thing.

Ah, good point.

In D107898#2957018 <https://reviews.llvm.org/D107898#2957018>, @dfukalov wrote:

> In D107898#2956403 <https://reviews.llvm.org/D107898#2956403>, @smeenai wrote:
>
>> This is breaking our cross-compilation from Linux to Windows. It doesn't seem like the CMake Linux platform files (at least on 3.20.3) define these variables explicitly (I guess they're just relying on them being implicitly empty), so we still see `.exe` as our `CMAKE_EXECUTABLE_SUFFIX`, which breaks running tblgen.
>>
>> Not sure what the best solution is for that.
>
> Can you please provide cmake config parameters (and possible toolchain description) to reproduce the issue?
>
> In D107898#2956809 <https://reviews.llvm.org/D107898#2956809>, @beanz wrote:
>
>> We should be able to unset them in the function scope, which should do the right thing.
>
> Do you mean something like
>
>   if (CMAKE_HOST_SYSTEM_NAME STREQUAL "Windows")
>      set(output_path ${output_path}${LLVM_HOST_EXECUTABLE_SUFFIX})
>   endif()
>
> in `function(build_native_tool target output_path_var)`?

Nope, just emptying out the variables before accessing them.

The config requires access to the Windows SDKs, so it's not the easiest thing to repro, but I can put up a diff to fix it (using @beanz's suggestion).


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D107898/new/

https://reviews.llvm.org/D107898



More information about the llvm-commits mailing list