diff options
| author | Ellie Hermaszewska <ellieh@nvidia.com> | 2024-10-19 07:05:53 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-10-18 16:05:53 -0700 |
| commit | b2386f36ee3ac253457e9e532b0373a5ce1ee687 (patch) | |
| tree | d18b9fc3a7749ee7a4f2298cecc37839a362cb6a /cmake/GitVersion.cmake | |
| parent | f2b2db57cb7b1e8da8abc74bcf1068b52d756d00 (diff) | |
Make slang-llvm fetching and failure more robust (#5346)
* Make slang-llvm fetching and failure more robust
Improve error reporting when things go wrong.
Fall back by default to a non-llvm build
Closes https://github.com/shader-slang/slang/issues/5247
Tested sensible behavior with:
- `FETCH_BINARY_IF_POSSIBLE`, valid tag
- No errors or warnings, successful build with llvm
- `FETCH_BINARY_IF_POSSIBLE`, no valid tag
- Warning message, successful llvm build with slang-llvm from latest release
- `FETCH_BINARY_IF_POSSIBLE`, no valid tag, bad `SLANG_SLANG_LLVM_BINARY_URL` specified
- Warning message, successful no-llvm build
- `FETCH_BINARY_IF_POSSIBLE`, no valid tag, unable to fetch release information
- Warning message, successful no-llvm build
- `FETCH_BINARY`, valid tag
- No errors or warnings, successful build with llvm
- `FETCH_BINARY`, no valid tag
- Warning message, successful llvm build with slang-llvm from latest release
- `FETCH_BINARY`, no valid tag, bad `SLANG_SLANG_LLVM_BINARY_URL` specified
- Error, explaining that we couldn't fetch it
- `FETCH_BINARY`, no valid tag, unable to fetch release info
- Error, explaining that we couldn't fetch it
* Allow downloading from a local file
---------
Co-authored-by: Yong He <yonghe@outlook.com>
Diffstat (limited to 'cmake/GitVersion.cmake')
| -rw-r--r-- | cmake/GitVersion.cmake | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/cmake/GitVersion.cmake b/cmake/GitVersion.cmake index 386ca309c..c8eb32947 100644 --- a/cmake/GitVersion.cmake +++ b/cmake/GitVersion.cmake @@ -24,7 +24,7 @@ function(get_git_version var_numeric var dir) if(NOT result EQUAL 0) message( WARNING - "Getting ${var} failed: ${command} returned ${result}" + "Getting ${var} failed: ${command} returned ${result}\nIs this a Git repo with tags?\nConsider settings -D${var} to specify a version manually" ) elseif("${version_out}" MATCHES "^v(([0-9]+(\\.[0-9]+)*).*)") set(version "${CMAKE_MATCH_1}") @@ -32,13 +32,13 @@ function(get_git_version var_numeric var dir) else() message( WARNING - "Couldn't parse version (like v1.2.3 or v1.2.3-foo) from ${version_out}" + "Couldn't parse version (like v1.2.3 or v1.2.3-foo) from ${version_out}, using ${version} for now" ) endif() else() message( WARNING - "Couldn't find git executable to get ${var}, please use -D${var}" + "Couldn't find git executable to get ${var}, please use -D${var}, using ${version} for now" ) endif() endif() |
