[wpimath] Move Drake and Eigen to thirdparty folders (#4307)

This commit is contained in:
Tyler Veness
2022-06-11 21:07:15 -07:00
committed by GitHub
parent c9e620a920
commit 9b1bf5c7f1
204 changed files with 53 additions and 25 deletions

View File

@@ -38,8 +38,7 @@ Feather Icons wpinet/src/main/native/resources/feather-*
jQuery wpinet/src/main/native/resources/jquery-*
popper.js wpinet/src/main/native/resources/popper-*
units wpimath/src/main/native/include/units/
Eigen wpimath/src/main/native/eigeninclude/
wpimath/src/main/native/include/unsupported/
Eigen wpimath/src/main/native/thirdparty/eigen/include/
StackWalker wpiutil/src/main/native/windows/StackWalker.*
TCB span wpiutil/src/main/native/include/wpi/span.h
wpiutil/src/test/native/cpp/span/
@@ -50,8 +49,9 @@ Team 254 Library wpilibj/src/main/java/edu/wpi/first/wpilibj/spline/SplineP
wpilibc/src/main/native/include/trajectory/TrajectoryParameterizer.h
wpilibc/src/main/native/cpp/trajectory/TrajectoryParameterizer.cpp
Portable File Dialogs wpigui/src/main/native/include/portable-file-dialogs.h
Drake wpimath/src/main/native/cpp/drake/common/drake_assert_and_throw.cpp
wpimath/src/main/native/cpp/drake/math/discrete_algebraic_riccati_equation.cpp
Drake wpimath/src/main/native/thirdparty/drake/
wpimath/src/test/native/cpp/drake/
wpimath/src/test/native/include/drake/
V8 export-template wpiutil/src/main/native/include/wpi/SymbolExports.h
==============================================================================

View File

@@ -21,7 +21,8 @@ def main():
# Delete old install
for d in [
"src/main/native/cpp/drake", "src/main/native/include/drake",
"src/main/native/thirdparty/drake/src",
"src/main/native/thirdparty/drake/include",
"src/test/native/cpp/drake", "src/test/native/include/drake"
]:
shutil.rmtree(os.path.join(wpimath, d), ignore_errors=True)
@@ -30,7 +31,7 @@ def main():
src_files = walk_cwd_and_copy_if(
lambda dp, f: f in
["drake_assert_and_throw.cc", "discrete_algebraic_riccati_equation.cc"],
os.path.join(wpimath, "src/main/native/cpp/drake"))
os.path.join(wpimath, "src/main/native/thirdparty/drake/src"))
# Copy drake header files into allwpilib
include_files = walk_cwd_and_copy_if(
@@ -38,7 +39,8 @@ def main():
"drake_assert.h", "drake_assertion_error.h",
"is_approx_equal_abstol.h", "never_destroyed.h", "drake_copyable.h",
"drake_throw.h", "discrete_algebraic_riccati_equation.h"
], os.path.join(wpimath, "src/main/native/include/drake"))
],
os.path.join(wpimath, "src/main/native/thirdparty/drake/include/drake"))
# Copy drake test source files into allwpilib
os.chdir(os.path.join(repo, "math/test"))
@@ -54,18 +56,20 @@ def main():
for f in src_files:
comment_out_invalid_includes(
f, [os.path.join(wpimath, "src/main/native/include")])
f,
[os.path.join(wpimath, "src/main/native/thirdparty/drake/include")])
for f in include_files:
comment_out_invalid_includes(
f, [os.path.join(wpimath, "src/main/native/include")])
f,
[os.path.join(wpimath, "src/main/native/thirdparty/drake/include")])
for f in test_src_files:
comment_out_invalid_includes(f, [
os.path.join(wpimath, "src/main/native/include"),
os.path.join(wpimath, "src/main/native/thirdparty/drake/include"),
os.path.join(wpimath, "src/test/native/include")
])
for f in test_include_files:
comment_out_invalid_includes(f, [
os.path.join(wpimath, "src/main/native/include"),
os.path.join(wpimath, "src/main/native/thirdparty/drake/include"),
os.path.join(wpimath, "src/test/native/include")
])

View File

