mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-19 00:41:43 +00:00
This lets us remove the unmaintained StackWalker library and its hacky upstream_utils script. @Gold856 reported that StackWalker gives blank stacktraces: https://discord.com/channels/176186766946992128/368993897495527424/1261940029287301150. They also reported an earlier version of this PR giving the following stacktrace instead: ``` D:\allwpilib\developerRobot\src\main\native\cpp\Robot.cpp(18): developerRobotCpp!Robot::RobotInit+0xB6 D:\allwpilib\wpilibc\src\main\native\cpp\TimedRobot.cpp(22): wpilibcd!frc::TimedRobot::StartCompetition+0x4F D:\allwpilib\wpilibc\src\main\native\include\frc\RobotBase.h(36): developerRobotCpp!frc::impl::RunRobot<Robot>+0xC8 D:\allwpilib\wpilibc\src\main\native\include\frc\RobotBase.h(106): developerRobotCpp!frc::StartRobot<Robot>+0x17E D:\allwpilib\developerRobot\src\main\native\cpp\Robot.cpp(60): developerRobotCpp!main+0xB D:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl(79): developerRobotCpp!invoke_main+0x39 D:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl(288): developerRobotCpp!__scrt_common_main_seh+0x132 D:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl(331): developerRobotCpp!__scrt_common_main+0xE D:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_main.cpp(17): developerRobotCpp!mainCRTStartup+0xE KERNEL32!BaseThreadInitThunk+0x1D ntdll!RtlUserThreadStart+0x28 ```
75 lines
2.3 KiB
CMake
75 lines
2.3 KiB
CMake
project(fields)
|
|
|
|
include(CompileWarnings)
|
|
include(GenResources)
|
|
|
|
if(WITH_JAVA)
|
|
include(UseJava)
|
|
|
|
file(GLOB AVAJE_JARS "${WPILIB_BINARY_DIR}/wpiutil/thirdparty/avaje/*.jar")
|
|
|
|
file(GLOB_RECURSE JAVA_SOURCES src/main/java/*.java)
|
|
file(
|
|
GLOB_RECURSE JAVA_FRC_RESOURCES
|
|
RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
|
|
src/main/native/resources/frc/*.json
|
|
src/main/native/resources/frc/*.png
|
|
src/main/native/resources/frc/*.jpg
|
|
)
|
|
|
|
file(
|
|
GLOB_RECURSE JAVA_FTC_RESOURCES
|
|
RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
|
|
src/main/native/resources/ftc/*.json
|
|
src/main/native/resources/ftc/*.png
|
|
src/main/native/resources/ftc/*.jpg
|
|
)
|
|
|
|
add_jar(
|
|
field_images_jar
|
|
SOURCES ${JAVA_SOURCES}
|
|
RESOURCES
|
|
NAMESPACE "org/wpilib/fields/frc" ${JAVA_FRC_RESOURCES}
|
|
NAMESPACE "org/wpilib/fields/ftc" ${JAVA_FTC_RESOURCES}
|
|
INCLUDE_JARS ${AVAJE_JARS}
|
|
OUTPUT_DIR ${WPILIB_BINARY_DIR}/${java_lib_dest}
|
|
OUTPUT_NAME fields
|
|
)
|
|
set_property(TARGET field_images_jar PROPERTY FOLDER "java")
|
|
install_jar(field_images_jar DESTINATION ${java_lib_dest})
|
|
install_jar_exports(TARGETS field_images_jar FILE fields_jar.cmake DESTINATION share/fields)
|
|
endif()
|
|
|
|
generate_resources(
|
|
src/main/native/resources/org/wpilib/fields/*
|
|
${CMAKE_CURRENT_BINARY_DIR}/generated/main/cpp
|
|
FIELDS
|
|
wpi::fields
|
|
field_images_resources_src
|
|
)
|
|
|
|
add_library(fields ${field_images_resources_src} src/main/native/cpp/fields.cpp)
|
|
set_target_properties(fields PROPERTIES DEBUG_POSTFIX "d")
|
|
|
|
set_property(TARGET fields PROPERTY FOLDER "libraries")
|
|
target_compile_features(fields PUBLIC cxx_std_23)
|
|
if(MSVC)
|
|
target_compile_options(fields PUBLIC /bigobj)
|
|
endif()
|
|
wpilib_target_warnings(fields)
|
|
|
|
install(DIRECTORY src/main/native/include/ DESTINATION "${include_dest}/fields")
|
|
target_include_directories(
|
|
fields
|
|
PUBLIC
|
|
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/src/main/native/include>
|
|
$<INSTALL_INTERFACE:${include_dest}/fields>
|
|
)
|
|
|
|
install(TARGETS fields EXPORT fields)
|
|
export(TARGETS fields FILE fields.cmake NAMESPACE fields::)
|
|
|
|
configure_file(fields-config.cmake.in ${WPILIB_BINARY_DIR}/fields-config.cmake)
|
|
install(FILES ${WPILIB_BINARY_DIR}/fields-config.cmake DESTINATION share/fields)
|
|
install(EXPORT fields DESTINATION share/fields)
|