Skip to content

Commit 1be07de

Browse files
committed
Eliminate Conan, CUnit
1 parent 9554c45 commit 1be07de

File tree

64 files changed

+1044
-504
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+1044
-504
lines changed

.azure/templates/build-test.yml

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,15 @@ steps:
3030
echo "###vso[task.setvariable variable=pip_cache;]${HOME}/.cache/pip"
3131
echo "###vso[task.setvariable variable=PATH;]$(python3 -m site --user-base)/bin:${PATH}"
3232
echo "###vso[task.setvariable variable=build_tool_options;]-j 4"
33-
sudo apt-get install -y clang clang-tools clang-tidy
33+
sudo apt install -y clang clang-tools clang-tidy
3434
condition: eq(variables['Agent.OS'], 'Linux')
3535
name: setup_linux
3636
- bash: |
37+
set -e -x
38+
sudo /usr/libexec/ApplicationFirewall/socketfilterfw --setglobalstate off
3739
echo "###vso[task.setvariable variable=pip_cache;]${HOME}/Library/Caches/pip"
3840
echo "###vso[task.setvariable variable=PATH;]$(python3 -m site --user-base)/bin:${PATH}"
3941
echo "###vso[task.setvariable variable=build_tool_options;]-j 4"
40-
sudo /usr/libexec/ApplicationFirewall/socketfilterfw --setglobalstate off
41-
brew install bison
4242
condition: eq(variables['Agent.OS'], 'Darwin')
4343
name: setup_macos
4444
# Use PowerShell rather than Bash to ensure Windows-style paths
@@ -62,16 +62,13 @@ steps:
6262
} else {
6363
Write-Host "###vso[task.setvariable variable=build_tool_options;]-j 4"
6464
}
65-
# On purpose do not install bison on windows to test the fallback to the parser.y in tree.
66-
# choco install winflexbison3
6765
condition: eq(variables['Agent.OS'], 'Windows_NT')
6866
name: setup_windows
6967
- task: Cache@2
7068
inputs:
7169
key: pip | 2 | $(Agent.OS)
7270
path: $(pip_cache)
7371
name: cache_pip
74-
- template: /.azure/templates/install-conan.yml
7572
- bash: |
7673
set -e -x
7774
python -m pip install pip wheel setuptools --user --upgrade
@@ -90,6 +87,7 @@ steps:
9087
iceoryx
9188
mkdir iceoryx/build
9289
cd iceoryx/build
90+
[[ "${AGENT_OS}" == 'Darwin' ]] && BUILD_TOOL_OPTIONS="-j 4"
9391
cmake -DCMAKE_BUILD_TYPE=${BUILD_TYPE} \
9492
-DCMAKE_BUILD_SHARED_LIBS=on \
9593
-DCMAKE_INSTALL_PREFIX=install \
@@ -101,10 +99,15 @@ steps:
10199
set -e -x
102100
mkdir build
103101
cd build
104-
conan install -b missing -pr:b ${BUILD_PROFILE} -pr:h ${HOST_PROFILE} -s build_type=${BUILD_TYPE} ../${CONANFILE:-conanfile.txt}
102+
prefix_path="${BUILD_SOURCESDIRECTORY}/iceoryx/build/install"
103+
if [[ "${AGENT_OS}" == 'Darwin' ]] ; then
104+
prefix_path="${prefix_path}:`brew --prefix openssl`"
105+
# Azure sometimes adds a spurious ' to BUILD_TOOL_OPTIONS
106+
BUILD_TOOL_OPTIONS="-j 4"
107+
fi
105108
cmake -DCMAKE_BUILD_TYPE=${BUILD_TYPE} \
106109
-DCMAKE_INSTALL_PREFIX=install \
107-
-DCMAKE_PREFIX_PATH="${BUILD_SOURCESDIRECTORY}/iceoryx/build/install" \
110+
-DCMAKE_PREFIX_PATH="${prefix_path//:/;}" \
108111
-DANALYZER=${ANALYZER:-off} \
109112
-DSANITIZER=${SANITIZER:-none} \
110113
-DENABLE_SSL=${SSL:-on} \
@@ -142,11 +145,13 @@ steps:
142145
-DCMAKE_BUILD_TYPE=${BUILD_TYPE} \
143146
${GENERATOR:+-G} "${GENERATOR}" -A "${PLATFORM}" -T "${TOOLSET}" "${INSTALLPREFIX}/share/CycloneDDS/examples/helloworld"
144147
cmake --build . --config ${BUILD_TYPE} -- ${BUILD_TOOL_OPTIONS}
148+
condition: ne(variables['testing'], 'off')
145149
name: test
146150
displayName: Test
147151
- bash: |
148152
set -e -x
149153
cd build
154+
[[ "${AGENT_OS}" == 'Darwin' ]] && BUILD_TOOL_OPTIONS="-j 4"
150155
cmake --build . --config ${BUILD_TYPE} --target gcov -- ${BUILD_TOOL_OPTIONS}
151156
gcovr --exclude '.*/tests/.*' --root "${BUILD_SOURCESDIRECTORY}" --json "$(System.DefaultWorkingDirectory)/coverage-$(Agent.JobName).json"
152157
name: generate_code_coverage

