Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resolve "Error finding an LLVM build" (#1831) #1832

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion build/LLVM.lua
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ local LLVMRootDirRelease = ""

require "llvm/LLVM"

newoption {
trigger = "vs",
description = "Override Visual Studio version with particular version"
}

function SearchLLVM()
LLVMRootDirDebug = builddir .. "/llvm/" .. get_llvm_package_name(nil, "Debug")
LLVMRootDirRelease = builddir .. "/llvm/" .. get_llvm_package_name()
Expand All @@ -20,7 +25,7 @@ function SearchLLVM()
elseif os.isdir(LLVMRootDir) then
print("Using LLVM build: " .. LLVMRootDir)
else
error("Error finding an LLVM build")
error("Error finding an LLVM build. Tried: " .. LLVMRootDirDebug .. " and " .. LLVMRootDirRelease)
end
end

Expand Down
8 changes: 4 additions & 4 deletions build/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -129,22 +129,22 @@ download_premake()

download_llvm()
{
"$builddir/premake.sh" --file="$builddir/llvm/LLVM.lua" download_llvm --os=$os --arch=$platform --configuration=$configuration
"$builddir/premake.sh" --file="$builddir/llvm/LLVM.lua" download_llvm --vs=$vs --os=$os --arch=$platform --configuration=$configuration
}

clone_llvm()
{
"$builddir/premake.sh" --file="$builddir/llvm/LLVM.lua" clone_llvm --os=$os --arch=$platform --configuration=$configuration
"$builddir/premake.sh" --file="$builddir/llvm/LLVM.lua" clone_llvm --vs=$vs --os=$os --arch=$platform --configuration=$configuration
}

build_llvm()
{
"$builddir/premake.sh" --file="$builddir/llvm/LLVM.lua" build_llvm --os=$os --arch=$platform --configuration=$configuration
"$builddir/premake.sh" --file="$builddir/llvm/LLVM.lua" build_llvm --vs=$vs --os=$os --arch=$platform --configuration=$configuration
}

package_llvm()
{
"$builddir/premake.sh" --file="$builddir/llvm/LLVM.lua" package_llvm --os=$os --arch=$platform --configuration=$configuration
"$builddir/premake.sh" --file="$builddir/llvm/LLVM.lua" package_llvm --vs=$vs --os=$os --arch=$platform --configuration=$configuration
}

detect_os()
Expand Down
4 changes: 4 additions & 0 deletions build/llvm/LLVM.lua
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@ function clone_llvm()
end

function get_vs_version()
if _OPTIONS["vs"] then
return _OPTIONS["vs"]
end

local function map_msvc_to_vs_version(major, minor)
if major == "19" and minor >= "30" then return "vs2022"
elseif major == "19" and minor >= "20" then return "vs2019"
Expand Down
Loading