rkimball opened a new pull request #6515: URL: https://github.com/apache/incubator-tvm/pull/6515
There are multiple instances where cmake variables are used as a combination boolean and/or path specifier. The code checks for a boolean by doing a string comparison with "ON" or "OFF" but cmake booleans can have many more values than these. From the cmake docs: `True if the constant is 1, ON, YES, TRUE, Y, or a non-zero number. False if the constant is 0, OFF, NO, FALSE, N, IGNORE, NOTFOUND, the empty string, or ends in the suffix -NOTFOUND. Named boolean constants are case-insensitive` I added a new cmake function `decompose_args` which decomposes a cmake variable like USE_LLVM which could be a bool or an executable file into two cmake variables, a boolean and a `command`. This makes it easier to assemble the correct conditionals to use the values and also handles all valid boolean values for true and false. It can now do things like: ``` cmake .. -DUSE_LLVM=1 cmake .. -DUSE_LLVM=llvm-config (if llvm-config is in the path) cmake .. -DUSE_LLVM=/path/to/llvm-config cmake .. -DUSE_LLVM=False ``` ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: [email protected]