.azure/templates/install-conan.yml

Lines changed: 0 additions & 66 deletions
This file was deleted.

CMakeLists.txt

Lines changed: 3 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -72,33 +72,6 @@ if(APPLE)
7272
endif()
7373
endif()
7474

75-
# Conan
76-
if(EXISTS "${CMAKE_BINARY_DIR}/conanbuildinfo.cmake")
77-
include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
78-
if(APPLE)
79-
# By default Conan strips all RPATHs (see conanbuildinfo.cmake), which
80-
# causes tests to fail as the executables cannot find the library target.
81-
# By setting KEEP_RPATHS, Conan does not set CMAKE_SKIP_RPATH and the
82-
# resulting binaries still have the RPATH information. This is fine because
83-
# CMake will strip the build RPATH information in the install step.
84-
#
85-
# NOTE:
86-
# Conan's default approach is to use the "imports" feature, which copies
87-
# all the dependencies into the bin directory. Of course, this doesn't work
88-
# quite that well for libraries generated in this Project (see Conan
89-
# documentation).
90-
#
91-
# See the links below for more information.
92-
# https://github.com/conan-io/conan/issues/337
93-
# https://docs.conan.io/en/latest/howtos/manage_shared_libraries/rpaths.html
94-
# https://gitlab.kitware.com/cmake/community/wikis/doc/cmake/RPATH-handling
95-
conan_basic_setup(KEEP_RPATHS)
96-
else()
97-
conan_basic_setup()
98-
endif()
99-
conan_define_targets()
100-
endif()
101-
10275
# Set reasonably strict warning options for clang, gcc, msvc
10376
# Enable coloured ouput if Ninja is used for building
10477
if("${CMAKE_C_COMPILER_ID}" STREQUAL "Clang" OR
@@ -227,9 +200,9 @@ endif()
227200
find_package(codecov)
228201
set(MEMORYCHECK_COMMAND_OPTIONS "--track-origins=yes --leak-check=full --trace-children=yes --child-silent-after-fork=yes --xml=yes --xml-file=TestResultValgrind_%p.xml --tool=memcheck --show-reachable=yes --leak-resolution=high")
229202

230-
# By default building the testing tree is enabled by including CTest, but
231-
# since not everybody has CUnit, and because it is not strictly required to
232-
# build the product itself, switch to off by default.
203+
# Tests (integrated with CTest) are not built by default: not only are they not useful to
204+
# most people, building the test suite also forces exporting way more symbols from the
205+
# library so we can actually build the tests.
233206
option(BUILD_TESTING "Build the testing tree." OFF)
234207

235208
# Include the tests for idlc. These tests use the idl compiler (C back-end) to

README.md

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ while True:
6969
sleep(rng.exponential())
7070
```
7171

72-
Today DDS is also popular in robotics and autonomous vehicles because those really depend on high-throuhgput, low-latency control systems without introducing a single point of failure by having a message broker in the middle.
72+
Today DDS is also popular in robotics and autonomous vehicles because those really depend on high-throughput, low-latency control systems without introducing a single point of failure by having a message broker in the middle.
7373
Indeed, it is by far the most used and the default middleware choice in ROS 2.
7474
It is used to transfer commands, sensor data and even video and point clouds between components.
7575

@@ -99,7 +99,7 @@ With references to the individual OMG specifications, the following is available
9999
- [DDS XTypes](https://www.omg.org/spec/DDS-XTypes/1.3/PDF) - the structural type system (some [caveats](docs/dev/xtypes_relnotes.md) here)
100100
- [DDSI-RTPS](https://www.omg.org/spec/DDSI-RTPS/2.5/PDF) - the interoperable network protocol
101101

102-
The network stack in Cyclone DDS has been around for over a decade in one form or another and has proven itself in many systems, including large, high-availability ones and systems where interoperation with other implementations was needed.
102+
The network stack in Cyclone DDS has been around for over a decade in one form or another and has proven itself in many systems, including large, high-availability ones and systems where interoperatibility with other implementations was needed.
103103

104104
This repository provides the core of Cyclone DDS including its C API, the [OMG C++](https://github.com/eclipse-cyclonedds/cyclonedds-cxx) and the [Python](https://github.com/eclipse-cyclonedds/cyclonedds-python) language bindings are in sibling repositories.
105105

@@ -134,7 +134,7 @@ Depending on whether you want to develop applications using Cyclone DDS or contr
134134
There are some configuration options specified using CMake defines in addition to the standard options like `CMAKE_BUILD_TYPE`:
135135

136136
* `-DBUILD_EXAMPLES=ON`: to build the included examples
137-
* `-DBUILD_TESTING=ON`: to build the test suite (this requires [CUnit](http://cunit.sourceforge.net/), see [Contributing to Eclipse Cyclone DDS](#contributing-to-eclipse-cyclone-dds) below for more information)
137+
* `-DBUILD_TESTING=ON`: to build the test suite (forces exporting all symbols from the library)
138138
* `-DBUILD_IDLC=NO`: to disable building the IDL compiler (affects building examples, tests and `ddsperf`)
139139
* `-DBUILD_DDSPERF=NO`: to disable building the [`ddsperf`](https://github.com/eclipse-cyclonedds/cyclonedds/tree/master/src/tools/ddsperf) tool for performance measurement
140140
* `-DENABLE_SSL=NO`: to not look for OpenSSL, remove TLS/TCP support and avoid building the plugins that implement authentication and encryption (default is `AUTO` to enable them if OpenSSL is found)
@@ -189,25 +189,14 @@ Note that the default build type is a release build with debug information inclu
189189

190190
We very much welcome all contributions to the project, whether that is questions, examples, bug
191191
fixes, enhancements or improvements to the documentation, or anything else really.
192-
When considering contributing code, it might be good to know that build configurations for Azure pipelines are present in the repository and that there is a test suite using CTest and CUnit that can be built locally if desired.
192+
When considering contributing code, it might be good to know that build configurations for Azure pipelines are present in the repository and that there is a test suite built using a simple testing framework and CTest that can be built locally if desired.
193193
To build it, set the cmake variable `BUILD_TESTING` to on when configuring, e.g.:
194194

195195
$ cd build
196196
$ cmake -DCMAKE_BUILD_TYPE=Debug -DBUILD_TESTING=ON ..
197197
$ cmake --build .
198198
$ ctest
199199

200-
Such a build requires the presence of [CUnit](http://cunit.sourceforge.net/).
201-
You can install this yourself, or you can choose to instead rely on the [Conan](https://conan.io) packaging system that the CI build infrastructure also uses.
202-
In that case, install Conan and do:
203-
204-
$ conan install .. --build missing
205-
206-
in the build directory prior to running cmake.
207-
208-
For Windows, depending on the generator, you might also need to add switches to select the architecture and build type, e.g., `conan install -s arch=x86_64 -s build_type=Debug ..`
209-
This will automatically download and/or build CUnit (and, at the moment, OpenSSL).
210-
211200
## Documentation
212201

213202
The [documentation](https://cyclonedds.io/docs) is still rather limited and some parts of it are still only available in the form of text files in the `docs` directory.

azure-pipelines.yml

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -52,12 +52,13 @@ jobs:
5252
topic_discovery: off
5353
idlc_testing: off # temporary dislabled because of passing -t option to idlc in this test for recursive types
5454
cc: gcc-10
55-
'Ubuntu 18.04 LTS with GCC 7 (Debug, x86_64)':
56-
image: ubuntu-18.04
57-
conanfile: conanfile102.txt
58-
cc: gcc-7
59-
'Ubuntu 20.04 LTS with Clang 10 (Debug, x86_64)':
60-
image: ubuntu-20.04
55+
'Ubuntu 22.04 LTS with GCC 10 (Debug, x86_64, no tests)':
56+
image: ubuntu-22.04
57+
cc: gcc-10
58+
testing: off
59+
idlc_xtests: off
60+
'Ubuntu 22.04 LTS with Clang 12 (Debug, x86_64)':
61+
image: ubuntu-22.04
6162
analyzer: on
6263
sanitizer: address,undefined
6364
cc: clang-10
@@ -88,10 +89,19 @@ jobs:
8889
sanitizer: undefined
8990
cc: clang
9091
coverage: on
91-
'Windows 2019 with Visual Studio 2019 (Visual Studio 2017, Debug, x86)':
92+
'macOS 12 with gcc 12 (Debug, analyzer, x86_64)':
93+
image: macOS-12
94+
sanitizer: undefined
95+
deadline_update_skip: on
96+
cc: gcc-12
97+
analyzer: on
98+
# 32-bit Windows: without SSL/security because Chocolateley only provides 64-bit OpenSSL
99+
'Windows 2019 with Visual Studio 2019 (Visual Studio 2017, Debug, x86, no security)':
92100
arch: x86
93101
image: windows-2019
94-
idlc_testing: off
102+
ssl: off
103+
security: off
104+
idlc_xtests: off
95105
generator: 'Visual Studio 16 2019'
96106
toolset: v141
97107
'Windows 2019 with Visual Studio 2019 (Debug, x86_64)':

cmake/Modules/CUnit.cmake

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
#
1010
# SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
1111
#
12-
find_package(CUnit REQUIRED)
1312

1413
set(CUNIT_DIR "${CMAKE_CURRENT_LIST_DIR}/CUnit")
1514

@@ -227,14 +226,6 @@ function(set_test_library_paths TEST_NAME)
227226
endfunction()
228227

229228
function(add_cunit_executable TARGET)
230-
# Retrieve location of shared libary, which is need to extend the PATH
231-
# environment variable on Microsoft Windows, so that the operating
232-
# system can locate the .dll that it was linked against.
233-
# On macOS, this mechanism is used to set the DYLD_LIBRARY_PATH.
234-
get_target_property(CUNIT_LIBRARY_TYPE CUnit TYPE)
235-
get_target_property(CUNIT_IMPORTED_LOCATION CUnit IMPORTED_LOCATION)
236-
get_filename_component(CUNIT_LIBRARY_DIR "${CUNIT_IMPORTED_LOCATION}" PATH)
237-
238229
set(decls)
239230
set(defns)
240231
set(sources)
@@ -322,8 +313,7 @@ function(add_cunit_executable TARGET)
322313

323314
add_executable(
324315
${TARGET} "${CMAKE_CURRENT_BINARY_DIR}/${TARGET}.c" ${sources})
325-
target_link_libraries(${TARGET} PRIVATE CUnit)
326-
target_include_directories(${TARGET} PRIVATE "${CUNIT_DIR}/include")
316+
target_link_libraries(${TARGET} PRIVATE CycloneDDS::ucunit)
327317
if(MSVC)
328318
target_compile_definitions(${TARGET} PRIVATE _CRT_SECURE_NO_WARNINGS)
329319
endif()

0 commit comments

Comments
 (0)