Skip to content

Commit

Permalink
Be a bit more careful dealing with release list fetching failure
Browse files Browse the repository at this point in the history
  • Loading branch information
expipiplus1 committed Aug 21, 2024
1 parent cf7d59a commit 8d0229f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ if(SLANG_SLANG_LLVM_FLAVOR MATCHES FETCH_BINARY)
# If the user didn't specify a URL, find the best one now
if(NOT SLANG_SLANG_LLVM_BINARY_URL)
get_best_slang_binary_release_url(url)
if(NOT url)
if(NOT DEFINED url)
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")
endif()
endif()
Expand Down
5 changes: 3 additions & 2 deletions cmake/GitHubRelease.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ function(get_best_slang_binary_release_url out_var)
set(repo "slang")

check_release_and_get_latest(${owner} ${repo} ${SLANG_VERSION_NUMERIC} ${os} ${arch} release_version)

set(${out_var} "https://github.com/${owner}/${repo}/releases/download/v${release_version}/slang-${release_version}-${os}-${arch}.zip" PARENT_SCOPE)
if(DEFINED release_version)
set(${out_var} "https://github.com/${owner}/${repo}/releases/download/v${release_version}/slang-${release_version}-${os}-${arch}.zip" PARENT_SCOPE)
endif()
endfunction()

0 comments on commit 8d0229f

Please sign in to comment.