From 0ae0ea567b2d047f09fd90e8ce427799764564a2 Mon Sep 17 00:00:00 2001 From: Cocoa Date: Wed, 22 Nov 2023 00:10:06 +0800 Subject: [PATCH] v0.1.3 --- mix.exs | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/mix.exs b/mix.exs index d0e8266..3732c5d 100644 --- a/mix.exs +++ b/mix.exs @@ -1,7 +1,7 @@ defmodule HNSWLib.MixProject do use Mix.Project - @version "0.1.2" + @version "0.1.3" @github_url "https://github.com/elixir-nx/hnswlib" def project do @@ -20,9 +20,7 @@ defmodule HNSWLib.MixProject do make_precompiler_url: "#{@github_url}/releases/download/v#{@version}/@{artefact_filename}", make_precompiler_filename: "hnswlib_nif", make_precompiler_nif_versions: [versions: ["2.16", "2.17"]], - cc_precompiler: [ - cleanup: "cleanup" - ] + cc_precompiler: cc_precompiler() ] end @@ -53,6 +51,20 @@ defmodule HNSWLib.MixProject do ] end + defp cc_precompiler do + extra_options = + if System.get_env("HNSWLIB_CI_PRECOMPILE") == "true" do + [ + only_listed_targets: true, + exclude_current_target: true + ] + else + [] + end + + [cleanup: "cleanup"] ++ extra_options + end + defp package() do [ files: