Merge branch '41-windows-build-warnings' into 'master'

Resolve "Windows build warnings"

Closes #41

See merge request micro-ROS/ros_tracing/ros2_tracing!78
This commit is contained in:
Ingo Lütkebohle 2019-08-02 14:16:10 +00:00
commit f2bfd5cf1e
2 changed files with 17 additions and 10 deletions

View file

@ -33,7 +33,7 @@
#define TRACETOOLS_EXPORT __declspec(dllexport)
#define TRACETOOLS_IMPORT __declspec(dllimport)
#endif
#ifdef TRACETOOLS_BUILDING_LIBRARY
#ifdef TRACETOOLS_BUILDING_DLL
#define TRACETOOLS_PUBLIC TRACETOOLS_EXPORT
#else
#define TRACETOOLS_PUBLIC TRACETOOLS_IMPORT

View file

@ -31,6 +31,13 @@ if(BUILD_TESTING)
find_package(std_srvs REQUIRED)
find_package(tracetools REQUIRED)
# Avoid using -rdynamic on Windows
if(NOT WIN32)
set(RDYNAMIC_FLAG "-rdynamic")
else()
set(RDYNAMIC_FLAG "")
endif()
add_executable(test_publisher
src/test_publisher.cpp
)
@ -39,7 +46,7 @@ if(BUILD_TESTING)
std_msgs
tracetools
)
target_link_libraries(test_publisher -rdynamic)
target_link_libraries(test_publisher "${RDYNAMIC_FLAG}")
add_executable(test_subscription
src/test_subscription.cpp
)
@ -48,7 +55,7 @@ if(BUILD_TESTING)
std_msgs
tracetools
)
target_link_libraries(test_subscription -rdynamic)
target_link_libraries(test_subscription "${RDYNAMIC_FLAG}")
add_executable(test_intra
src/test_intra.cpp
)
@ -57,7 +64,7 @@ if(BUILD_TESTING)
std_msgs
tracetools
)
target_link_libraries(test_intra -rdynamic)
target_link_libraries(test_intra "${RDYNAMIC_FLAG}")
add_executable(test_ping
src/test_ping.cpp
)
@ -66,7 +73,7 @@ if(BUILD_TESTING)
std_msgs
tracetools
)
target_link_libraries(test_ping -rdynamic)
target_link_libraries(test_ping "${RDYNAMIC_FLAG}")
add_executable(test_pong
src/test_pong.cpp
)
@ -75,7 +82,7 @@ if(BUILD_TESTING)
std_msgs
tracetools
)
target_link_libraries(test_pong -rdynamic)
target_link_libraries(test_pong "${RDYNAMIC_FLAG}")
add_executable(test_timer
src/test_timer.cpp
)
@ -83,7 +90,7 @@ if(BUILD_TESTING)
rclcpp
tracetools
)
target_link_libraries(test_timer -rdynamic)
target_link_libraries(test_timer "${RDYNAMIC_FLAG}")
add_executable(test_service
src/test_service.cpp
)
@ -92,7 +99,7 @@ if(BUILD_TESTING)
std_srvs
tracetools
)
target_link_libraries(test_service -rdynamic)
target_link_libraries(test_service "${RDYNAMIC_FLAG}")
add_executable(test_service_ping
src/test_service_ping.cpp
)
@ -101,7 +108,7 @@ if(BUILD_TESTING)
std_srvs
tracetools
)
target_link_libraries(test_service_ping -rdynamic)
target_link_libraries(test_service_ping "${RDYNAMIC_FLAG}")
add_executable(test_service_pong
src/test_service_pong.cpp
)
@ -110,7 +117,7 @@ if(BUILD_TESTING)
std_srvs
tracetools
)
target_link_libraries(test_service_pong -rdynamic)
target_link_libraries(test_service_pong "${RDYNAMIC_FLAG}")
install(TARGETS
test_intra