From 81e63ea3a580162330e35bc1585eed9439c51d09 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Wed, 28 Sep 2016 20:45:03 -0700 Subject: [PATCH] Fix simulation build with latest ntcore/wpiutil. (#250) --- wpilibc/sim/CMakeLists.txt | 5 +++-- wpilibc/simulation.gradle | 10 +++++++++- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/wpilibc/sim/CMakeLists.txt b/wpilibc/sim/CMakeLists.txt index 39a7c6d165..ba140db174 100644 --- a/wpilibc/sim/CMakeLists.txt +++ b/wpilibc/sim/CMakeLists.txt @@ -9,17 +9,18 @@ set (INCLUDE_FOLDERS include ../shared/include ../../hal/include ${NTCORE_INCLUDE_DIR} + ${WPIUTIL_INCLUDE_DIR} ${GZ_MSGS_INCLUDE_DIR} ${Boost_INCLUDE_DIR} ${GAZEBO_INCLUDE_DIRS}) include_directories(${INCLUDE_FOLDERS}) -link_directories(${NTCORE_LIBDIR}) +link_directories(${NTCORE_LIBDIR} ${WPIUTIL_LIBDIR}) add_library(${PROJECT_NAME} SHARED ${SRC_FILES} ${COM_SRC_FILES}) -target_link_libraries(${PROJECT_NAME} ntcore) +target_link_libraries(${PROJECT_NAME} ntcore wpiutil) set_target_properties(${PROJECT_NAME} PROPERTIES diff --git a/wpilibc/simulation.gradle b/wpilibc/simulation.gradle index e66016404f..45d85873fa 100644 --- a/wpilibc/simulation.gradle +++ b/wpilibc/simulation.gradle @@ -16,12 +16,16 @@ task cmake(type: Exec, dependsOn: setupCmake) { commandLine '../configure.bat', "-DNTCORE_INCLUDE_DIR=$netTablesInclude", "-DNTCORE_LIBDIR=$netLibDesktopLocation", + "-DWPIUTIL_INCLUDE_DIR=$wpiUtilInclude", + "-DWPIUTIL_LIBDIR=$wpiUtilLibDesktopLocation", "-DSIMULATION_INSTALL_DIR=$simulationInstallDir" } else { commandLine 'cmake', '..', "-DNTCORE_INCLUDE_DIR=$netTablesInclude", "-DNTCORE_LIBDIR=$netLibDesktopLocation", + "-DWPIUTIL_INCLUDE_DIR=$wpiUtilInclude", + "-DWPIUTIL_LIBDIR=$wpiUtilLibDesktopLocation", "-DSIMULATION_INSTALL_DIR=$simulationInstallDir" } } @@ -50,7 +54,7 @@ task gz_msgs(type: Exec, dependsOn: cmake) { } } -task wpilibcSim(type: Exec, dependsOn: ['cmake', ':unzipNetworkTables']) { +task wpilibcSim(type: Exec, dependsOn: ['cmake', ':unzipNetworkTables', ':unzipWpiUtil']) { description = 'build WPILib C++ for simulation with cmake' group = 'WPILib Simulation' workingDir '../build' @@ -95,6 +99,10 @@ task wpilibcSimCopy(type: Copy, dependsOn: allcsim) { from ("$netLibDesktopLocation/libntcore.so") { into "lib" } + + from ("$wpiUtilLibDesktopLocation/libwpiutil.so") { + into "lib" + } } build.dependsOn allcsim