Skip to content

Commit

Permalink
Revert "Fetch slang-llvm.so from correct release (shader-slang#4847)" (
Browse files Browse the repository at this point in the history
…shader-slang#4893)

This reverts commit 579d59c.
  • Loading branch information
csyonghe authored Aug 21, 2024
1 parent 359e96c commit e97e7e5
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 117 deletions.
26 changes: 12 additions & 14 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ include(Glob)
include(LLVM)
include(SlangTarget)
include(AutoOption)
include(GitHubRelease)

#
# Options
Expand Down Expand Up @@ -126,26 +125,25 @@ enum_option(
"How to get or build slang-llvm:"
# Options
FETCH_BINARY
"Use a binary distribution of the slang-llvm library instead of building or using LLVM (default)"
"Use a binary distribution of the slang-llvm library instead of building or using LLVM (default for Windows)"
USE_SYSTEM_LLVM
"Build slang-llvm using system-provided LLVM and Clang binaries"
"Build slang-llvm using system-provided LLVM and Clang binaries (default for non-Windows hosts)"
DISABLE
"Do not build llvm or fetch slang-llvm"
)

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)
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()
macro(slang_llvm_binary_url_option version filename)
set(SLANG_SLANG_LLVM_BINARY_URL
${url}
"https://github.com/shader-slang/slang-llvm/releases/download/${version}/${filename}"
CACHE STRING
"URL specifying the location of the slang-llvm prebuilt library"
)
endmacro()
if(CMAKE_SYSTEM_NAME MATCHES "Windows")
slang_llvm_binary_url_option("v13.x-43" "slang-llvm-13.x-43-win64.zip")
elseif(CMAKE_SYSTEM_NAME MATCHES "Darwin")
slang_llvm_binary_url_option("v13.x-43" "slang-llvm-v13.x-43-macosx-x86_64-release.zip")
else()
slang_llvm_binary_url_option("v13.x-43" "slang-llvm-v13.x-43-linux-x86_64-release.zip")
endif()

#
Expand Down Expand Up @@ -394,7 +392,7 @@ if(SLANG_SLANG_LLVM_FLAVOR STREQUAL "FETCH_BINARY")
endif()

set(slang_llvm_dest_object
${CMAKE_BINARY_DIR}/$<CONFIG>/${module_subdir}/${slang_llvm_filename}
${CMAKE_BINARY_DIR}/$<CONFIG>/${runtime_subdir}/${slang_llvm_filename}
)
add_custom_command(
OUTPUT ${slang_llvm_dest_object}
Expand Down
99 changes: 0 additions & 99 deletions cmake/GitHubRelease.cmake

This file was deleted.

4 changes: 0 additions & 4 deletions docs/building.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,10 +101,6 @@ There are several options for getting llvm-support:
- You can set `SLANG_SLANG_LLVM_BINARY_URL` to point to a local
`libslang-llvm.so/slang-llvm.dll` or set it to a URL of an zip/archive
containing such a file
- If this isn't set then the build system tries to download it from the
release on github matching the current tag. If such a tag doesn't exist
or doesn't have the correct os*arch combination then the latest release
will be tried.
- Use a system supplied LLVM: `-DSLANG_SLANG_LLVM_FLAVOR=USE_SYSTEM_LLVM`, you
must have llvm-13.0 and a matching libclang installed. It's important that
either:
Expand Down

0 comments on commit e97e7e5

Please sign in to comment.