Skip to content

Commit

Permalink
Merged in utils_test7 (pull request #572)
Browse files Browse the repository at this point in the history
Build Utils_TEST with Utils.cc explicitly passed since its symbols are not visible

Approved-by: Addisu Z. Taddese <addisu@openrobotics.org>
Approved-by: Nate Koenig <natekoenig@gmail.com>
  • Loading branch information
scpeters committed Nov 6, 2019
2 parents b89f0d6 + 58794e8 commit 3e53c9f
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 1 deletion.
3 changes: 3 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

### SDFormat 7.0.0 (xxxx-xx-xx)

1. Build Utils_TEST with Utils.cc explicitly passed since its symbols are not visible.
* [Pull request 572](https://bitbucket.org/osrf/sdformat/pull-requests/572)

1. Parse urdf files to sdf 1.5 instead of 1.4 to avoid `use_parent_model_frame`.
* [Pull request 575](https://bitbucket.org/osrf/sdformat/pull-requests/575)

Expand Down
12 changes: 11 additions & 1 deletion cmake/SDFUtils.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,11 @@ macro (sdf_setup_apple)
endmacro()

#################################################
# VAR: SDF_BUILD_TESTS_EXTRA_EXE_SRCS
# Hack: extra sources to build binaries can be supplied to gz_build_tests in
# the variable SDF_BUILD_TESTS_EXTRA_EXE_SRCS. This variable will be clean up
# at the end of the function
#
include_directories(${PROJECT_SOURCE_DIR}/test/gtest/include)
macro (sdf_build_tests)
# Build all the tests
Expand All @@ -133,10 +138,13 @@ macro (sdf_build_tests)
set(BINARY_NAME ${TEST_TYPE}_${BINARY_NAME})

if (UNIX)
add_executable(${BINARY_NAME} ${GTEST_SOURCE_file})
add_executable(${BINARY_NAME}
${GTEST_SOURCE_file}
${SDF_BUILD_TESTS_EXTRA_EXE_SRCS})
elseif(WIN32)
add_executable(${BINARY_NAME}
${GTEST_SOURCE_file}
${SDF_BUILD_TESTS_EXTRA_EXE_SRCS}
${PROJECT_SOURCE_DIR}/src/win/tinyxml/tinystr.cpp
${PROJECT_SOURCE_DIR}/src/win/tinyxml/tinyxmlerror.cpp
${PROJECT_SOURCE_DIR}/src/win/tinyxml/tinyxml.cpp
Expand Down Expand Up @@ -214,6 +222,8 @@ macro (sdf_build_tests)
--error-exitcode=1 --show-leak-kinds=all ${CMAKE_CURRENT_BINARY_DIR}/${BINARY_NAME})
endif()
endforeach()

set(GZ_BUILD_TESTS_EXTRA_EXE_SRCS "")
endmacro()

#################################################
Expand Down
5 changes: 5 additions & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,11 @@ if (IGNITION-TOOLS_BINARY_DIRS)
)
endif()

if (NOT WIN32)
set(SDF_BUILD_TESTS_EXTRA_EXE_SRCS Utils.cc)
sdf_build_tests(Utils_TEST.cc)
endif()

sdf_build_tests(${gtest_sources})

sdf_add_library(${sdf_target} ${sources})
Expand Down

0 comments on commit 3e53c9f

Please sign in to comment.