Page MenuHomePhabricator

CMake: Turn LLVM_ENABLE_LIBXML2 into a tri-state option

Authored by hans on Nov 14 2017, 2:21 PM.



In addition to the current ON and OFF options, this adds the FORCE_ON
option, which causes a configuration error if libxml2 cannot be used.

Diff Detail


Event Timeline

hans created this revision.Nov 14 2017, 2:21 PM
hans added a comment.Nov 14 2017, 2:23 PM

I tested locally that if there's a current LLVM_ENABLE_LIBXML2:BOOL in CMakeCache.txt, that doesn't break things. There is no warning or error, it just seems to ignore the new string option and use the cached bool one.

So I guess this means it won't disrupt current builds, and builds that want to use FORCE_ON need to nuke their cache and reconfigure, which is expected.

rnk accepted this revision.Nov 14 2017, 2:25 PM


163 ↗(On Diff #122913)

I guess the string value OFF evaluates to false in this context? Scary loose typing, batman!

This revision is now accepted and ready to land.Nov 14 2017, 2:25 PM
hans added inline comments.Nov 14 2017, 2:32 PM
163 ↗(On Diff #122913)

Yup, also "0, OFF, NO, FALSE, N, IGNORE, NOTFOUND, the empty string, or ends in the suffix -NOTFOUND" :-)

This revision was automatically updated to reflect the committed changes.