Skip to content

Commit

Permalink
Use MPL2 only eigen (Fix #3979)
Browse files Browse the repository at this point in the history
  • Loading branch information
Mizux committed Nov 9, 2023
1 parent 38dff7f commit f6ec5b2
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 1 deletion.
1 change: 1 addition & 0 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ cc_library(
srcs = [],
includes = ['.'],
hdrs = glob(['Eigen/**']),
defines = ["EIGEN_MPL2_ONLY",],
visibility = ['//visibility:public'],
)
"""
Expand Down
1 change: 1 addition & 0 deletions cmake/dependencies/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ endif()
if(BUILD_Eigen3)
message(CHECK_START "Fetching Eigen3")
list(APPEND CMAKE_MESSAGE_INDENT " ")
set(EIGEN_MPL2_ONLY ON)
set(EIGEN_BUILD_PKGCONFIG OFF)
set(EIGEN_BUILD_DOC OFF)
set(EIGEN_BUILD_TESTING OFF)
Expand Down
24 changes: 23 additions & 1 deletion patches/eigen3-3.4.0.patch
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index f3e69b845..1aa7a944e 100644
index f3e69b845..919f43bb2 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,6 +1,11 @@
Expand All @@ -14,3 +14,25 @@ index f3e69b845..1aa7a944e 100644
project(Eigen3)

# guard against in-source builds
@@ -21,6 +26,7 @@ if (NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE "Release")
endif()

+option(EIGEN_MPL2_ONLY "Only use MPL2 or more permissive license." OFF)

#############################################################################
# retrieve version information #
@@ -592,7 +598,12 @@ set ( EIGEN_VERSION_STRING ${EIGEN_VERSION_NUMBER} )
set ( EIGEN_VERSION_MAJOR ${EIGEN_WORLD_VERSION} )
set ( EIGEN_VERSION_MINOR ${EIGEN_MAJOR_VERSION} )
set ( EIGEN_VERSION_PATCH ${EIGEN_MINOR_VERSION} )
-set ( EIGEN_DEFINITIONS "")
+
+if(EIGEN_MPL2_ONLY)
+ set ( EIGEN_DEFINITIONS EIGEN_MPL2_ONLY)
+else()
+ set ( EIGEN_DEFINITIONS "")
+endif()
set ( EIGEN_INCLUDE_DIR "${CMAKE_INSTALL_PREFIX}/${INCLUDE_INSTALL_DIR}" )
set ( EIGEN_ROOT_DIR ${CMAKE_INSTALL_PREFIX} )

0 comments on commit f6ec5b2

Please sign in to comment.