@@ -97,26 +97,29 @@ def main():
# Delete old install
for d in [
"src/main/native/eigeninclude/Eigen",
"src/main/native/eigeninclude/unsupported"
"src/main/native/thirdparty/eigen/include/Eigen",
"src/main/native/thirdparty/eigen/include/unsupported"
]:
shutil.rmtree(os.path.join(wpimath, d), ignore_errors=True)
# Copy Eigen headers into allwpilib
eigen_files = walk_cwd_and_copy_if(
eigen_inclusions, os.path.join(wpimath, "src/main/native/eigeninclude"))
eigen_inclusions,
os.path.join(wpimath, "src/main/native/thirdparty/eigen/include"))
# Copy unsupported headers into allwpilib
unsupported_files = walk_cwd_and_copy_if(
unsupported_inclusions,
os.path.join(wpimath, "src/main/native/eigeninclude"))
os.path.join(wpimath, "src/main/native/thirdparty/eigen/include"))
for f in eigen_files:
comment_out_invalid_includes(
f, [os.path.join(wpimath, "src/main/native/eigeninclude")])
f,
[os.path.join(wpimath, "src/main/native/thirdparty/eigen/include")])
for f in unsupported_files:
comment_out_invalid_includes(
f, [os.path.join(wpimath, "src/main/native/eigeninclude")])
f,
[os.path.join(wpimath, "src/main/native/thirdparty/eigen/include")])
if __name__ == "__main__":

View File

@@ -13,12 +13,10 @@ modifiableFileExclude {
}
generatedFileExclude {
src/main/native/cpp/drake/
src/main/native/eigeninclude/
src/main/native/include/drake/
src/main/native/include/units/base\.h$
src/main/native/include/units/units\.h$
src/main/native/include/unsupported/
src/main/native/thirdparty/
src/test/native/cpp/UnitsTest\.cpp$
src/test/native/cpp/drake/
src/test/native/include/drake/

View File

@@ -89,7 +89,8 @@ if (WITH_JAVA)
endif()
file(GLOB_RECURSE wpimath_native_src src/main/native/cpp/*.cpp)
file(GLOB_RECURSE wpimath_native_src src/main/native/cpp/*.cpp
src/main/native/thirdparty/drake/src/*.cpp)
list(REMOVE_ITEM wpimath_native_src ${wpimath_jni_src})
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS FALSE)
@@ -108,9 +109,11 @@ wpilib_target_warnings(wpimath)
target_link_libraries(wpimath wpiutil)
if (NOT USE_VCPKG_EIGEN)
install(DIRECTORY src/main/native/eigeninclude/ DESTINATION "${include_dest}/wpimath")
install(DIRECTORY src/main/native/thirdparty/drake/include/ DESTINATION "${include_dest}/wpimath")
install(DIRECTORY src/main/native/thirdparty/eigen/include/ DESTINATION "${include_dest}/wpimath")
target_include_directories(wpimath SYSTEM PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/src/main/native/eigeninclude>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/src/main/native/thirdparty/drake/include>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/src/main/native/thirdparty/eigen/include>
$<INSTALL_INTERFACE:${include_dest}/wpimath>)
else()
find_package(Eigen3 CONFIG REQUIRED)

View File

@@ -9,12 +9,30 @@ ext {
nativeName = 'wpimath'
devMain = 'edu.wpi.first.math.DevMain'
splitSetup = {
it.sources {
drakeCpp(CppSourceSet) {
source {
srcDirs 'src/main/native/thirdparty/drake/src'
include '**/*.cpp'
}
exportedHeaders {
srcDirs 'src/main/native/thirdparty/drake/include',
'src/main/native/thirdparty/eigen/include'
}
}
}
}
}
apply from: "${rootDir}/shared/jni/setupBuild.gradle"
cppHeadersZip {
from('src/main/native/eigeninclude') {
from('src/main/native/thirdparty/drake/include') {
into '/'
}
from('src/main/native/thirdparty/eigen/include') {
into '/'
}
}
@@ -24,7 +42,9 @@ model {
all {
it.sources.each {
it.exportedHeaders {
srcDirs 'src/main/native/include', 'src/main/native/eigeninclude'
srcDirs 'src/main/native/include',
'src/main/native/thirdparty/drake/include',
'src/main/native/thirdparty/eigen/include'
}
}
}

Some files were not shown because too many files have changed in this diff Show More