Skip to content

Commit 8740a18

Browse files
Tobias-FischerDaisuke Nishimatsu
andauthored
Enable MSVC math constants for custom demo plugin (#884)
This upstreams a generalized form of RoboStack build fix patch/ros-rolling-gz-ros2-control-demos.win.patch. Best guess rationale: the custom hardware demo plugin uses C math constants that MSVC exposes only when _USE_MATH_DEFINES is defined before including math headers. Defining it for the target on MSVC keeps the demo portable without affecting other toolchains. Signed-off-by: Tobias Fischer <info@tobiasfischer.info> Co-authored-by: Daisuke Nishimatsu <nishimarudai@gmail.com>
1 parent 262f2d7 commit 8740a18

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

gz_ros2_control_demos/CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,9 @@ PUBLIC
8686
rclcpp::rclcpp
8787
rclcpp_lifecycle::rclcpp_lifecycle
8888
)
89+
if(MSVC)
90+
target_compile_definitions(gz_custom_hardware_plugins PRIVATE _USE_MATH_DEFINES)
91+
endif()
8992

9093
#########
9194

0 commit comments

Comments
 (0)