From 5f457241187ba9734e952567e56ed37af971a562 Mon Sep 17 00:00:00 2001 From: Steve Peters Date: Tue, 24 Sep 2019 19:22:51 -0700 Subject: [PATCH 1/5] Build Utils_TEST with Utils.cc explicitly passed since its symbols are not visible --- cmake/SDFUtils.cmake | 12 +++++++++++- src/CMakeLists.txt | 3 +++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/cmake/SDFUtils.cmake b/cmake/SDFUtils.cmake index aa998aac0..8027512ce 100644 --- a/cmake/SDFUtils.cmake +++ b/cmake/SDFUtils.cmake @@ -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 @@ -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 @@ -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() ################################################# diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 54c724e6f..fc8b6cac4 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -118,6 +118,9 @@ if (IGNITION-TOOLS_BINARY_DIRS) ) endif() +set(SDF_BUILD_TESTS_EXTRA_EXE_SRCS Utils.cc) +sdf_build_tests(Utils_TEST.cc) + sdf_build_tests(${gtest_sources}) sdf_add_library(${sdf_target} ${sources}) From 95917c23bea6b181c7c96b9a2e65203a23d1c46e Mon Sep 17 00:00:00 2001 From: Steve Peters Date: Tue, 24 Sep 2019 19:28:57 -0700 Subject: [PATCH 2/5] changelog --- Changelog.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Changelog.md b/Changelog.md index b64d6f6eb..cbfc16988 100644 --- a/Changelog.md +++ b/Changelog.md @@ -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. Set camera intrinsics axis skew (s) default value to 0 * [Pull request 504](https://bitbucket.org/osrf/sdformat/pull-requests/504) From 9aa2dcbd055752fbacf8f0dc142f7f4852094f2c Mon Sep 17 00:00:00 2001 From: Steve Peters Date: Wed, 25 Sep 2019 15:22:36 +0000 Subject: [PATCH 3/5] try windows fix --- src/CMakeLists.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index fc8b6cac4..d753333fd 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -118,7 +118,9 @@ if (IGNITION-TOOLS_BINARY_DIRS) ) endif() -set(SDF_BUILD_TESTS_EXTRA_EXE_SRCS Utils.cc) +if (NOT WIN32) + set(SDF_BUILD_TESTS_EXTRA_EXE_SRCS Utils.cc) +endif() sdf_build_tests(Utils_TEST.cc) sdf_build_tests(${gtest_sources}) From 4d6c2c275c475c53739502698e59081af7067168 Mon Sep 17 00:00:00 2001 From: Steve Peters Date: Wed, 25 Sep 2019 16:27:48 +0000 Subject: [PATCH 4/5] disable UNIT_Utils_TEST on windows --- src/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index d753333fd..7641a8456 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -120,8 +120,8 @@ endif() if (NOT WIN32) set(SDF_BUILD_TESTS_EXTRA_EXE_SRCS Utils.cc) + sdf_build_tests(Utils_TEST.cc) endif() -sdf_build_tests(Utils_TEST.cc) sdf_build_tests(${gtest_sources}) From 58794e80f6203883fa2dde5549191b42da1b5524 Mon Sep 17 00:00:00 2001 From: Steve Peters Date: Wed, 6 Nov 2019 22:11:59 +0000 Subject: [PATCH 5/5] Close branch utils_test7