Skip to content

Commit 8d0229f

Browse files
committed
Be a bit more careful dealing with release list fetching failure
1 parent cf7d59a commit 8d0229f

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ if(SLANG_SLANG_LLVM_FLAVOR MATCHES FETCH_BINARY)
137137
# If the user didn't specify a URL, find the best one now
138138
if(NOT SLANG_SLANG_LLVM_BINARY_URL)
139139
get_best_slang_binary_release_url(url)
140-
if(NOT url)
140+
if(NOT DEFINED url)
141141
message(FATAL_ERROR "Unable to find binary release for slang-llvm, please set a different SLANG_SLANG_LLVM_FLAVOR or set SLANG_SLANG_LLVM_BINARY_URL manually")
142142
endif()
143143
endif()

cmake/GitHubRelease.cmake

+3-2
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ function(get_best_slang_binary_release_url out_var)
9494
set(repo "slang")
9595

9696
check_release_and_get_latest(${owner} ${repo} ${SLANG_VERSION_NUMERIC} ${os} ${arch} release_version)
97-
98-
set(${out_var} "https://github.com/${owner}/${repo}/releases/download/v${release_version}/slang-${release_version}-${os}-${arch}.zip" PARENT_SCOPE)
97+
if(DEFINED release_version)
98+
set(${out_var} "https://github.com/${owner}/${repo}/releases/download/v${release_version}/slang-${release_version}-${os}-${arch}.zip" PARENT_SCOPE)
99+
endif()
99100
endfunction()

0 commit comments

Comments
 (0)