google-research
56 строк · 1.6 Кб
1# Description:
2# Eigen is a C++ template library for linear algebra: vectors,
3# matrices, and related algorithms.
4
5licenses([
6# Note: Eigen is an MPL2 library that includes GPL v3 and LGPL v2.1+ code.
7# We've taken special care to not reference any restricted code.
8"reciprocal", # MPL2
9"notice", # Portions BSD
10])
11
12exports_files(["COPYING.MPL2"])
13
14EIGEN_FILES = [
15"Eigen/**",
16"unsupported/Eigen/CXX11/**",
17"unsupported/Eigen/FFT",
18"unsupported/Eigen/KroneckerProduct",
19"unsupported/Eigen/src/FFT/**",
20"unsupported/Eigen/src/KroneckerProduct/**",
21"unsupported/Eigen/MatrixFunctions",
22"unsupported/Eigen/SpecialFunctions",
23"unsupported/Eigen/src/MatrixFunctions/**",
24"unsupported/Eigen/src/SpecialFunctions/**",
25]
26
27# Files known to be under MPL2 license.
28EIGEN_MPL2_HEADER_FILES = glob(
29EIGEN_FILES,
30exclude = [
31# Guarantees that any non-MPL2 file added to the list above will fail to
32# compile.
33"Eigen/src/Core/util/NonMPL2.h",
34"Eigen/**/CMakeLists.txt",
35],
36)
37
38cc_library(
39name = "eigen",
40hdrs = EIGEN_MPL2_HEADER_FILES,
41defines = [
42# This define (mostly) guarantees we don't link any problematic
43# code. We use it, but we do not rely on it, as evidenced above.
44"EIGEN_MPL2_ONLY",
45"EIGEN_MAX_ALIGN_BYTES=64",
46"EIGEN_HAS_TYPE_TRAITS=0",
47],
48includes = ["."],
49visibility = ["//visibility:public"],
50)
51
52filegroup(
53name = "eigen_header_files",
54srcs = EIGEN_MPL2_HEADER_FILES,
55visibility = ["//visibility:public"],
56)
57