mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2024-11-24 22:30:13 +00:00
Make windows resource generation more robust
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. Reviewed By: stellaraccident Differential Revision: https://reviews.llvm.org/D135650
This commit is contained in:
parent
81832afc04
commit
4d25ba0165
@ -387,19 +387,35 @@ function(set_windows_version_resource_properties name resource_file)
|
||||
${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)
|
||||
|
Loading…
Reference in New Issue
Block a user