I was experiencing this in an out-of-tree project when building a DLL in a context that didn't have LLVM_VERSION_* and friends set. It causes obscure errors in the resource compiler if not integers.
Details
Details
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Unit Tests
Unit Tests
Event Timeline
Comment Actions
LGTM. I find it easier to read if it's all done together (see comment), but it's fine either way.
llvm/cmake/modules/AddLLVM.cmake | ||
---|---|---|
386 | Since the issue you saw was when LLVM_VERSION* was not defined, I think it would be a bit cleaner if you made all the assignments together e.g.: if (NOT DEFINED ARG_VERSION_MAJOR) if (${LLVM_VERSION_MAJOR}) set(ARG_VERSION_MAJOR ${LLVM_VERSION_MAJOR}) else set(ARG_VERSION_MAJOR 0) endif endif It's not any less verbose, but it's a bit more explicit. |
Comment Actions
Another contributor cloned and submitted this with suggested fixes as a new patch: https://reviews.llvm.org/D135650
Closing this one.
Since the issue you saw was when LLVM_VERSION* was not defined, I think it would be a bit cleaner if you made all the assignments together e.g.:
It's not any less verbose, but it's a bit more explicit.