[PATCH] D62063: CMake changes to get Windows self-host with PGO working

Chris Bieneman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon May 20 21:49:28 PDT 2019


beanz added a comment.

The CMake goop all looks reasonable to me. I think the new "correct" way to alter the compiler flags is `add_compile_options`, but since LLVM pretty heavily relies on modifying `CMAKE_<LANG>_FLAGS` it is probably better to be consistent than to start doing something new here.

It might be worth someday migrating to `add_compile_options`, but frankly doing that is kinda messy because you need to use lots of generator expressions to get it right. For example an an equivalent call to `add_compile_options` for one of the append calls in this patch would be something like:

  add_compile_options($<$<OR:$<COMPILE_LANGUAGE:CXX>,$<COMPILE_LANGUAGE:C>>:"-fprofile-instr-generate=\"${LLVM_PROFILE_FILE_PATTERN}\"">)

Someday we will need to do a big round of CMake modernization, but let's not start that here.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D62063





More information about the llvm-commits mailing list