[PATCH] D62171: build: Enable CMake Policy 0077
Chris Bieneman via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon May 20 22:09:57 PDT 2019
beanz added a comment.
@hintonda also, re-running the CMake command line and setting `-D...` is always a `FORCE`
This LGTM, but I do want to clarify that your explanation is not correct.
`option(...)` doesn't remove cached values. If it did, CMake re-generation when you change a build configuration wouldn't work. In the `OLD` behavior `option` was implemented roughly as `set(${VAR} ${DEFAULT} CACHE BOOL ...)`. Which if you had a non-cached variable would override it and write it to the cache with the default value. In the `NEW` behavior if the variable is already set the default value gets replaced with the pre-set value.
The policy documentation explains all the behavior and edge cases pretty well:
https://cmake.org/cmake/help/latest/policy/CMP0077.html
Repository:
rL LLVM
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D62171/new/
https://reviews.llvm.org/D62171
More information about the llvm-commits
mailing list