Skip to content
Closed
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
9 changes: 9 additions & 0 deletions Formula/llvm.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ class Llvm < Formula
sha256 "9ed1688943a4402d7c904cc4515798cdb20080066efa010fe7e1f2551b423628"
# The LLVM Project is under the Apache License v2.0 with LLVM Exceptions
license "Apache-2.0" => { with: "LLVM-exception" }
revision 1
head "https://github.com/llvm/llvm-project.git", branch: "main"

livecheck do
Expand Down Expand Up @@ -141,6 +142,11 @@ def install
system "cmake", "--build", ".", "--target", "install-xcode-toolchain" if MacOS::Xcode.installed?
end

on_macos do
# Install versioned symlink, or else `llvm-config` doesn't work properly
lib.install_symlink "libLLVM.dylib" => "libLLVM-#{version.major}.dylib" unless build.head?
end

# Install LLVM Python bindings
# Clang Python bindings are installed by CMake
(lib/site_packages).install llvmpath/"bindings/python/llvm"
Expand All @@ -158,6 +164,9 @@ def caveats

test do
assert_equal prefix.to_s, shell_output("#{bin}/llvm-config --prefix").chomp
assert_equal "-lLLVM-#{version.major}", shell_output("#{bin}/llvm-config --libs").chomp
assert_equal (lib/shared_library("libLLVM-#{version.major}")).to_s,
shell_output("#{bin}/llvm-config --libfiles").chomp

(testpath/"omptest.c").write <<~EOS
#include <stdlib.h>
Expand Down