|
| 1 | +load("@rules_cc//cc:cc_library.bzl", "cc_library") |
| 2 | +load("@rules_license//rules:license.bzl", "license") |
| 3 | + |
| 4 | +package( |
| 5 | + default_applicable_licenses = [ |
| 6 | + ":license.APACHE", |
| 7 | + ":license.BSD", |
| 8 | + ":license.MINPACK", # Only used by unsupported/** not by Eigen/**. |
| 9 | + ":license.MPL2", |
| 10 | + ], |
| 11 | +) |
| 12 | + |
| 13 | +exports_files(glob(["COPYING.*"])) |
| 14 | + |
| 15 | +# Note: Eigen is primarily an MPL2 library with small bits of code under other |
| 16 | +# licenses. Previous versions of Eigen contained LGPL code which needed to be |
| 17 | +# carefully excluded, but as of approximately 2023-02-07 all LGPL code has been |
| 18 | +# removed upstream so does not need any special handling here. |
| 19 | + |
| 20 | +license( |
| 21 | + name = "license.APACHE", |
| 22 | + license_kinds = ["@rules_license//licenses/spdx:Apache-2.0"], |
| 23 | + license_text = "COPYING.APACHE", |
| 24 | +) |
| 25 | + |
| 26 | +license( |
| 27 | + name = "license.BSD", |
| 28 | + license_kinds = ["@rules_license//licenses/spdx:BSD-3-Clause"], |
| 29 | + license_text = "COPYING.BSD", |
| 30 | +) |
| 31 | + |
| 32 | +license( |
| 33 | + name = "license.MINPACK", |
| 34 | + license_kinds = ["@rules_license//licenses/spdx:BSD-3-Clause-Attribution"], |
| 35 | + license_text = "COPYING.MINPACK", |
| 36 | +) |
| 37 | + |
| 38 | +license( |
| 39 | + name = "license.MPL2", |
| 40 | + license_kinds = ["@rules_license//licenses/spdx:MPL-2.0"], |
| 41 | + license_text = "COPYING.MPL2", |
| 42 | +) |
| 43 | + |
| 44 | +HDRS = glob( |
| 45 | + [ |
| 46 | + "Eigen/**", |
| 47 | + "unsupported/Eigen/**", |
| 48 | + ], |
| 49 | + exclude = [ |
| 50 | + # We don't want any documentation files. |
| 51 | + "**/*.md", |
| 52 | + "**/*.txt", |
| 53 | + ], |
| 54 | +) |
| 55 | + |
| 56 | +cc_library( |
| 57 | + name = "eigen", |
| 58 | + hdrs = HDRS, |
| 59 | + includes = ["."], |
| 60 | + visibility = ["//visibility:public"], |
| 61 | +) |
0 commit comments