[llvm] [cmake] Optimize RelWithDebInfo compiler options on windows (PR #101533)

via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 6 02:47:18 PDT 2024


GkvJwa wrote:

> Where are the flags for RelWithDebInfo currently defined? Is that done in LLVM's CMake files somewhere, or is it CMake internal?
> 
> This patch adds a bunch of flags. The ideal would be if RelWithDebInfo was equivalent to Release + flags to build the .pdb.
> 
> > In addition, cross-compilation should require additional parameters to be set
> 
> What does this mean?

cmake's internal decision, [Windows-Intel-Fortran.cmake](https://github.com/Kitware/CMake/blob/master/Modules/Platform/Windows-Intel-Fortran.cmake#L27)
The reason is that cmake does not enable any link optimization(/OPT) by default and llvm's cmake does not add additional parameters(this commit does this)

This is equal to release+pdb, based on the comparison I compiled on windows

For example, there is no adaptation to cross-compile windows on Linux(here checked if it is msvc)
https://github.com/llvm/llvm-project/blob/5c56b46a32a8856a022a54291bc9294068f7ddbd/llvm/CMakeLists.txt#L843-L845

https://github.com/llvm/llvm-project/pull/101533


More information about the llvm-commits mailing list