[PATCH] D135650: Make windows resource generation more robust
Anush Elangovan via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Oct 11 01:22:02 PDT 2022
powderluv created this revision.
powderluv added reviewers: stella.stamenova, stellaraccident.
Herald added a project: All.
powderluv requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.
This is another attempt at https://reviews.llvm.org/D110489.
When build IREE we run into cases where we don't have / need
LLVM_VERSION_* etc set. Compilation fails if it isn't an integer.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D135650
Files:
llvm/cmake/modules/AddLLVM.cmake
Index: llvm/cmake/modules/AddLLVM.cmake
===================================================================
--- llvm/cmake/modules/AddLLVM.cmake
+++ llvm/cmake/modules/AddLLVM.cmake
@@ -387,19 +387,35 @@
${ARGN})
if (NOT DEFINED ARG_VERSION_MAJOR)
- set(ARG_VERSION_MAJOR ${LLVM_VERSION_MAJOR})
+ if (${LLVM_VERSION_MAJOR})
+ set(ARG_VERSION_MAJOR ${LLVM_VERSION_MAJOR})
+ else()
+ set(ARG_VERSION_MAJOR 0)
+ endif()
endif()
if (NOT DEFINED ARG_VERSION_MINOR)
- set(ARG_VERSION_MINOR ${LLVM_VERSION_MINOR})
+ if (${LLVM_VERSION_MINOR})
+ set(ARG_VERSION_MINOR ${LLVM_VERSION_MINOR})
+ else()
+ set(ARG_VERSION_MINOR 0)
+ endif()
endif()
if (NOT DEFINED ARG_VERSION_PATCHLEVEL)
- set(ARG_VERSION_PATCHLEVEL ${LLVM_VERSION_PATCH})
+ if (${LLVM_VERSION_PATCH})
+ set(ARG_VERSION_PATCHLEVEL ${LLVM_VERSION_PATCH})
+ else()
+ set(ARG_VERSION_PATCHLEVEL 0)
+ endif()
endif()
if (NOT DEFINED ARG_VERSION_STRING)
- set(ARG_VERSION_STRING ${PACKAGE_VERSION})
+ if (${PACKAGE_VERSION})
+ set(ARG_VERSION_STRING ${PACKAGE_VERSION})
+ else()
+ set(ARG_VERSION_STRING 0)
+ endif()
endif()
if (NOT DEFINED ARG_PRODUCT_NAME)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D135650.466726.patch
Type: text/x-patch
Size: 1240 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20221011/ab3f716b/attachment.bin>
More information about the llvm-commits
mailing list