Skip to content

Commit

Permalink
fix eigen incorrectly disabling unsupported (#5601)
Browse files Browse the repository at this point in the history
  • Loading branch information
xq114 authored Oct 29, 2024
1 parent 393f68b commit 7f5ad31
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions packages/e/eigen/xmake.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
package("eigen")
set_kind("library", {headeronly = true})
set_homepage("https://eigen.tuxfamily.org/")
set_description("C++ template library for linear algebra")
set_license("MPL-2.0")
Expand All @@ -11,6 +10,9 @@ package("eigen")
add_versions("3.3.8", "0215c6593c4ee9f1f7f28238c4e8995584ebf3b556e9dbf933d84feb98d5b9ef")
add_versions("3.3.9", "0fa5cafe78f66d2b501b43016858070d52ba47bd9b1016b0165a7b8e04675677")
add_versions("3.4.0", "b4c198460eba6f28d34894e3a5710998818515104d6e74e5cc331ce31e46e626")

add_configs("blas", {description = "Provide a Eigen-implemented BLAS.", default = false, type = "boolean"})
add_configs("lapack", {description = "Provide a Eigen-implemented LAPACK.", default = false, type = "boolean"})

if is_plat("mingw") and is_subhost("msys") then
add_extsources("pacman::eigen3")
Expand All @@ -23,9 +25,19 @@ package("eigen")
add_deps("cmake")
add_includedirs("include")
add_includedirs("include/eigen3")
on_load(function (package)
if not package:config("blas") and not package:config("lapack") then
package:set("kind", "library", {headeronly = true})
end
end)

on_install(function (package)
io.replace("CMakeLists.txt", "add_subdirectory", "#", {plain = true})
if not package:config("blas") then
io.replace("CMakeLists.txt", "add_subdirectory(blas", "#", {plain = true})
end
if not package:config("lapack") then
io.replace("CMakeLists.txt", "add_subdirectory(lapack", "#", {plain = true})
end
import("package.tools.cmake").install(package, {"-DBUILD_TESTING=OFF"})

if not os.isfile(package:installdir("include/eigen3/Eigen/Dense")) then
Expand Down

0 comments on commit 7f5ad31

Please sign in to comment.