Merge branch 'master' into merge2

Signed-off-by: Martin Bremmer <martin.bremmer@adlinktech.com>
This commit is contained in:
Martin Bremmer 2019-09-03 11:44:50 +02:00
commit 3fc777e631
477 changed files with 31941 additions and 32175 deletions

View file

@ -1,8 +1,42 @@
language: c
# Platform descriptions
# NOTE: These can be used in creating the build matrix by making use of the
# anchor/alias YAML features.
# Coverity Scan can be configured through Travis addons, but this allows for
# more control over the build instructions and does not require the addition
# of a coverity_scan branch in the repository. travisci_build_coverity_scan.sh
# does more checks before it decides to download Coverity (around 500M), but
# these instructions assume Coverity Scan is not installed if the directory
# does not exist and expects the download to fail if the token is incorrect.
# Coverity Scan quota are not checked as the Coverity enabled build must only
# run from cron.
install_coverity: &install_coverity
if [ "${COVERITY_SCAN}" = "true" ]; then
COV_DIR="/tmp/coverity-scan-analysis";
COV_ARC="/tmp/cov-analysis-${COV_PLATFORM}.tgz";
test ! -d "${COV_DIR}" &&
mkdir -p "${COV_DIR}" &&
curl -s -S -F project="${TRAVIS_REPO_SLUG}"
-F token="${COVERITY_SCAN_TOKEN}"
-o "${COV_ARC}"
"https://scan.coverity.com/download/cxx/${COV_PLATFORM}" &&
tar -xzf "${COV_ARC}" -C "${COV_DIR}";
COV_ANALYSIS=$(find "${COV_DIR}" -type d -name "cov-analysis*");
eval "export PATH=\"${PATH}:${COV_ANALYSIS}/bin\"";
eval "export SCAN_BUILD=\"cov-build --dir cov-int\"";
cov-configure --comptype ${COV_COMPTYPE} --compiler ${CC} --template;
fi
submit_to_coverity_scan: &submit_to_coverity_scan
if [ "${COVERITY_SCAN}" = "true" ]; then
tar -czf analysis-results.tgz cov-int &&
curl -s -S -F project="${TRAVIS_REPO_SLUG}"
-F token="${COVERITY_SCAN_TOKEN}"
-F file=@analysis-results.tgz
-F version=$(git rev-parse --short HEAD)
-F description="Travis CI build"
-F email="${COVERITY_SCAN_EMAIL:=cyclonedds-inbox@eclipse.org}"
"https://scan.coverity.com/builds";
fi
linux_gcc8: &linux_gcc8
os: linux
dist: xenial
@ -12,6 +46,13 @@ linux_gcc8: &linux_gcc8
update: true
sources: [ ubuntu-toolchain-r-test ]
packages: [ gcc-8 g++-8 ]
before_install:
- eval "export CC=gcc-8"
- eval "export CXX=g++-8"
- eval "export COV_COMPTYPE=gcc COV_PLATFORM=linux64"
install:
- *install_coverity
- pip install conan --upgrade --user
linux_clang: &linux_clang
os: linux
@ -20,95 +61,106 @@ linux_clang: &linux_clang
addons:
apt:
update: true
before_install:
- eval "export CC=clang"
- eval "export CXX=clang++"
- eval "export COV_COMPTYPE=clang COV_PLATFORM=linux64"
install:
- pip install conan --upgrade --user
osx_xcode10_1: &osx_xcode10_1
osx_xcode10_2: &osx_xcode10_2
os: osx
osx_image: xcode10.1
osx_image: xcode10.2
compiler: clang
addons:
homebrew:
packages:
- pyenv-virtualenv
before_install:
- eval "export CC=clang"
- eval "export CXX=clang++"
- eval "export COV_COMPTYPE=clang COV_PLATFORM=macOSX"
install:
- eval "$(pyenv init -)"
- pyenv virtualenv conan
- pyenv rehash
- pyenv activate conan
- pip install conan --upgrade
windows_vs2017: &windows_vs2017
os: windows
matrix:
include:
- <<: *linux_gcc8
env: [ BUILD_TYPE=Debug, C_COMPILER=gcc-8, CXX_COMPILER=g++-8, USE_SANITIZER=none ]
- <<: *linux_gcc8
env: [ BUILD_TYPE=Release, C_COMPILER=gcc-8, CXX_COMPILER=g++-8, USE_SANITIZER=none ]
- <<: *linux_clang
env: [ BUILD_TYPE=Debug, C_COMPILER=clang, CXX_COMPILER=clang++, USE_SANITIZER=address ]
- <<: *linux_clang
env: [ BUILD_TYPE=Release, C_COMPILER=clang, CXX_COMPILER=clang++, USE_SANITIZER=none ]
- <<: *osx_xcode10_1
env: [ BUILD_TYPE=Debug, C_COMPILER=clang, CXX_COMPILER=clang++, USE_SANITIZER=address ]
- <<: *osx_xcode10_1
env: [ BUILD_TYPE=Release, C_COMPILER=clang, CXX_COMPILER=clang++, USE_SANITIZER=none ]
- <<: *windows_vs2017
env: [ ARCH=x86, BUILD_TYPE=Debug, GENERATOR="Visual Studio 15 2017" ]
- <<: *windows_vs2017
env: [ ARCH=x86_64, BUILD_TYPE=Debug, GENERATOR="Visual Studio 15 2017" ]
- <<: *windows_vs2017
env: [ ARCH=x86_64, BUILD_TYPE=Release, GENERATOR="Visual Studio 15 2017" ]
# Conan will automatically determine the best compiler for a given platform
# based on educated guesses. The first check is based on the CC and CXX
# environment variables, the second (on Windows) is to check if Microsoft
# Visual Studio is installed. On Travis CC and CXX are set to gcc on Microsoft
# Windows targets as well, this has the undesired effect that MSVC is not
# detected, unsetting CC and CXX solves that problem.
# Visual Studio is installed. On Travis CC and CXX are set to gcc on
# Microsoft Windows targets as well, this has the undesired effect that MSVC
# is not detected, unsetting CC and CXX solves that problem.
#
#
# !!! IMPORTANT !!!
#
# Microsoft Windows instances freeze at "install:" if secure environment
# variables are used. There is no option to export secrets only for
# specified platforms. The "filter_secrets: false" option is used to disable
# the filter for Microsoft Windows instances. This is not an issue if the
# secret is removed from the environment at the earliest opportunity, before
# risk of exposure, as secrets are always removed from the environment for
# pull requests and are still filtered when exported to the environment. The
# secret of course will not be available for Microsoft Windows builds, but
# for Coverity Scan, that is fine.
filter_secrets: false
before_install:
- if [ "${TRAVIS_OS_NAME}" = "windows" ]; then
eval "unset CC";
eval "unset CXX";
JAVA_HOME=$(find "/c/Program Files/Android/jdk/" -name "*openjdk*" | sort | head -n 1);
export JAVA_HOME;
export PATH="${PATH}:${JAVA_HOME}/bin";
else
eval "export CC=${C_COMPILER}";
eval "export CXX=${CXX_COMPILER}";
fi
- eval "unset COVERITY_SCAN_TOKEN"
- eval "unset COVERITY_SCAN_EMAIL"
- eval "unset CC"
- eval "unset CXX"
- eval "export COV_COMPTYPE=msvc COV_PLATFORM=win64"
- JAVA_HOME=$(find "/c/Program Files/Android/jdk/" -name "*openjdk*" | sort | head -n 1)
- export JAVA_HOME
- export PATH="${PATH}:${JAVA_HOME}/bin"
# Windows targets in Travis are still very much in beta and Python is not yet
# available and installation of Python through Chocolaty does not work well.
# The real fix is to wait until Python and pip are both available on the
# target. Until then download Conan from the official website and simply add
# the extracted folder to the path.
install:
- if [ "${TRAVIS_OS_NAME}" = "windows" ]; then
choco install innoextract;
choco install maven --ignore-dependencies;
wget -q https://dl.bintray.com/conan/installers/conan-win-64_1_10_0.exe;
innoextract conan-win-64_1_10_0.exe;
eval "export PATH=\"$(pwd)/app/conan:${PATH}\"";
elif [ "${TRAVIS_OS_NAME}" = "osx" ]; then
eval "$(pyenv init -)";
pyenv virtualenv conan;
pyenv rehash;
pyenv activate conan;
pip install conan --upgrade;
else
pip install conan --upgrade --user;
fi
- conan profile new default --detect
- choco install innoextract
- choco install maven --ignore-dependencies
- wget -q https://dl.bintray.com/conan/installers/conan-win-64_1_10_0.exe
- innoextract conan-win-64_1_10_0.exe
- eval "export PATH=\"$(pwd)/app/conan:${PATH}\""
jobs:
include:
- <<: *linux_gcc8
env: [ ARCH=x86_64, ASAN=none, BUILD_TYPE=Debug, SSL=YES, GENERATOR="Unix Makefiles", COVERITY_SCAN=true ]
if: type = cron
- <<: *linux_gcc8
env: [ ARCH=x86_64, ASAN=none, BUILD_TYPE=Debug, SSL=YES, GENERATOR="Unix Makefiles" ]
- <<: *linux_gcc8
env: [ ARCH=x86_64, ASAN=none, BUILD_TYPE=Release, SSL=YES, GENERATOR="Unix Makefiles" ]
- <<: *linux_gcc8
env: [ ARCH=x86_64, ASAN=none, BUILD_TYPE=Debug, SSL=NO, GENERATOR="Unix Makefiles" ]
- <<: *linux_gcc8
env: [ ARCH=x86_64, ASAN=none, BUILD_TYPE=Release, SSL=YES, GENERATOR="Unix Makefiles" ]
- <<: *linux_clang
env: [ ARCH=x86_64, ASAN=address, BUILD_TYPE=Debug, SSL=YES, GENERATOR="Unix Makefiles" ]
- <<: *linux_clang
env: [ ARCH=x86_64, ASAN=none, BUILD_TYPE=Release, SSL=YES, GENERATOR="Unix Makefiles" ]
- <<: *osx_xcode10_2
env: [ ARCH=x86_64, ASAN=address, BUILD_TYPE=Debug, SSL=YES, GENERATOR="Unix Makefiles" ]
- <<: *osx_xcode10_2
env: [ ARCH=x86_64, ASAN=none, BUILD_TYPE=Release, SSL=YES, GENERATOR="Unix Makefiles" ]
- <<: *windows_vs2017
env: [ ARCH=x86, ASAN=none, BUILD_TYPE=Debug, SSL=YES, GENERATOR="Visual Studio 15 2017" ]
- <<: *windows_vs2017
env: [ ARCH=x86_64, ASAN=none, BUILD_TYPE=Debug, SSL=YES, GENERATOR="Visual Studio 15 2017 Win64" ]
- <<: *windows_vs2017
env: [ ARCH=x86_64, ASAN=none, BUILD_TYPE=Release, SSL=YES, GENERATOR="Visual Studio 15 2017 Win64" ]
before_script:
- conan profile new default --detect
- conan remote add bincrafters https://api.bintray.com/conan/bincrafters/public-conan
- conan profile get settings.arch default
- if [ -z "${ARCH}" ]; then
eval "export ARCH=\"$(conan profile get settings.arch default)\"";
fi
- if [ "${TRAVIS_OS_NAME}" = "windows" ]; then
GENERATOR_ARCH=$(if [ "${ARCH}" = "x86_64" ]; then echo " Win64"; fi);
eval "export GENERATOR=\"${GENERATOR}${GENERATOR_ARCH}\"";
eval "export USE_SANITIZER=none";
else
eval "export GENERATOR=\"Unix Makefiles\"";
fi
- export
script:
- mkdir build
@ -116,12 +168,24 @@ script:
- conan install -b missing -s arch=${ARCH} -s build_type=${BUILD_TYPE} ..
- cmake -DCMAKE_BUILD_TYPE=${BUILD_TYPE}
-DCMAKE_INSTALL_PREFIX=$(pwd)/install
-DUSE_SANITIZER=${USE_SANITIZER}
-DUSE_SANITIZER=${ASAN}
-DENABLE_SSL=${SSL}
-DBUILD_TESTING=on
-G "${GENERATOR}" ../src
- cmake --build . --config ${BUILD_TYPE} --target install
- CYCLONEDDS_URI='<CycloneDDS><DDSI2E><Internal><EnableExpensiveChecks>all</EnableExpensiveChecks></Internal></DDSI2E></CycloneDDS>' ctest -T test -C ${BUILD_TYPE}
- if [ "${USE_SANITIZER}" != "none" ]; then
-DWERROR=on
-G "${GENERATOR}" ..
- case "${GENERATOR}" in
"Unix Makefiles")
${SCAN_BUILD} cmake --build . --config ${BUILD_TYPE} --target install -- -j 4
;;
"Visual Studio "*)
${SCAN_BUILD} cmake --build . --config ${BUILD_TYPE} --target install -- -nologo -verbosity:minimal -maxcpucount -p:CL_MPCount=2
;;
*)
${SCAN_BUILD} cmake --build . --config ${BUILD_TYPE} --target install
;;
esac
- CYCLONEDDS_URI='<CycloneDDS><Domain><Internal><EnableExpensiveChecks>all</EnableExpensiveChecks></Internal><Tracing><Verbosity>config</Verbosity><OutputFile>stderr</OutputFile></Tracing></Domain></CycloneDDS>' ctest -j 4 --output-on-failure -T test -C ${BUILD_TYPE}
- if [ "${ASAN}" != "none" ]; then
CMAKE_LINKER_FLAGS="-DCMAKE_LINKER_FLAGS=-fsanitize=${USE_SANITIZER}";
CMAKE_C_FLAGS="-DCMAKE_C_FLAGS=-fsanitize=${USE_SANITIZER}";
fi
@ -132,4 +196,8 @@ script:
${CMAKE_LINKER_FLAGS}
-G "${GENERATOR}" ..
- cmake --build . --config ${BUILD_TYPE}
- cd "${TRAVIS_BUILD_DIR}/build"
after_success:
- *submit_to_coverity_scan

219
CMakeLists.txt Normal file
View file

@ -0,0 +1,219 @@
#
# Copyright(c) 2006 to 2019 ADLINK Technology Limited and others
#
# This program and the accompanying materials are made available under the
# terms of the Eclipse Public License v. 2.0 which is available at
# http://www.eclipse.org/legal/epl-2.0, or the Eclipse Distribution License
# v. 1.0 which is available at
# http://www.eclipse.org/org/documents/edl-v10.php.
#
# SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
#
cmake_minimum_required(VERSION 3.7)
# Set a default build type if none was specified
set(default_build_type "RelWithDebInfo")
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
message(STATUS "Setting build type to '${default_build_type}' as none was specified.")
set(CMAKE_BUILD_TYPE "${default_build_type}" CACHE
STRING "Choose the type of build." FORCE)
# Set the possible values of build type for cmake-gui
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS
"Debug" "Release" "MinSizeRel" "RelWithDebInfo")
endif()
# By default the Java-based components get built, but make it possible to disable that: if only the
# core library is required, there's no need to build them, and that in turn eliminates the Maven and
# JDK dependency.
option(BUILD_IDLC "Build IDL preprocessor" ON)
option(BUILD_CONFTOOL "Build configuration file edit tool" ON)
# By default don't treat warnings as errors, else anyone building it with a different compiler that
# just happens to generate a warning, as well as anyone adding or modifying something and making a
# small mistake would run into errors. CI builds can be configured differently.
option(WERROR "Treat compiler warnings as errors" OFF)
FUNCTION(PREPEND var prefix)
SET(listVar "")
FOREACH(f ${ARGN})
LIST(APPEND listVar "${prefix}/${f}")
ENDFOREACH(f)
SET(${var} "${listVar}" PARENT_SCOPE)
ENDFUNCTION(PREPEND)
# Set module path before defining project so platform files will work.
set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake/Modules")
set(CMAKE_PROJECT_NAME_FULL "Eclipse Cyclone DDS")
project(CycloneDDS VERSION 0.1.0)
# Set some convenience variants of the project-name
string(REPLACE " " "-" CMAKE_PROJECT_NAME_DASHED "${CMAKE_PROJECT_NAME_FULL}")
string(TOUPPER ${CMAKE_PROJECT_NAME} CMAKE_PROJECT_NAME_CAPS)
string(TOLOWER ${CMAKE_PROJECT_NAME} CMAKE_PROJECT_NAME_SMALL)
set(CMAKE_C_STANDARD 99)
if(CMAKE_SYSTEM_NAME STREQUAL "VxWorks")
add_definitions(-std=c99)
endif()
if(${CMAKE_C_COMPILER_ID} STREQUAL "SunPro")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -m64 -xc99 -D__restrict=restrict -D__deprecated__=")
set(CMAKE_LINKER_FLAGS "${CMAKE_LINKER_FLAGS} -m64")
elseif(CMAKE_SYSTEM_NAME STREQUAL "SunOS")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -m64")
set(CMAKE_LINKER_FLAGS "${CMAKE_LINKER_FLAGS} -m64")
endif()
# Conan
if(EXISTS "${CMAKE_BINARY_DIR}/conanbuildinfo.cmake")
include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
if(APPLE)
# By default Conan strips all RPATHs (see conanbuildinfo.cmake), which
# causes tests to fail as the executables cannot find the library target.
# By setting KEEP_RPATHS, Conan does not set CMAKE_SKIP_RPATH and the
# resulting binaries still have the RPATH information. This is fine because
# CMake will strip the build RPATH information in the install step.
#
# NOTE:
# Conan's default approach is to use the "imports" feature, which copies
# all the dependencies into the bin directory. Of course, this doesn't work
# quite that well for libraries generated in this Project (see Conan
# documentation).
#
# See the links below for more information.
# https://github.com/conan-io/conan/issues/337
# https://docs.conan.io/en/latest/howtos/manage_shared_libraries/rpaths.html
# https://gitlab.kitware.com/cmake/community/wikis/doc/cmake/RPATH-handling
conan_basic_setup(KEEP_RPATHS)
else()
conan_basic_setup()
endif()
conan_define_targets()
endif()
# Set reasonably strict warning options for clang, gcc, msvc
# Enable coloured ouput if Ninja is used for building
if("${CMAKE_C_COMPILER_ID}" STREQUAL "Clang" OR
"${CMAKE_C_COMPILER_ID}" STREQUAL "AppleClang")
#message(STATUS clang)
set(wflags "-Wall"
"-Wextra"
"-Wconversion"
"-Wunused"
"-Wmissing-prototypes"
"-Winfinite-recursion"
"-Wassign-enum"
"-Wcomma"
"-Wmissing-prototypes"
"-Wdocumentation"
"-Wstrict-prototypes"
"-Wconditional-uninitialized"
"-Wshadow")
add_compile_options(${wflags})
if(${WERROR})
add_compile_options(-Werror)
endif()
if("${CMAKE_GENERATOR}" STREQUAL "Ninja")
add_compile_options(-Xclang -fcolor-diagnostics)
endif()
elseif("${CMAKE_C_COMPILER_ID}" STREQUAL "GNU")
#message(STATUS gcc)
add_compile_options(-Wall -Wextra -Wconversion -Wmissing-prototypes)
if(${WERROR})
add_compile_options(-Werror)
endif()
if("${CMAKE_GENERATOR}" STREQUAL "Ninja")
add_compile_options(-fdiagnostics-color=always)
endif()
elseif("${CMAKE_C_COMPILER_ID}" STREQUAL "MSVC")
#message(STATUS msvc)
add_compile_options(/W3)
if(${WERROR})
add_compile_options(/WX)
endif()
endif()
# I don't know how to enable warnings properly so that they are enabled in Xcode projects as well
if(${CMAKE_GENERATOR} STREQUAL "Xcode")
set (CMAKE_XCODE_ATTRIBUTE_CLANG_WARN_EMPTY_BODY YES)
set (CMAKE_XCODE_ATTRIBUTE_GCC_WARN_SHADOW YES)
set (CMAKE_XCODE_ATTRIBUTE_CLANG_WARN_BOOL_CONVERSION YES)
set (CMAKE_XCODE_ATTRIBUTE_CLANG_WARN_CONSTANT_CONVERSION YES)
set (CMAKE_XCODE_ATTRIBUTE_GCC_WARN_64_TO_32_BIT_CONVERSION YES)
set (CMAKE_XCODE_ATTRIBUTE_CLANG_WARN_ENUM_CONVERSION YES)
set (CMAKE_XCODE_ATTRIBUTE_CLANG_WARN_FLOAT_CONVERSION YES)
set (CMAKE_XCODE_ATTRIBUTE_CLANG_WARN_INT_CONVERSION YES)
set (CMAKE_XCODE_ATTRIBUTE_CLANG_WARN_NON_LITERAL_NULL_CONVERSION YES)
set (CMAKE_XCODE_ATTRIBUTE_CLANG_WARN_IMPLICIT_SIGN_CONVERSION YES)
set (CMAKE_XCODE_ATTRIBUTE_CLANG_WARN_INFINITE_RECURSION YES)
set (CMAKE_XCODE_ATTRIBUTE_GCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED YES)
set (CMAKE_XCODE_ATTRIBUTE_GCC_WARN_ABOUT_RETURN_TYPE YES)
set (CMAKE_XCODE_ATTRIBUTE_GCC_WARN_MISSING_PARENTHESES YES)
set (CMAKE_XCODE_ATTRIBUTE_GCC_WARN_ABOUT_MISSING_FIELD_INITIALIZERS YES)
set (CMAKE_XCODE_ATTRIBUTE_GCC_WARN_ABOUT_MISSING_NEWLINE YES)
set (CMAKE_XCODE_ATTRIBUTE_CLANG_WARN_ASSIGN_ENUM YES)
set (CMAKE_XCODE_ATTRIBUTE_CLANG_WARN_SEMICOLON_BEFORE_METHOD_BODY YES)
set (CMAKE_XCODE_ATTRIBUTE_GCC_WARN_SIGN_COMPARE YES)
set (CMAKE_XCODE_ATTRIBUTE_CLANG_WARN_STRICT_PROTOTYPES YES)
set (CMAKE_XCODE_ATTRIBUTE_CLANG_WARN_COMMA YES)
set (CMAKE_XCODE_ATTRIBUTE_CLANG_WARN_SUSPICIOUS_IMPLICIT_CONVERSION YES)
set (CMAKE_XCODE_ATTRIBUTE_GCC_WARN_UNINITIALIZED_AUTOS YES_AGGRESSIVE)
set (CMAKE_XCODE_ATTRIBUTE_GCC_WARN_UNUSED_FUNCTION YES)
set (CMAKE_XCODE_ATTRIBUTE_GCC_WARN_UNUSED_LABEL YES)
set (CMAKE_XCODE_ATTRIBUTE_GCC_WARN_UNUSED_PARAMETER YES)
set (CMAKE_XCODE_ATTRIBUTE_GCC_WARN_UNUSED_VALUE YES)
set (CMAKE_XCODE_ATTRIBUTE_GCC_WARN_UNUSED_VARIABLE YES)
set (CMAKE_XCODE_ATTRIBUTE_CLANG_WARN_DOCUMENTATION_COMMENTS YES)
set (CMAKE_XCODE_ATTRIBUTE_GCC_WARN_ABOUT_MISSING_PROTOTYPES YES)
endif()
# Make it easy to enable one of Clang's/gcc's analyzers, and default to using
# the address sanitizer for ordinary debug builds; gcc is giving some grief on
# Travis, so don't enable it for gcc by default
if(NOT USE_SANITIZER)
if(${CMAKE_BUILD_TYPE} STREQUAL "Debug" AND
NOT (${CMAKE_GENERATOR} STREQUAL "Xcode") AND
(${CMAKE_C_COMPILER_ID} STREQUAL "Clang"
OR ${CMAKE_C_COMPILER_ID} STREQUAL "AppleClang"))
message(STATUS "Enabling address sanitizer; set USE_SANITIZER=none to prevent this")
set(USE_SANITIZER address)
else()
set(USE_SANITIZER none)
endif()
endif()
if(NOT (${USE_SANITIZER} STREQUAL "none"))
message(STATUS "Sanitizer set to ${USE_SANITIZER}")
add_compile_options(-fno-omit-frame-pointer -fsanitize=${USE_SANITIZER})
link_libraries(-fno-omit-frame-pointer -fsanitize=${USE_SANITIZER})
endif()
include(GNUInstallDirs)
include(AnalyzeBuild)
if(APPLE)
set(CMAKE_INSTALL_RPATH "@loader_path/../${CMAKE_INSTALL_LIBDIR}")
else()
set(CMAKE_INSTALL_RPATH "$ORIGIN/../${CMAKE_INSTALL_LIBDIR}")
endif()
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")
# By default building the testing tree is enabled by including CTest, but
# since not everybody has CUnit, and because it is not strictly required to
# build the product itself, switch to off by default.
option(BUILD_TESTING "Build the testing tree." OFF)
include(CTest)
# Build all executables and libraries into the top-level /bin and /lib folders.
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin")
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib")
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib")
add_subdirectory(src)
if(BUILD_IDLC)
add_subdirectory(examples)
endif()
option(BUILD_DOCS "Build documentation." OFF)
add_subdirectory(docs)
# Pull-in CPack and support for generating <Package>Config.cmake and packages.
include(Packaging)

148
README.md
View file

@ -1,28 +1,38 @@
# Eclipse Cyclone DDS
Eclipse Cyclone DDS is by far the most performant and robust DDS implementation available on the
market. Moreover, Cyclone DDS is developed completely in the open as an Eclipse IoT project
Eclipse Cyclone DDS is a very performant and robust open-source DDS implementation. Cyclone DDS is developed completely in the open as an Eclipse IoT project
(see [eclipse-cyclone-dds](https://projects.eclipse.org/projects/iot.cyclonedds)).
* [Getting Started](#getting-started)
* [Performance](#performance)
* [Configuration](#configuration)
# Getting Started
## Building Eclipse Cyclone DDS
In order to build Cyclone DDS you need a Linux, Mac or Windows 10 machine with the following
installed on your host:
In order to build Cyclone DDS you need a Linux, Mac or Windows 10 machine (or, with some caveats, an
OpenIndiana one or a Solaris 2.6 one) with the following installed on your host:
* [CMake](https://cmake.org/download/), version 3.7 or later. (Version 3.6 should work but you
will have to edit the ``cmake_minimum_required`` version and may have to disable building the
tests.)
* [OpenSSL](https://www.openssl.org/), preferably version 1.1 or later. If you wish, you can
build without support for OpenSSL by setting DDSC\_ENABLE\_OPENSSL to FALSE on the ``cmake ``
command line (i.e., ``cmake -DDDSC_ENABLE_OPENSSL=FALSE`` ../src). In that, there is no need to
have openssl available.
* Java JDK, version 8 or later, e.g., [OpenJDK 11](http://jdk.java.net/11/).
* [Apache Maven](http://maven.apache.org/download.cgi), version 3.5 or later.
* C compiler (most commonly GCC on Linux, Visual Studio on Windows, Xcode on macOS);
* GIT version control system;
* [CMake](https://cmake.org/download/), version 3.7 or later;
* [OpenSSL](https://www.openssl.org/), preferably version 1.1 or later if you want to use TLS over
TCP. You can explicitly disable it by setting ``ENABLE_SSL=NO``, which is very useful for
reducing the footprint or when the FindOpenSSL CMake script gives you trouble;
* Java JDK, version 8 or later, e.g., [OpenJDK](https://jdk.java.net/);
* [Apache Maven](https://maven.apache.org/download.cgi), version 3.5 or later.
On Ubuntu ``apt install maven default-jdk`` should do the trick for getting Java and Maven
installed, and the rest should already be there. On Windows, installing chocolatey and ``choco
install git cmake openjdk maven`` should get you a long way. On macOS, ``brew install maven cmake``
and downloading and installing the JDK is easiest.
The Java-based components are the preprocessor and a configurator tool. The run-time libraries are
pure C code, so there is no need to have Java available on "target" machines.
pure C code, so there is no need to have Java available on "target" machines. If desired, it is
possible to do a build without Java or Maven installed by defining ``BUILD_IDLC=NO`` and
``BUILD_CONFTOOL=NO``, but that effectively only gets you the core library. For the
current [ROS2 RMW layer](https://github.com/atolab/rmw_cyclonedds), that is sufficient.
To obtain Eclipse Cyclone DDS, do
@ -40,13 +50,13 @@ DDS requires a few simple steps. There are some small differences between Linux
hand, and Windows on the other. For Linux or macOS:
$ cd build
$ cmake -DCMAKE_INSTALL_PREFIX=<install-location> ../src
$ cmake -DCMAKE_INSTALL_PREFIX=<install-location> ..
$ cmake --build .
and for Windows:
$ cd build
$ cmake -G "<generator-name>" -DCMAKE_INSTALL_PREFIX=<install-location> ../src
$ cmake -G "<generator-name>" -DCMAKE_INSTALL_PREFIX=<install-location> ..
$ cmake --build .
where you should replace ``<install-location>`` by the directory under which you would like to
@ -65,7 +75,6 @@ which will copy everything to:
* ``<install-location>/bin``
* ``<install-location>/include/ddsc``
* ``<install-location>/share/CycloneDDS``
* ``<install-location>/etc/CycloneDDS``
Depending on the installation location you may need administrator privileges.
@ -85,7 +94,7 @@ present in the repository and that there is a test suite using CTest and CUnit t
locally if desired. To build it, set the cmake variable ``BUILD_TESTING`` to on when configuring, e.g.:
$ cd build
$ cmake -DCMAKE_BUILD_TYPE=Debug -DBUILD_TESTING=ON ../src
$ cmake -DCMAKE_BUILD_TYPE=Debug -DBUILD_TESTING=ON ..
$ cmake --build .
$ ctest
@ -103,37 +112,19 @@ the moment, OpenSSL).
## Documentation
The documentation is still rather limited, and at the moment only available in the sources (in the
form of restructured text files in ``src/docs`` and Doxygen comments in the header files), or as
form of restructured text files in ``docs`` and Doxygen comments in the header files), or as
a
[PDF](https://raw.githubusercontent.com/eclipse-cyclonedds/cyclonedds/assets/pdf/CycloneDDS-0.1.0.pdf). The
intent is to automate the process of building the documentation and have them available in more
convenient formats and in the usual locations.
## Performance
Median small message throughput measured using the Throughput example between two Intel(R) Xeon(R)
CPU E3-1270 V2 @ 3.50GHz (that's 2012 hardware ...) running Linux 3.8.13-rt14.20.el6rt.x86_64,
connected via a quiet GbE and when using gcc-6.2.0 for a default (i.e., "RelWithDebInfo") build is:
<img src="https://raw.githubusercontent.com/eclipse-cyclonedds/cyclonedds/assets/performance/throughput-polling.png" alt="Throughput" height="400">
This is with the subscriber in polling mode. Listener mode is marginally slower; using a waitset the
message rate for minimal size messages drops to 600k sample/s in synchronous delivery mode and about
750k samples/s in asynchronous delivery mode. The configuration is an out-of-the-box configuration,
tweaked only to increase the high-water mark for the reliability window on the writer side. For
details, see the scripts in the ``performance`` directory and
the
[data](https://raw.githubusercontent.com/eclipse-cyclonedds/cyclonedds/assets/performance/throughput.txt).
There is some data on roundtrip latency below.
## Building and Running the Roundtrip Example
We will show you how to build and run an example program that measures latency. The examples are
built automatically when you build Cyclone DDS, so you don't need to follow these steps to be able
to run the program, it is merely to illustrate the process.
$ cd cyclonedds/src/examples/roundtrip
$ cd cyclonedds/examples/roundtrip
$ mkdir build
$ cd build
$ cmake ..
@ -149,8 +140,8 @@ On another terminal, start the application that will be sending the pings:
# payloadSize: 0 | numSamples: 0 | timeOut: 0
# Waiting for startup jitter to stabilise
# Warm up complete.
# Round trip measurements (in us)
# Round trip time [us] Write-access time [us] Read-access time [us]
# Latency measurements (in us)
# Latency [us] Write-access time [us] Read-access time [us]
# Seconds Count median min 99% max Count median min Count median min
1 28065 17 16 23 87 28065 8 6 28065 1 0
2 28115 17 16 23 46 28115 8 6 28115 1 0
@ -167,6 +158,83 @@ The numbers above were measured on Mac running a 4.2 GHz Intel Core i7 on Decemb
these numbers you can see how the roundtrip is very stable and the minimal latency is now down to 17
micro-seconds (used to be 25 micro-seconds) on this HW.
# Performance
Reliable message throughput is over 1MS/s for very small samples and is roughly 90% of GbE with 100
byte samples, and latency is about 30us when measured using [ddsperf](src/tools/ddsperf) between two
Intel(R) Xeon(R) CPU E3-1270 V2 @ 3.50GHz (that's 2012 hardware ...) running Ubuntu 16.04, with the
executables built on Ubuntu 18.04 using gcc 7.4.0 for a default (i.e., "RelWithDebInfo") build.
<img src="https://raw.githubusercontent.com/eclipse-cyclonedds/cyclonedds/assets/performance/20190730/throughput-async-listener-rate.png" alt="Throughput" height="400"><img src="https://raw.githubusercontent.com/eclipse-cyclonedds/cyclonedds/assets/performance/20190730/latency-sync-listener.png" alt="Throughput" height="400">
This is with the subscriber in listener mode, using asynchronous delivery for the throughput
test. The configuration is a marginally tweaked out-of-the-box configuration: an increased maximum
message size and fragment size, and an increased high-water mark for the reliability window on the
writer side. For details, see the [scripts](examples/perfscript) directory,
the
[environment details](https://raw.githubusercontent.com/eclipse-cyclonedds/cyclonedds/assets/performance/20190730/config.txt) and
the
[throughput](https://raw.githubusercontent.com/eclipse-cyclonedds/cyclonedds/assets/performance/20190730/sub.log) and
[latency](https://raw.githubusercontent.com/eclipse-cyclonedds/cyclonedds/assets/performance/20190730/ping.log) data
underlying the graphs. These also include CPU usage ([thoughput](https://raw.githubusercontent.com/eclipse-cyclonedds/cyclonedds/assets/performance/20190730/throughput-async-listener-cpu.png) and [latency](https://raw.githubusercontent.com/eclipse-cyclonedds/cyclonedds/assets/performance/20190730/latency-sync-listener-bwcpu.png)) and [memory usage](https://raw.githubusercontent.com/eclipse-cyclonedds/cyclonedds/assets/performance/20190730/throughput-async-listener-memory.png).
# Configuration
The out-of-the-box configuration should usually be fine, but there are a great many options that can
be tweaked by creating an XML file with the desired settings and defining the ``CYCLONEDDS_URI`` to
point to it. E.g. (on Linux):
$ cat cyclonedds.xml
<CycloneDDS>
<Domain id="any">
<General>
<NetworkInterfaceAddress>auto</NetworkInterfaceAddress>
<AllowMulticast>auto</AllowMulticast>
<MaxMessageSize>65500B</MaxMessageSize>
<FragmentSize>4000B</FragmentSize>
</General>
<Internal>
<Watermarks>
<WhcHigh>500kB</WhcHigh>
</Watermarks>
</Internal>
<Tracing>
<Verbosity>config</Verbosity>
<OutputFile>stdout</OutputFile>
</Tracing>
</Domain>
</CycloneDDS>
$ export CYCLONEDDS_URI=file://$PWD/cyclonedds.xml
(on Windows, one would have to use ``set CYCLONEDDS_URI=file://...`` instead.)
This example shows a few things:
* ``NetworkInterfaceAddress`` can be used to override the interface selected by default (you can use
the address or the interface name). Proper use of multiple network interfaces simultaneously will
come, but is not there yet.
* ``AllowMulticast`` configures the circumstances under which multicast will be used. If the
selected interface doesn't support it, it obviously won't be used (``false``); but if it does
support it, the type of the network adapter determines the default value. For a wired network, it
will use multicast for initial discovery as well as for data when there are multiple peers that
the data needs to go to (``true``); but on a WiFi network it will use it only for initial
discovery (``spdp``), because multicast on WiFi is very unreliable.
* ``Verbosity`` allows control over the tracing, "config" dumps the configuration to the trace
output (which defaults to "cyclonedds.log"). Which interface is used, what multicast settings are
used, etc., is all in the trace. Setting the verbosity to "finest" gives way more output on the
inner workings, and there are various other levels as well.
* ``MaxMessageSize`` and ``FragmentSize`` control the maximum size of the RTPS messages (basically
the size of the UDP payload), and the size of the fragments into which very large samples get
split (which needs to be "a bit" less). Large values such as these typically improve performance
over the (current) default values.
* ``WhcHigh`` determines when the sender will wait for acknowledgements from the readers because it
has buffered too much unacknowledged data. There is some auto-tuning, the (current) default value
is a bit small to get really high throughput.
The configurator tool ``cycloneddsconf`` can help in discovering the settings, as can the config
dump. Background information on configuring Cyclone DDS can be
found [here](docs/manual/config.rst).
# Trademarks
* "Eclipse Cyclone DDS" and "Cyclone DDS" are trademarks of the Eclipse Foundation.

View file

@ -36,15 +36,15 @@ build_script:
- mkdir build
- cd build
- conan install -s arch=%ARCH% -s build_type=%CONFIGURATION% ..
- cmake -DBUILD_TESTING=on -DCMAKE_BUILD_TYPE=%CONFIGURATION% -DCMAKE_INSTALL_PREFIX=%CD%/install -G "%GENERATOR%" ../src
- cmake --build . --config %CONFIGURATION% --target install -- /maxcpucount
- cmake -DBUILD_TESTING=on -DWERROR=ON -DCMAKE_BUILD_TYPE=%CONFIGURATION% -DCMAKE_INSTALL_PREFIX=%CD%/install -G "%GENERATOR%" ..
- cmake --build . --config %CONFIGURATION% --target install -- /nologo /verbosity:minimal /maxcpucount /p:CL_MPCount=2
- cd install/share/CycloneDDS/examples/helloworld
- mkdir build
- cd build
- cmake -DCMAKE_BUILD_TYPE=%CONFIGURATION% -G "%GENERATOR%" ..
- cmake --build . --config %CONFIGURATION% -- /maxcpucount
- cmake --build . --config %CONFIGURATION% -- /nologo /verbosity:minimal /maxcpucount /p:CL_MPCount=2
- cd ../../../../../..
test_script:
- set "CYCLONEDDS_URI=<CycloneDDS><DDSI2E><Internal><EnableExpensiveChecks>all</EnableExpensiveChecks></Internal></DDSI2E></CycloneDDS>"
- ctest --test-action test --build-config %CONFIGURATION%
- set "CYCLONEDDS_URI=<CycloneDDS><Domain><Internal><EnableExpensiveChecks>all</EnableExpensiveChecks></Internal><Tracing><Verbosity>config</Verbosity><OutputFile>stderr</OutputFile></Tracing></Domain></CycloneDDS>"
- ctest --output-on-failure --parallel 4 --test-action test --build-config %CONFIGURATION%

View file

@ -28,33 +28,36 @@ typedef struct {
#define CU_TestProxyName(suite, test) \
CU_TestProxy_ ## suite ## _ ## test
#define CU_Init(suite) \
int CU_InitName(suite)(void)
#define CU_InitDecl(suite) \
extern CU_Init(suite)
extern int CU_InitName(suite)(void)
#define CU_Init(suite) \
CU_InitDecl(suite); \
int CU_InitName(suite)(void)
#define CU_Clean(suite) \
int CU_CleanName(suite)(void)
#define CU_CleanDecl(suite) \
extern CU_Clean(suite)
extern int CU_CleanName(suite)(void)
#define CU_Clean(suite) \
CU_CleanDecl(suite); \
int CU_CleanName(suite)(void)
/* CU_Test generates a wrapper function that takes care of per-test
initialization and deinitialization, if provided in the CU_Test
signature. */
#define CU_Test(suite, test, ...) \
static void CU_TestName(suite, test)(void); \
void CU_TestProxyName(suite, test)(void); \
\
void CU_TestProxyName(suite, test)(void) { \
cu_data_t data = CU_Fixture(__VA_ARGS__); \
cu_data_t cu_data = CU_Fixture(__VA_ARGS__); \
\
if (data.init != NULL) { \
data.init(); \
if (cu_data.init != NULL) { \
cu_data.init(); \
} \
\
CU_TestName(suite, test)(); \
\
if (data.fini != NULL) { \
data.fini(); \
if (cu_data.fini != NULL) { \
cu_data.fini(); \
} \
} \
\

View file

@ -44,21 +44,22 @@ extern "C" {
#define CU_Theory(signature, suite, test, ...) \
static void CU_TestName(suite, test) signature; \
void CU_TestProxyName(suite, test)(void); \
\
void CU_TestProxyName(suite, test)(void) { \
cu_data_t data = CU_Fixture(__VA_ARGS__); \
cu_data_t cu_data = CU_Fixture(__VA_ARGS__); \
size_t i, n; \
\
if (data.init != NULL) { \
data.init(); \
if (cu_data.init != NULL) { \
cu_data.init(); \
} \
\
for (i = 0, n = CU_TheoryDataPointsSize(suite, test); i < n; i++) { \
CU_TestName(suite, test) CU_TheoryDataPointsSlice(suite, test, i) ; \
} \
\
if (data.fini != NULL) { \
data.fini(); \
if (cu_data.fini != NULL) { \
cu_data.fini(); \
} \
} \
\

View file

@ -13,12 +13,8 @@
#include <stdlib.h>
#include <string.h>
#ifndef _WIN32
#include <sysexits.h>
#else
#define EX_USAGE (64)
#define EX_SOFTWARE (70)
#endif /* _WIN32 */
#include <CUnit/Basic.h>
#include <CUnit/Automated.h>

View file

@ -11,7 +11,12 @@
#
set(CUNIT_HEADER "CUnit/CUnit.h")
if(CONAN_INCLUDE_DIRS)
find_path(CUNIT_INCLUDE_DIR ${CUNIT_HEADER} HINTS ${CONAN_INCLUDE_DIRS})
else()
find_path(CUNIT_INCLUDE_DIR ${CUNIT_HEADER})
endif()
mark_as_advanced(CUNIT_INCLUDE_DIR)
if(CUNIT_INCLUDE_DIR AND EXISTS "${CUNIT_INCLUDE_DIR}/${CUNIT_HEADER}")
@ -25,7 +30,11 @@ if(CUNIT_INCLUDE_DIR AND EXISTS "${CUNIT_INCLUDE_DIR}/${CUNIT_HEADER}")
set(CUNIT_VERSION "${CUNIT_VERSION_MAJOR}.${CUNIT_VERSION_MINOR}-${CUNIT_VERSION_PATCH}")
endif()
if(CONAN_LIB_DIRS)
find_library(CUNIT_LIBRARY cunit HINTS ${CONAN_LIB_DIRS})
else()
find_library(CUNIT_LIBRARY cunit)
endif()
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(

View file

@ -0,0 +1,331 @@
#
# Copyright(c) 2019 Jeroen Koekkoek
#
# This program and the accompanying materials are made available under the
# terms of the Eclipse Public License v. 2.0 which is available at
# http://www.eclipse.org/legal/epl-2.0, or the Eclipse Distribution License
# v. 1.0 which is available at
# http://www.eclipse.org/org/documents/edl-v10.php.
#
# SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
#
include(FindPackageHandleStandardArgs)
macro(_Sphinx_find_executable _exe)
string(TOUPPER "${_exe}" _uc)
# sphinx-(build|quickstart)-3 x.x.x
# FIXME: This works on Fedora (and probably most other UNIX like targets).
# Windows targets and PIP installs might need some work.
find_program(
SPHINX_${_uc}_EXECUTABLE
NAMES "sphinx-${_exe}-3" "sphinx-${_exe}" "sphinx-${_exe}.exe")
if(SPHINX_${_uc}_EXECUTABLE)
execute_process(
COMMAND "${SPHINX_${_uc}_EXECUTABLE}" --version
RESULT_VARIABLE _result
OUTPUT_VARIABLE _output
OUTPUT_STRIP_TRAILING_WHITESPACE)
if(_result EQUAL 0 AND _output MATCHES " v?([0-9]+\\.[0-9]+\\.[0-9]+)$")
set(SPHINX_${_uc}_VERSION "${CMAKE_MATCH_1}")
endif()
if(NOT TARGET Sphinx::${_exe})
add_executable(Sphinx::${_exe} IMPORTED GLOBAL)
set_target_properties(Sphinx::${_exe} PROPERTIES
IMPORTED_LOCATION "${SPHINX_${_uc}_EXECUTABLE}")
endif()
set(Sphinx_${_exe}_FOUND TRUE)
else()
set(Sphinx_${_exe}_FOUND FALSE)
endif()
unset(_uc)
endmacro()
macro(_Sphinx_find_extension _ext)
if(_SPHINX_PYTHON_EXECUTABLE)
execute_process(
COMMAND ${_SPHINX_PYTHON_EXECUTABLE} -c "import ${_ext}"
RESULT_VARIABLE _result)
if(_result EQUAL 0)
set(Sphinx_${_ext}_FOUND TRUE)
else()
set(Sphinx_${_ext}_FOUND FALSE)
endif()
elseif(CMAKE_HOST_WIN32 AND SPHINX_BUILD_EXECUTABLE)
# script-build on Windows located under (when PIP is used):
# C:/Program Files/PythonXX/Scripts
# C:/Users/username/AppData/Roaming/Python/PythonXX/Sripts
#
# Python modules are installed under:
# C:/Program Files/PythonXX/Lib
# C:/Users/username/AppData/Roaming/Python/PythonXX/site-packages
#
# To verify a given module is installed, use the Python base directory
# and test if either Lib/module.py or site-packages/module.py exists.
get_filename_component(_dirname "${SPHINX_BUILD_EXECUTABLE}" DIRECTORY)
get_filename_component(_dirname "${_dirname}" DIRECTORY)
if(IS_DIRECTORY "${_dirname}/Lib/${_ext}" OR
IS_DIRECTORY "${_dirname}/site-packages/${_ext}")
set(Sphinx_${_ext}_FOUND TRUE)
else()
set(Sphinx_${_ext}_FOUND FALSE)
endif()
endif()
endmacro()
#
# Find sphinx-build and sphinx-quickstart.
#
_Sphinx_find_executable(build)
_Sphinx_find_executable(quickstart)
#
# Verify both executables are part of the Sphinx distribution.
#
if(SPHINX_BUILD_EXECUTABLE AND SPHINX_QUICKSTART_EXECUTABLE)
if(NOT SPHINX_BUILD_VERSION STREQUAL SPHINX_QUICKSTART_VERSION)
message(FATAL_ERROR "Versions for sphinx-build (${SPHINX_BUILD_VERSION}) "
"and sphinx-quickstart (${SPHINX_QUICKSTART_VERSION}) "
"do not match")
endif()
endif()
#
# To verify the required Sphinx extensions are available, the right Python
# installation must be queried (2 vs 3). Of course, this only makes sense on
# UNIX-like systems.
#
if(NOT CMAKE_HOST_WIN32 AND SPHINX_BUILD_EXECUTABLE)
file(READ "${SPHINX_BUILD_EXECUTABLE}" _contents)
if(_contents MATCHES "^#!([^\n]+)")
string(STRIP "${CMAKE_MATCH_1}" _shebang)
if(EXISTS "${_shebang}")
set(_SPHINX_PYTHON_EXECUTABLE "${_shebang}")
endif()
endif()
endif()
foreach(_comp IN LISTS Sphinx_FIND_COMPONENTS)
if(_comp STREQUAL "build")
# Do nothing, sphinx-build is always required.
elseif(_comp STREQUAL "quickstart")
# Do nothing, sphinx-quickstart is optional, but looked up by default.
elseif(_comp STREQUAL "breathe")
_Sphinx_find_extension(${_comp})
else()
message(WARNING "${_comp} is not a valid or supported Sphinx extension")
set(Sphinx_${_comp}_FOUND FALSE)
continue()
endif()
endforeach()
find_package_handle_standard_args(
Sphinx
VERSION_VAR SPHINX_BUILD_VERSION
REQUIRED_VARS SPHINX_BUILD_EXECUTABLE SPHINX_BUILD_VERSION
HANDLE_COMPONENTS)
# Generate a conf.py template file using sphinx-quickstart.
#
# sphinx-quickstart allows for quiet operation and a lot of settings can be
# specified as command line arguments, therefore its not required to parse the
# generated conf.py.
function(_Sphinx_generate_confpy _target _cachedir)
if(NOT TARGET Sphinx::quickstart)
message(FATAL_ERROR "sphinx-quickstart is not available, needed by"
"sphinx_add_docs for target ${_target}")
endif()
if(NOT DEFINED SPHINX_PROJECT)
set(SPHINX_PROJECT ${PROJECT_NAME})
endif()
if(NOT DEFINED SPHINX_AUTHOR)
set(SPHINX_AUTHOR "${SPHINX_PROJECT} committers")
endif()
if(NOT DEFINED SPHINX_COPYRIGHT)
string(TIMESTAMP "%Y, ${SPHINX_AUTHOR}" SPHINX_COPYRIGHT)
endif()
if(NOT DEFINED SPHINX_VERSION)
set(SPHINX_VERSION "${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}")
endif()
if(NOT DEFINED SPHINX_RELEASE)
set(SPHINX_RELEASE "${PROJECT_VERSION}")
endif()
if(NOT DEFINED SPHINX_LANGUAGE)
set(SPHINX_LANGUAGE "en")
endif()
if(NOT DEFINED SPHINX_MASTER)
set(SPHINX_MASTER "index")
endif()
set(_known_exts autodoc doctest intersphinx todo coverage imgmath mathjax
ifconfig viewcode githubpages)
if(DEFINED SPHINX_EXTENSIONS)
foreach(_ext ${SPHINX_EXTENSIONS})
set(_is_known_ext FALSE)
foreach(_known_ext ${_known_exsts})
if(_ext STREQUAL _known_ext)
set(_opts "${opts} --ext-${_ext}")
set(_is_known_ext TRUE)
break()
endif()
endforeach()
if(NOT _is_known_ext)
if(_exts)
set(_exts "${_exts},${_ext}")
else()
set(_exts "${_ext}")
endif()
endif()
endforeach()
endif()
if(_exts)
set(_exts "--extensions=${_exts}")
endif()
set(_templatedir "${CMAKE_CURRENT_BINARY_DIR}/${_target}.template")
file(MAKE_DIRECTORY "${_templatedir}")
execute_process(
COMMAND "${SPHINX_QUICKSTART_EXECUTABLE}"
-q --no-makefile --no-batchfile
-p "${SPHINX_PROJECT}"
-a "${SPHINX_AUTHOR}"
-v "${SPHINX_VERSION}"
-r "${SPHINX_RELEASE}"
-l "${SPHINX_LANGUAGE}"
--master "${SPHINX_MASTER}"
${_opts} ${_exts} "${_templatedir}"
RESULT_VARIABLE _result
OUTPUT_QUIET)
if(_result EQUAL 0 AND EXISTS "${_templatedir}/conf.py")
file(COPY "${_templatedir}/conf.py" DESTINATION "${_cachedir}")
endif()
file(REMOVE_RECURSE "${_templatedir}")
if(NOT _result EQUAL 0 OR NOT EXISTS "${_cachedir}/conf.py")
message(FATAL_ERROR "Sphinx configuration file not generated for "
"target ${_target}")
endif()
endfunction()
function(sphinx_add_docs _target)
set(_opts)
set(_single_opts BUILDER OUTPUT_DIRECTORY SOURCE_DIRECTORY)
set(_multi_opts BREATHE_PROJECTS)
cmake_parse_arguments(_args "${_opts}" "${_single_opts}" "${_multi_opts}" ${ARGN})
unset(SPHINX_BREATHE_PROJECTS)
if(NOT _args_BUILDER)
message(FATAL_ERROR "Sphinx builder not specified for target ${_target}")
elseif(NOT _args_SOURCE_DIRECTORY)
message(FATAL_ERROR "Sphinx source directory not specified for target ${_target}")
else()
if(NOT IS_ABSOLUTE "${_args_SOURCE_DIRECTORY}")
get_filename_component(_sourcedir "${_args_SOURCE_DIRECTORY}" ABSOLUTE)
else()
set(_sourcedir "${_args_SOURCE_DIRECTORY}")
endif()
if(NOT IS_DIRECTORY "${_sourcedir}")
message(FATAL_ERROR "Sphinx source directory '${_sourcedir}' for"
"target ${_target} does not exist")
endif()
endif()
set(_builder "${_args_BUILDER}")
if(_args_OUTPUT_DIRECTORY)
set(_outputdir "${_args_OUTPUT_DIRECTORY}")
else()
set(_outputdir "${CMAKE_CURRENT_BINARY_DIR}/${_target}")
endif()
if(_args_BREATHE_PROJECTS)
if(NOT Sphinx_breathe_FOUND)
message(FATAL_ERROR "Sphinx extension 'breathe' is not available. Needed"
"by sphinx_add_docs for target ${_target}")
endif()
list(APPEND SPHINX_EXTENSIONS breathe)
foreach(_doxygen_target ${_args_BREATHE_PROJECTS})
if(TARGET ${_doxygen_target})
list(APPEND _depends ${_doxygen_target})
# Doxygen targets are supported. Verify that a Doxyfile exists.
get_target_property(_dir ${_doxygen_target} BINARY_DIR)
set(_doxyfile "${_dir}/Doxyfile.${_doxygen_target}")
if(NOT EXISTS "${_doxyfile}")
message(FATAL_ERROR "Target ${_doxygen_target} is not a Doxygen"
"target, needed by sphinx_add_docs for target"
"${_target}")
endif()
# Read the Doxyfile, verify XML generation is enabled and retrieve the
# output directory.
file(READ "${_doxyfile}" _contents)
if(NOT _contents MATCHES "GENERATE_XML *= *YES")
message(FATAL_ERROR "Doxygen target ${_doxygen_target} does not"
"generate XML, needed by sphinx_add_docs for"
"target ${_target}")
elseif(_contents MATCHES "OUTPUT_DIRECTORY *= *([^ ][^\n]*)")
string(STRIP "${CMAKE_MATCH_1}" _dir)
set(_name "${_doxygen_target}")
set(_dir "${_dir}/xml")
else()
message(FATAL_ERROR "Cannot parse Doxyfile generated by Doxygen"
"target ${_doxygen_target}, needed by"
"sphinx_add_docs for target ${_target}")
endif()
elseif(_doxygen_target MATCHES "([^: ]+) *: *(.*)")
set(_name "${CMAKE_MATCH_1}")
string(STRIP "${CMAKE_MATCH_2}" _dir)
endif()
if(_name AND _dir)
if(_breathe_projects)
set(_breathe_projects "${_breathe_projects}, \"${_name}\": \"${_dir}\"")
else()
set(_breathe_projects "\"${_name}\": \"${_dir}\"")
endif()
if(NOT _breathe_default_project)
set(_breathe_default_project "${_name}")
endif()
endif()
endforeach()
endif()
set(_cachedir "${CMAKE_CURRENT_BINARY_DIR}/${_target}.cache")
file(MAKE_DIRECTORY "${_cachedir}")
file(MAKE_DIRECTORY "${_cachedir}/_static")
_Sphinx_generate_confpy(${_target} "${_cachedir}")
if(_breathe_projects)
file(APPEND "${_cachedir}/conf.py"
"\nbreathe_projects = { ${_breathe_projects} }"
"\nbreathe_default_project = '${_breathe_default_project}'")
endif()
add_custom_target(
${_target}
COMMAND ${SPHINX_BUILD_EXECUTABLE}
-b ${_builder}
-d "${CMAKE_CURRENT_BINARY_DIR}/${_target}.cache/_doctrees"
-c "${CMAKE_CURRENT_BINARY_DIR}/${_target}.cache"
"${_sourcedir}"
"${_outputdir}"
DEPENDS ${_depends})
endfunction()

View file

@ -0,0 +1,51 @@
# Copyright(c) 2006 to 2018 ADLINK Technology Limited and others
#
# This program and the accompanying materials are made available under the
# terms of the Eclipse Public License v. 2.0 which is available at
# http://www.eclipse.org/legal/epl-2.0, or the Eclipse Distribution License
# v. 1.0 which is available at
# http://www.eclipse.org/org/documents/edl-v10.php.
#
# SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
function(GENERATE_DUMMY_EXPORT_HEADER _target)
set(_opts)
set(_single_opts BASE_NAME EXPORT_FILE_NAME)
set(_multi_opts)
cmake_parse_arguments(_args "${_opts}" "${_single_opts}" "${_multi_opts}" ${ARGN})
if(NOT _target)
message(FATAL_ERROR "Target not specified")
elseif(NOT TARGET ${_target})
message(FATAL_ERROR "Target ${_target} does not exist")
endif()
string(TOUPPER _target_uc "${_target}")
string(TOLOWER _target_lc "${_target}")
if(_args_EXPORT_FILE_NAME)
set(_path "${_args_EXPORT_FILE_NAME}")
else()
set(_path "${CMAKE_CURRENT_BINARY_DIR}/${_target_lc}_export.h")
endif()
if(_args_BASE_NAME)
string(TOUPPER "${_args_BASE_NAME}" _base_name)
else()
set(_base_name "${_target_uc}")
endif()
get_filename_component(_dir "${_path}" DIRECTORY)
get_filename_component(_file "${_path}" NAME)
if(NOT IS_DIRECTORY "${_dir}")
file(MAKE_DIRECTORY "${_dir}")
endif()
set(_content
"/* Dummy export header generated by CMake. */
#define ${_base_name}_EXPORT\n")
file(WRITE "${_path}" "${_content}")
endfunction()

View file

@ -17,14 +17,21 @@ set(PACKAGING_INCLUDED true)
include(CMakePackageConfigHelpers)
include(GNUInstallDirs)
set(PACKAGING_MODULE_DIR "${PROJECT_SOURCE_DIR}/cmake/modules/Packaging")
set(PACKAGING_MODULE_DIR "${PROJECT_SOURCE_DIR}/cmake/Modules/Packaging")
set(CMAKE_INSTALL_CMAKEDIR "${CMAKE_INSTALL_DATADIR}/${CMAKE_PROJECT_NAME}")
# Generates <Package>Config.cmake.
if(BUILD_IDLC)
configure_package_config_file(
"${PACKAGING_MODULE_DIR}/PackageConfig.cmake.in"
"${CMAKE_PROJECT_NAME}Config.cmake"
INSTALL_DESTINATION "${CMAKE_INSTALL_CMAKEDIR}")
else()
configure_package_config_file(
"${PACKAGING_MODULE_DIR}/PackageConfigNoIdlc.cmake.in"
"${CMAKE_PROJECT_NAME}Config.cmake"
INSTALL_DESTINATION "${CMAKE_INSTALL_CMAKEDIR}")
endif()
# Generates <Package>Version.cmake.
write_basic_package_version_file(
@ -37,7 +44,7 @@ install(
"${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_PROJECT_NAME}Version.cmake"
DESTINATION "${CMAKE_INSTALL_CMAKEDIR}" COMPONENT dev)
if(DDSC_SHARED AND ((NOT DEFINED BUILD_SHARED_LIBS) OR BUILD_SHARED_LIBS))
if((NOT DEFINED BUILD_SHARED_LIBS) OR BUILD_SHARED_LIBS)
# Generates <Package>Targets.cmake file included by <Package>Config.cmake.
# The files are placed in CMakeFiles/Export in the build tree.
install(
@ -54,15 +61,13 @@ set(CPACK_PACKAGE_VERSION_PATCH ${PROJECT_VERSION_PATCH})
set(CPACK_PACKAGE_VERSION_TWEAK ${PROJECT_VERSION_TWEAK})
set(CPACK_PACKAGE_VERSION ${PROJECT_VERSION})
set(VENDOR_INSTALL_ROOT "ADLINK")
set(CPACK_PACKAGE_NAME ${CMAKE_PROJECT_NAME})
set(CPACK_PACKAGE_VENDOR "ADLINK Technology Inc.")
set(CPACK_PACKAGE_CONTACT "${CMAKE_PROJECT_NAME} core developers <info@adlinktech.com>")
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Leading OMG DDS implementation from ADLINK Technology")
set(CPACK_PACKAGE_ICON "${PACKAGING_MODULE_DIR}/vortex.ico")
set(CPACK_PACKAGE_VENDOR "Eclipse Cyclone DDS project")
set(CPACK_PACKAGE_CONTACT "https://github.com/eclipse-cyclonedds/cyclonedds")
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Implementation of the OMG DDS standard")
# WiX requires a .txt file extension for CPACK_RESOURCE_FILE_LICENSE
file(COPY "${PROJECT_SOURCE_DIR}/../LICENSE" DESTINATION "${CMAKE_BINARY_DIR}")
file(COPY "${PROJECT_SOURCE_DIR}/LICENSE" DESTINATION "${CMAKE_BINARY_DIR}")
file(RENAME "${CMAKE_BINARY_DIR}/LICENSE" "${CMAKE_BINARY_DIR}/license.txt")
set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_BINARY_DIR}/license.txt")
@ -95,24 +100,7 @@ if(WIN32 AND NOT UNIX)
set(CPACK_GENERATOR "WIX;ZIP;${CPACK_GENERATOR}" CACHE STRING "List of package generators")
set(CPACK_PACKAGE_FILE_NAME "${CMAKE_PROJECT_NAME}-${CPACK_PACKAGE_VERSION}-${__arch}")
set(CPACK_PACKAGE_INSTALL_DIRECTORY "${VENDOR_INSTALL_ROOT}/${CMAKE_PROJECT_NAME_FULL}")
set(CPACK_WIX_LIGHT_EXTENSIONS "WixUtilExtension")
set(CPACK_WIX_COMPONENT_INSTALL ON)
set(CPACK_WIX_ROOT_FEATURE_TITLE "${CMAKE_PROJECT_NAME_FULL}")
set(CPACK_WIX_PRODUCT_ICON "${PACKAGING_MODULE_DIR}/vortex.ico")
# Bitmap (.bmp) of size 493x58px
set(CPACK_WIX_UI_BANNER "${PACKAGING_MODULE_DIR}/banner.bmp")
# Bitmap (.bmp) of size 493x312px
set(CPACK_WIX_UI_DIALOG "${PACKAGING_MODULE_DIR}/dialog.png")
set(CPACK_WIX_PROGRAM_MENU_FOLDER "${CPACK_PACKAGE_NAME_FULL}")
set(CPACK_WIX_PATCH_FILE "${PACKAGING_MODULE_DIR}/examples.xml")
set(CPACK_WIX_PROPERTY_ARPHELPLINK "http://www.adlinktech.com/support")
set(CPACK_WIX_PROPERTY_ARPURLINFOABOUT "http://www.adlinktech.com/")
set(CPACK_WIX_PROPERTY_ARPURLUPDATEINFO "http://www.adlinktech.com/")
# A constant GUID allows installers to replace existing installations that use the same GUID.
set(CPACK_WIX_UPGRADE_GUID "1351F59A-972B-4624-A7F1-439381BFA41D")
set(CPACK_PACKAGE_INSTALL_DIRECTORY "${CMAKE_PROJECT_NAME_FULL}")
include(InstallRequiredSystemLibraries)
elseif(CMAKE_SYSTEM_NAME MATCHES "Linux")
@ -159,10 +147,9 @@ elseif(CMAKE_SYSTEM_NAME MATCHES "Linux")
# Generic tgz package
set(CPACK_GENERATOR "TGZ;${CPACK_GENERATOR}" CACHE STRING "List of package generators")
endif()
elseif(CMAKE_SYSTEM_NAME MATCHES "VxWorks")
# FIXME: Support for VxWorks packages must still be implemented (probably
# just a compressed tarball)
message(STATUS "Packaging for VxWorks is unsupported")
else()
# Fallback to zip package
set(CPACK_GENERATOR "ZIP;${CPACK_GENERATOR}" CACHE STRING "List of package generators")
endif()
# This must always be last!

View file

@ -13,4 +13,3 @@
include("${CMAKE_CURRENT_LIST_DIR}/@CMAKE_PROJECT_NAME@Targets.cmake")
include("${CMAKE_CURRENT_LIST_DIR}/idlc/IdlcGenerate.cmake")

View file

@ -9,12 +9,6 @@
#
# SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
#
configure_file("cmake/default.xml.in" "${CMAKE_PROJECT_NAME_SMALL}.xml" @ONLY)
@PACKAGE_INIT@
set(CONFIG_FILES "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_PROJECT_NAME_SMALL}.xml")
install(
FILES ${CONFIG_FILES}
DESTINATION "${CMAKE_INSTALL_SYSCONFDIR}/${CMAKE_PROJECT_NAME}"
COMPONENT lib
)
include("${CMAKE_CURRENT_LIST_DIR}/@CMAKE_PROJECT_NAME@Targets.cmake")

3
colcon.pkg Normal file
View file

@ -0,0 +1,3 @@
{
"name": "cyclonedds"
}

View file

@ -1,5 +1,5 @@
#
# Copyright(c) 2006 to 2018 ADLINK Technology Limited and others
# Copyright(c) 2006 to 2019 ADLINK Technology Limited and others
#
# This program and the accompanying materials are made available under the
# terms of the Eclipse Public License v. 2.0 which is available at
@ -8,14 +8,5 @@
# http://www.eclipse.org/org/documents/edl-v10.php.
#
# SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
#
if(CMAKE_SYSTEM_NAME MATCHES "Linux")
configure_file(
"cmake/vdds_install_examples.in" "vdds_install_examples" @ONLY)
install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/vdds_install_examples
DESTINATION "${CMAKE_INSTALL_BINDIR}"
COMPONENT dev)
endif()
add_subdirectory(manual)

View file

Before

Width:  |  Height:  |  Size: 49 KiB

After

Width:  |  Height:  |  Size: 49 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 59 KiB

After

Width:  |  Height:  |  Size: 59 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 43 KiB

After

Width:  |  Height:  |  Size: 43 KiB

Before After
Before After

103
docs/dev/freertos.md Normal file
View file

@ -0,0 +1,103 @@
# FreeRTOS
[FreeRTOS][1] is real-time operating system kernel for embedded devices. Think
of it as a thread library rather than a general purpose operating system like
Linux or Microsoft Windows. Out-of-the-box, FreeRTOS provides support for
tasks (threads), mutexes, semaphores and software times. Third-party modules
are available to add features. e.g. [lwIP][2] can be used to add networking.
> FreeRTOS+lwIP is currently supported by Eclipse Cyclone DDS. Support for other
> network stacks, e.g. [FreeRTOS+TCP][3], may be added in the future.
> Eclipse Cyclone DDS does not make use of [FreeRTOS+POSIX][4] because it was
> not available at the time. Future versions of Eclipse Cyclone DDS may or may
> not require FreeRTOS+POSIX for compatibility when it becomes stable.
[1]: https://www.freertos.org/
[2]: https://savannah.nongnu.org/projects/lwip/
[3]: https://www.freertos.org/FreeRTOS-Plus/FreeRTOS_Plus_TCP/index.html
[4]: https://www.freertos.org/FreeRTOS-Plus/FreeRTOS_Plus_POSIX/index.html
## Target
FreeRTOS provides an operating system kernel. Batteries are not included. i.e.
no C library or device drivers. Third-party distributions, known as board
support packages (BSP), for various (hardware) platforms are available though.
Board support packages, apart from FreeRTOS, contain:
* C library. Often ships with the compiler toolchain, e.g.
[IAR Embedded Workbench][5] includes the DLIB runtime, but open source
libraries can also be used. e.g. The [Xilinx Software Development Kit][6]
includes newlib.
* Device drivers. Generally available from the hardware vendor, e.g. NXP or
Xilinx. Device drivers for extra components, like a real-time clock, must
also be included in the board support package.
[5]: https://www.iar.com/iar-embedded-workbench/
[6]: https://www.xilinx.com/products/design-tools/embedded-software/sdk.html
A board support package is linked with the application by the toolchain to
generate a binary that can be flashed to the target.
### Requirements
Eclipse Cyclone DDS requires certain compile-time options to be enabled in
FreeRTOS (`FreeRTOSConfig.h`) and lwIP (`lwipopts.h`) for correct operation.
The compiler will croak when a required compile-time option is not enabled.
Apart from the aforementioned compile-time options, the target and toolchain
must provide the following.
* Support for thread-local storage (TLS) from the compiler and linker.
* Berkeley socket API compatible socket interface.
* Real-time clock (RTC). A high-precision real-time clock is preferred, but
the monotonic clock can be combined with an offset obtained from e.g. the
network if the target lacks an actual real-time clock. A proper
`clock_gettime` implementation is required to retrieve the wall clock time.
### Thread-local storage
FreeRTOS tasks are not threads and compiler supported thread-local storage
(tls) might not work as desired/expected under FreeRTOS on embedded targets.
i.e. the address of a given variable defined with *__thread* may be the same
for different tasks.
The compiler generates code to retrieve a unique address per thread when it
encounters a variable defined with *__thread*. What code it generates depends
on the compiler and the target it generates the code for. e.g. `iccarm.exe`
that comes with IAR Embedded Workbench requires `__aeabi_read_tp` to be
implemented and `mb-gcc` that comes with the Xilinx SDK requires
`__tls_get_addr` to be implemented.
The implementation for each of these functions is more-or-less the same.
Generally speaking they require the number of bytes to allocate, call
`pvTaskGetThreadLocalStoragePointer` and return the address of the memory
block to the caller.
## Simulator
FreeRTOS ports for Windows and POSIX exist to test compatibility. How to
cross-compile Eclipse Cyclone DDS for the [FreeRTOS Windows Port][7] or
the unofficial [FreeRTOS POSIX Port][8] can be found in the msvc and
[posix](/ports/freertos-posix) port directories.
[7]: https://www.freertos.org/FreeRTOS-Windows-Simulator-Emulator-for-Visual-Studio-and-Eclipse-MingW.html
[8]: https://github.com/shlinym/FreeRTOS-Sim.git
## Known Limitations
Triggering the socket waitset is not (yet) implemented for FreeRTOS+lwIP. This
introduces issues in scenarios where it is required.
* Receive threads require a trigger to shutdown or a thread may block
indefinitely if no packet arrives from the network.
* Sockets are created dynamically if ManySocketsMode is used and a participant
is created, or TCP is used. A trigger is issued after the sockets are added
to the set if I/O multiplexing logic does not automatically wait for data
on the newly created sockets as well.

View file

@ -0,0 +1,23 @@
#
# Copyright(c) 2006 to 2019 ADLINK Technology Limited and others
#
# This program and the accompanying materials are made available under the
# terms of the Eclipse Public License v. 2.0 which is available at
# http://www.eclipse.org/legal/epl-2.0, or the Eclipse Distribution License
# v. 1.0 which is available at
# http://www.eclipse.org/org/documents/edl-v10.php.
#
# SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
if(BUILD_DOCS)
find_package(Sphinx REQUIRED breathe)
sphinx_add_docs(
docs
BREATHE_PROJECTS ddsc_api_docs
BUILDER html
SOURCE_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}")
install(
DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/docs/"
DESTINATION "${CMAKE_INSTALL_DOCDIR}/manual"
COMPONENT dev)
endif()

View file

@ -195,7 +195,7 @@ example. Apart from the native build files, CMake build files
are provided as well. See
:code:`examples/helloworld/CMakeLists.txt`
.. literalinclude:: ../../examples/helloworld/CMakeLists.export
.. literalinclude:: ../../../examples/helloworld/CMakeLists.export
:linenos:
:language: cmake

View file

@ -77,7 +77,7 @@ There are a few ways to describe the structures that make up the
data layer. The HelloWorld uses the IDL language to describe the
data type in HelloWorldData.idl:
.. literalinclude:: ../../examples/helloworld/HelloWorldData.idl
.. literalinclude:: ../../../examples/helloworld/HelloWorldData.idl
:linenos:
:language: idl
@ -202,7 +202,7 @@ business logic.
Subscriber.c contains the source that will wait for a *Hello World!*
message and reads it when it receives one.
.. literalinclude:: ../../examples/helloworld/subscriber.c
.. literalinclude:: ../../../examples/helloworld/subscriber.c
:linenos:
:language: c
@ -331,7 +331,7 @@ automatically delete the topic and reader as well.
Publisher.c contains the source that will write an *Hello World!* message
on which the subscriber is waiting.
.. literalinclude:: ../../examples/helloworld/publisher.c
.. literalinclude:: ../../../examples/helloworld/publisher.c
:linenos:
:language: c

View file

Before

Width:  |  Height:  |  Size: 54 KiB

After

Width:  |  Height:  |  Size: 54 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 13 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 13 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 13 KiB

Before After
Before After

View file

@ -13,4 +13,4 @@ Eclipse Cyclone DDS C API Reference
===================================
.. doxygenindex::
:project: ddsc_api
:project: ddsc_api_docs

29
examples/CMakeLists.txt Normal file
View file

@ -0,0 +1,29 @@
#
# Copyright(c) 2006 to 2018 ADLINK Technology Limited and others
#
# This program and the accompanying materials are made available under the
# terms of the Eclipse Public License v. 2.0 which is available at
# http://www.eclipse.org/legal/epl-2.0, or the Eclipse Distribution License
# v. 1.0 which is available at
# http://www.eclipse.org/org/documents/edl-v10.php.
#
# SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
#
set(CMAKE_INSTALL_EXAMPLESDIR "${CMAKE_INSTALL_DATADIR}/${CMAKE_PROJECT_NAME}/examples")
add_subdirectory(helloworld)
add_subdirectory(roundtrip)
add_subdirectory(throughput)
if (BUILD_DOCS)
find_package(Sphinx REQUIRED)
sphinx_add_docs(
examples_docs
BUILDER html
SOURCE_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}")
install(
DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/examples_docs/"
DESTINATION "${CMAKE_INSTALL_EXAMPLESDIR}"
COMPONENT dev
PATTERN "_sources" EXCLUDE)
endif()

View file

@ -0,0 +1,33 @@
#
# Copyright(c) 2006 to 2018 ADLINK Technology Limited and others
#
# This program and the accompanying materials are made available under the
# terms of the Eclipse Public License v. 2.0 which is available at
# http://www.eclipse.org/legal/epl-2.0, or the Eclipse Distribution License
# v. 1.0 which is available at
# http://www.eclipse.org/org/documents/edl-v10.php.
#
# SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
#
idlc_generate(HelloWorldData_lib "HelloWorldData.idl")
add_executable(HelloworldPublisher publisher.c)
add_executable(HelloworldSubscriber subscriber.c)
target_link_libraries(HelloworldPublisher HelloWorldData_lib CycloneDDS::ddsc)
target_link_libraries(HelloworldSubscriber HelloWorldData_lib CycloneDDS::ddsc)
install(
FILES
"HelloWorldData.idl"
"publisher.c"
"subscriber.c"
DESTINATION "${CMAKE_INSTALL_EXAMPLESDIR}/helloworld"
COMPONENT dev)
install(
FILES "CMakeLists.export"
RENAME "CMakeLists.txt"
DESTINATION "${CMAKE_INSTALL_EXAMPLESDIR}/helloworld"
COMPONENT dev)

153
examples/perfscript/latency-test Executable file
View file

@ -0,0 +1,153 @@
#!/bin/bash
export nwif=eth0
bandwidth=1e9
remotedir="$PWD"
provision=false
asynclist="sync async"
modelist="listener waitset"
sizelist="0 20 50 100 200 500 1000 2000 5000 10000 20000 50000 100000 200000 500000 1000000"
timeout=30
loopback=true
resultdir="latency-result"
usage () {
cat >&2 <<EOF
usage: $0 [OPTIONS] user@remote [user@remote...]
OPTIONS
-i IF use network interface IF (default: $nwif)
-b 100|1000|B network bandwidth (100Mbps/1000Gbps or B bits/sec) for
calculating load % given load in bytes/second (default: 1000)
-d DIR use DIR on remote (default: PWD)
-p provision required binaries in DIR (default: $provision)
first ssh's in to try mkdir -p DIR, then follows up with scp
-t DUR run for DUR seconds per size (default $timeout)
-a ASYNCLIST run for delivery async settings ASYNCLIST (default:
"$asynclist")
-m MODELIST run with subscriber mode settings MODELIST (default:
"$modelist")
-s SIZELIST run for sizes in SIZELIST (default: "$sizelist")
if SIZELIST is empty, it uses ddsperf's OU topic instead
-l LOOPBACK enable/disable multicast loopback (true/false, default: $loopback)
-o DIR store results in dir (default: $resultdir)
Local host runs ddsperf in ping mode, remotes run pong. It assumes these are
available in DIR/bin. It also assumes that ssh user@remote works without
requiring a password.
EOF
exit 1
}
while getopts "i:d:pa:m:s:t:o:l:" opt ; do
case $opt in
i) nwif="$OPTARG" ;;
b) case "$OPTARG" in
100) bandwidth=1e8 ;;
1000) bandwidth=1e9 ;;
*) bandwidth="$OPTARG" ;;
esac ;;
d) remotedir="$OPTARG" ;;
p) provision=true ;;
a) asynclist="$OPTARG" ;;
m) modelist="$OPTARG" ;;
s) sizelist="$OPTARG" ;;
l) loopback="OPTARG" ;;
t) timeout="$OPTARG" ;;
o) resultdir="$OPTARG" ;;
h) usage ;;
esac
done
shift $((OPTIND-1))
if [ $# -lt 1 ] ; then usage ; fi
cfg=cdds-simple.xml
cat >$cfg <<EOF
<CycloneDDS>
<Domain>
<Id>17</Id>
</Domain>
<General>
<NetworkInterfaceAddress>$nwif</NetworkInterfaceAddress>
<EnableMulticastLoopback>$loopback</EnableMulticastLoopback>
<MaxMessageSize>65500B</MaxMessageSize>
<FragmentSize>4000B</FragmentSize>
</General>
<Internal>
<Watermarks>
<WhcHigh>500kB</WhcHigh>
</Watermarks>
<SynchronousDeliveryPriorityThreshold>\${async:-0}</SynchronousDeliveryPriorityThreshold>
<LeaseDuration>3s</LeaseDuration>
</Internal>
<Tracing>
<Verbosity>config</Verbosity>
</Tracing>
</CycloneDDS>
EOF
if [ ! -x bin/ddsperf ] ; then
echo "bin/ddsperf not found on the local machine" >&2
exit 1
fi
[ -d $resultdir ] || { echo "output directory $resultdir doesn't exist" >&2 ; exit 1 ; }
if $provision ; then
echo "provisioning ..."
for r in $pubremote "$@" ; do
ssh $r mkdir -p $remotedir $remotedir/bin $remotedir/lib
scp lib/libddsc.so.0 $r:$remotedir/lib
scp bin/ddsperf $r:$remotedir/bin
done
fi
topic=KS
[ -z "$sizelist" ] && topic=OU
export CYCLONEDDS_URI=file://$PWD/$cfg
for r in "$@" ; do
scp $cfg $r:$remotedir || { echo "failed to copy $cfg to $remote:$PWD" >&2 ; exit 1 ; }
done
for async_mode in $asynclist ; do
case "$async_mode" in
sync) async=0 ;;
async) async=1 ;;
*) echo "$async_mode: invalid setting for ASYNC" >&2 ; continue ;;
esac
export async
for sub_mode in $modelist ; do
echo "======== ASYNC $async MODE $sub_mode ========="
cat > run-pong.tmp <<EOF
export CYCLONEDDS_URI=file://$remotedir/$cfg
export async=$async
cd $remotedir
nohup bin/ddsperf -T $topic pong $sub_mode > /dev/null &
echo \$!
EOF
killpongs=""
for r in "$@" ; do
scp run-pong.tmp $r:$remotedir
rpongpid=`ssh $r ". $remotedir/run-pong.tmp"`
killpongs="$killpongs ssh $r kill -9 $rpongpid &"
done
outdir=$resultdir/$async_mode-$sub_mode
mkdir $outdir
touch $outdir/ping.log
tail -f $outdir/ping.log & xpid=$!
for size in ${sizelist:-0} ; do
echo "size $size"
bin/ddsperf -d $nwif:$bandwidth -c -D $timeout -T $topic ping size $size $sub_mode >> $outdir/ping.log
sleep 5
done
eval $killpongs
sleep 1
kill $xpid
wait
done
done

View file

@ -0,0 +1,95 @@
#!/usr/bin/perl -w
# Note: this is specialized for async delivery, listener mode because of the way it deals with
# thread names
use strict;
my %res = ();
my %meas;
while (<>) {
next unless s/^\[\d+\] \d+\.\d+\s+//;
if (s/^[^\@:]+:\d+\s+size (\d+) //) {
# size is always the first line of an output block
# ddsperf doesn't print CPU loads, RSS, bandwidth if it is zero
my %tmp = %meas;
push @{$res{$meas{size}}}, \%tmp if %meas;
%meas = (size => $1,
rawxmitbw => 0, rawrecvbw => 0,
subrss => 0, pubrss => 0,
subcpu => 0, subrecv => 0,
pubcpu => 0, pubrecv => 0);
$meas{$1} = $2 while s/^(mean|min|max|\d+%)\s+(\d+\.\d+)us\s*//;
die unless /cnt \d+$/;
} elsif (s/^(\@[^:]+:\d+\s+)?rss:(\d+\.\d+)([kM])B//) {
my $side = defined $1 ? "pub" : "sub";
$meas{"${side}rss"} = $2 / ($3 eq "k" ? 1024.0 : 1);
$meas{"${side}cpu"} = cpuload (($side eq "pub") ? "pub" : "dq.user", $_);
$meas{"${side}recv"} = cpuload ("recvUC", $_);
} elsif (/xmit\s+(\d+)%\s+recv\s+(\d+)%/) {
$meas{rawxmitbw} = $1;
$meas{rawrecvbw} = $2;
}
}
push @{$res{$meas{size}}}, \%meas if %meas;
die "no data found" unless keys %res > 0;
print "#size mean min 50% 90% 99% max rawxmitbw rawrecvbw pubrss subrss pubcpu pubrecv subcpu subrecv\n";
my @sizes = sort { $a <=> $b } keys %res;
for my $sz (@sizes) {
my $ms = $res{$sz};
my $min = min ("min", $ms);
my $max = max ("max", $ms);
my $mean = mean ("mean", $ms); # roughly same number of roundtrips, so not too far off
my $median = max ("50%", $ms); # also not quite correct ...
my $p90 = max ("90%", $ms);
my $p99 = max ("99%", $ms);
my $rawxmitbw = median ("rawxmitbw", $ms);
my $rawrecvbw = median ("rawrecvbw", $ms);
my $pubrss = max ("pubrss", $ms);
my $subrss = max ("subrss", $ms);
my $pubcpu = median ("pubcpu", $ms);
my $pubrecv = median ("pubrecv", $ms);
my $subcpu = median ("subcpu", $ms);
my $subrecv = median ("subrecv", $ms);
print "$sz $mean $min $median $p90 $p99 $max $rawxmitbw $rawrecvbw $pubrss $subrss $pubcpu $pubrecv $subcpu $subrecv\n";
}
sub cpuload {
my ($thread, $line) = @_;
$thread =~ s/\./\\./g;
if ($line =~ /$thread:(\d+)%\+(\d+)%/) {
return $1+$2;
} else {
return 0;
}
}
sub max {
my $v;
for (extract (@_)) { $v = $_ unless defined $v; $v = $_ if $_ > $v; }
return $v;
}
sub min {
my $v;
for (extract (@_)) { $v = $_ unless defined $v; $v = $_ if $_ < $v; }
return $v;
}
sub mean {
my $v = 0;
my @xs = extract (@_);
$v += $_ for @xs;
return $v / @xs;
}
sub median {
my @xs = sort { $a <=> $b } (extract (@_));
return (@xs % 2) ? $xs[(@xs - 1) / 2] : ($xs[@xs/2 - 1] + $xs[@xs/2]) / 2;
}
sub extract {
my ($key, $msref) = @_;
return map { $_->{$key} } @$msref;
}

View file

@ -0,0 +1,46 @@
#!/bin/bash
`dirname $0`/latency-test-extract "$@" > data.txt
gnuplot <<\EOF
set term pngcairo size 1024,768
set output "latency-sync-listener.png"
set st d lp
set st li 1 lw 2
set st li 2 lw 2
set st li 3 lw 2
set st li 4 lw 2
set st li 5 lw 2
set multiplot
set logscale xy
set title "Latency"
set ylabel "[us]"
set grid xtics ytics mytics
set xlabel "payload size [bytes]"
p "data.txt" u 1:3 ti "min", "" u 1:4 ti "median", "" u 1:5 ti "90%", "" u 1:6 ti "99%", "" u 1:7 ti "max"
unset logscale y
unset xlabel
unset ylabel
unset title
set grid nomytics
set origin .1, .43
set size .55, .5
clear
p [10:1000] "data.txt" u 1:3 ti "min", "" u 1:4 ti "median", "" u 1:5 ti "90%", "" u 1:6 ti "99%", "" u 1:7 ti "max"
unset multiplot
unset origin
unset size
unset logscale
set logscale x
set output "latency-sync-listener-bwcpu.png"
set title "Latency: network bandwidth and CPU usage"
set y2tics
set ylabel "[Mbps]"
set y2label "CPU [%]"
set xlabel "payload size [bytes]"
set key at graph 1, 0.7
p "data.txt" u 1:(10*$8) ti "GbE transmit bandwidth (left)", "" u 1:(10*$9) ti "GbE receive bandwidth (left)", "" u 1:13 axes x1y2 ti "ping CPU (right)", "" u 1:15 axes x1y2 ti "pong CPU (right)"
EOF

View file

@ -0,0 +1,30 @@
export CYCLONEDDS_URI='<Internal><MinimumSocketReceiveBufferSize>250kB</></><General><MaxMessageSize>65500B</><FragmentSize>65000B</>'
set -x
gen/ddsperf -D20 -L ping pon
for x in 16 32 64 128 1024 4096 16384 ; do
gen/ddsperf -D20 -TKS -z$x -L ping pong
done
gen/ddsperf -D20 -L pub sub
for x in 16 32 64 128 1024 4096 16384 ; do
gen/ddsperf -D20 -TKS -z$x -L pub sub
done
gen/ddsperf pong & pid=$!
gen/ddsperf -D20 ping
kill $pid
wait
gen/ddsperf -TKS pong & pid=$!
for x in 16 32 64 128 1024 4096 16384 ; do
gen/ddsperf -D20 -TKS -z$x ping
done
kill $pid
wait
gen/ddsperf sub & pid=$!
gen/ddsperf -D20 pub
kill $pid
wait
gen/ddsperf -TKS sub & pid=$!
for x in 16 32 64 128 1024 4096 16384 ; do
gen/ddsperf -D20 -TKS -z$x pub
done
kill $pid
wait

View file

@ -0,0 +1,167 @@
#!/bin/bash
export nwif=eth0
bandwidth=1e9
remotedir="$PWD"
provision=false
asynclist="sync async"
modelist="listener polling waitset"
sizelist="0 20 50 100 200 500 1000 2000 5000 10000 20000 50000 100000 200000 500000 1000000"
timeout=30
loopback=true
resultdir="throughput-result"
usage () {
cat >&2 <<EOF
usage: $0 [OPTIONS] user@remote [user@remote...]
OPTIONS
-i IF use network interface IF (default: $nwif)
-b 100|1000|B network bandwidth (100Mbps/1000Gbps or B bits/sec) for
calculating load % given load in bytes/second (default: 1000)
-d DIR use DIR on remote (default: PWD)
-p provision required binaries in DIR (default: $provision)
first ssh's in to try mkdir -p DIR, then follows up with scp
-t DUR run for DUR seconds per size (default $timeout)
-a ASYNCLIST run for delivery async settings ASYNCLIST (default:
"$asynclist")
-m MODELIST run with subscriber mode settings MODELIST (default:
"$modelist")
-s SIZELIST run for sizes in SIZELIST (default: "$sizelist")
if SIZELIST is empty, it uses ddsperf's OU topic instead
-l LOOPBACK enable/disable multicast loopback (true/false, default: $loopback)
-o DIR store results in dir (default: $resultdir)
Local host runs "ddsperf" in subscriber mode, first remote runs it publisher
mode, further remotes also run subcribers. It assumes these are available in
DIR/bin. It also assumes that ssh user@remote works without requiring a
password.
EOF
exit 1
}
while getopts "i:b:d:pa:m:s:t:o:l:" opt ; do
case $opt in
i) nwif="$OPTARG" ;;
b) case "$OPTARG" in
100) bandwidth=1e8 ;;
1000) bandwidth=1e9 ;;
*) bandwidth="$OPTARG" ;;
esac ;;
d) remotedir="$OPTARG" ;;
p) provision=true ;;
a) asynclist="$OPTARG" ;;
m) modelist="$OPTARG" ;;
s) sizelist="$OPTARG" ;;
l) loopback="OPTARG" ;;
t) timeout="$OPTARG" ;;
o) resultdir="$OPTARG" ;;
h) usage ;;
esac
done
shift $((OPTIND-1))
if [ $# -lt 1 ] ; then usage ; fi
pubremote=$1
shift
cfg=cdds-simple.xml
cat >$cfg <<EOF
<CycloneDDS>
<Domain>
<Id>17</Id>
</Domain>
<General>
<NetworkInterfaceAddress>$nwif</NetworkInterfaceAddress>
<EnableMulticastLoopback>$loopback</EnableMulticastLoopback>
<MaxMessageSize>65500B</MaxMessageSize>
<FragmentSize>4000B</FragmentSize>
</General>
<Internal>
<Watermarks>
<WhcHigh>500kB</WhcHigh>
</Watermarks>
<SynchronousDeliveryPriorityThreshold>\${async:-0}</SynchronousDeliveryPriorityThreshold>
<LeaseDuration>3s</LeaseDuration>
</Internal>
<Tracing>
<Verbosity>config</Verbosity>
</Tracing>
</CycloneDDS>
EOF
if [ ! -x bin/ddsperf ] ; then
echo "bin/ddsperf not found on the local machine" >&2
exit 1
fi
[ -d $resultdir ] || { echo "output directory $resultdir doesn't exist" >&2 ; exit 1 ; }
if $provision ; then
echo "provisioning ..."
for r in $pubremote "$@" ; do
ssh $r mkdir -p $remotedir $remotedir/bin $remotedir/lib
scp lib/libddsc.so.0 $r:$remotedir/lib
scp bin/ddsperf $r:$remotedir/bin
done
fi
topic=KS
[ -z "$sizelist" ] && topic=OU
export CYCLONEDDS_URI=file://$PWD/$cfg
for r in $pubremote "$@" ; do
scp $cfg $r:$remotedir || { echo "failed to copy $cfg to $remote:$PWD" >&2 ; exit 1 ; }
done
for async_mode in $asynclist ; do
case "$async_mode" in
sync) async=0 ;;
async) async=1 ;;
*) echo "$async_mode: invalid setting for ASYNC" >&2 ; continue ;;
esac
export async
for sub_mode in $modelist ; do
echo "======== ASYNC $async MODE $sub_mode ========="
cat > run-publisher.tmp <<EOF
export CYCLONEDDS_URI=file://$remotedir/$cfg
export async=$async
cd $remotedir
for size in ${sizelist:-0} ; do
echo "size \$size"
bin/ddsperf -D $timeout -T $topic pub size \$size > pub.log
sleep 5
done
wait
EOF
scp run-publisher.tmp $pubremote:$remotedir || { echo "failed to copy $cfg to $remote:$PWD" >&2 ; exit 2 ; }
killremotesubs=""
if [ $# -gt 0 ] ; then
cat > run-subscriber.tmp <<EOF
export CYCLONEDDS_URI=file://$remotedir/$cfg
export async=$async
cd $remotedir
nohup bin/ddsperf -T $topic sub $sub_mode > /dev/null &
echo \$!
EOF
for r in "$@" ; do
scp run-subscriber.tmp $r:$remotedir
rsubpid=`ssh $r ". $remotedir/run-subscriber.tmp"`
killremotesubs="$killremotesubs ssh $r kill -9 $rsubpid &"
done
fi
outdir=$resultdir/$async_mode-$sub_mode
mkdir $outdir
bin/ddsperf -d $nwif:$bandwidth -c -T $topic sub $sub_mode > $outdir/sub.log & spid=$!
tail -f $outdir/sub.log & xpid=$!
ssh $pubremote ". $remotedir/run-publisher.tmp"
kill $spid
eval $killremotesubs
sleep 1
kill $xpid
wait
scp $pubremote:$remotedir/pub.log $outdir
done
done

View file

@ -0,0 +1,76 @@
#!/usr/bin/perl -w
# Note: this is specialized for async delivery, listener mode because of the way it deals with
# thread names
use strict;
my %res = ();
my %meas;
while (<>) {
next unless s/^\[\d+\] \d+\.\d+\s+//;
if (/^size (\d+) .* rate (\d+\.\d+)\s*kS\/s\s+(\d+\.\d+)\s*Mb\/s/) {
# size is always the first line of an output block
# ddsperf doesn't print CPU loads, RSS, bandwidth if it is zero
my %tmp = %meas;
push @{$res{$meas{size}}}, \%tmp if %meas;
%meas = (size => $1, rate => $2, cookedbw => $3,
rawxmitbw => 0, rawrecvbw => 0,
subrss => 0, pubrss => 0,
subcpu => 0, subrecv => 0,
pubcpu => 0, pubrecv => 0);
} elsif (s/^(\@[^:]+:\d+\s+)?rss:(\d+\.\d+)([kM])B//) {
my $side = defined $1 ? "pub" : "sub";
$meas{"${side}rss"} = $2 / ($3 eq "k" ? 1024.0 : 1);
$meas{"${side}cpu"} = cpuload (($side eq "pub") ? "pub" : "dq.user", $_);
$meas{"${side}recv"} = cpuload ("recvUC", $_);
} elsif (/xmit\s+(\d+)%\s+recv\s+(\d+)%/) {
$meas{rawxmitbw} = $1;
$meas{rawrecvbw} = $2;
}
}
push @{$res{$meas{size}}}, \%meas if %meas;
die "no data found" unless keys %res > 0;
print "#size rate cookedbw rawxmitbw rawrecvbw pubrss subrss pubcpu pubrecv subcpu subrecv\n";
my @sizes = sort { $a <=> $b } keys %res;
for my $sz (@sizes) {
my $ms = $res{$sz};
my $rate = median ("rate", $ms);
my $cookedbw = median ("cookedbw", $ms);
my $rawxmitbw = median ("rawxmitbw", $ms);
my $rawrecvbw = median ("rawrecvbw", $ms);
my $pubrss = max ("pubrss", $ms);
my $subrss = max ("subrss", $ms);
my $pubcpu = median ("pubcpu", $ms);
my $pubrecv = median ("pubrecv", $ms);
my $subcpu = median ("subcpu", $ms);
my $subrecv = median ("subrecv", $ms);
print "$sz $rate $cookedbw $rawxmitbw $rawrecvbw $pubrss $subrss $pubcpu $pubrecv $subcpu $subrecv\n";
}
sub cpuload {
my ($thread, $line) = @_;
$thread =~ s/\./\\./g;
if ($line =~ /$thread:(\d+)%\+(\d+)%/) {
return $1+$2;
} else {
return 0;
}
}
sub max {
my $v;
for (extract (@_)) { $v = $_ unless defined $v; $v = $_ if $_ > $v; }
return $v;
}
sub median {
my @xs = sort { $a <=> $b } (extract (@_));
return (@xs % 2) ? $xs[(@xs - 1) / 2] : ($xs[@xs/2 - 1] + $xs[@xs/2]) / 2;
}
sub extract {
my ($key, $msref) = @_;
return map { $_->{$key} } @$msref;
}

View file

@ -0,0 +1,55 @@
#!/bin/bash
`dirname $0`/throughput-test-extract "$@" > data.txt
gnuplot <<\EOF
set term pngcairo size 1024,768
set output "throughput-async-listener-rate.png"
set st d lp
set st li 1 lw 2
set st li 2 lw 2
set st li 3 lw 2
set multiplot
set logscale xyy2
set title "Throughput"
set ylabel "[Mbps]"
set ytics (100,200,300,400,500,600,700,800,900,1000)
set grid xtics ytics mytics
set xlabel "payload size [bytes]"
# sample rate in data.txt is in kS/s
# GbE bandwidth in data.txt is in %, so 100% => 1000 Mbps
set key at graph 1, 0.9
p "data.txt" u 1:3 ti "payload", "" u 1:(10*$5) ti "GbE bandwidth"
set ytics auto
set key default
unset xlabel
unset title
set grid nomytics
set ylabel "[M sample/s]"
set origin .3, .1
set size .6, .6
clear
p "data.txt" u 1:($2/1e3) ti "rate"
unset multiplot
unset origin
unset size
unset logscale
set logscale x
set output "throughput-async-listener-memory.png"
set title "Throughput: memory"
set ylabel "RSS [MB]"
set xlabel "payload size [bytes]"
p "data.txt" u 1:6 ti "publisher", "" u 1:7 ti "subscriber"
unset logscale
set logscale x
set output "throughput-async-listener-cpu.png"
set title "Throughput: CPU"
set ylabel "CPU [%]"
set xlabel "payload size [bytes]"
p "data.txt" u 1:8 ti "publisher (pub thread)", "" u 1:9 ti "publisher (recvUC thread)", "" u 1:10 ti "subscriber (dq.user thread)", "" u 1:11 ti "subscriber (recvUC thread)"
EOF

View file

@ -0,0 +1,32 @@
#
# Copyright(c) 2006 to 2018 ADLINK Technology Limited and others
#
# This program and the accompanying materials are made available under the
# terms of the Eclipse Public License v. 2.0 which is available at
# http://www.eclipse.org/legal/epl-2.0, or the Eclipse Distribution License
# v. 1.0 which is available at
# http://www.eclipse.org/org/documents/edl-v10.php.
#
# SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
#
idlc_generate(RoundTrip_lib RoundTrip.idl)
add_executable(RoundtripPing ping.c)
add_executable(RoundtripPong pong.c)
target_link_libraries(RoundtripPing RoundTrip_lib CycloneDDS::ddsc)
target_link_libraries(RoundtripPong RoundTrip_lib CycloneDDS::ddsc)
install(
FILES
"RoundTrip.idl"
"ping.c"
"pong.c"
DESTINATION "${CMAKE_INSTALL_EXAMPLESDIR}/roundtrip"
COMPONENT dev)
install(
FILES "CMakeLists.export"
RENAME "CMakeLists.txt"
DESTINATION "${CMAKE_INSTALL_EXAMPLESDIR}/roundtrip"
COMPONENT dev)

View file

@ -116,7 +116,7 @@ static bool CtrlHandler (DWORD fdwCtrlType)
dds_waitset_set_trigger (waitSet, true);
return true; //Don't let other handlers handle this key
}
#else
#elif !DDSRT_WITH_FREERTOS
static void CtrlHandler (int sig)
{
(void)sig;
@ -249,7 +249,7 @@ int main (int argc, char *argv[])
/* Register handler for Ctrl-C */
#ifdef _WIN32
SetConsoleCtrlHandler ((PHANDLER_ROUTINE)CtrlHandler, TRUE);
#else
#elif !DDSRT_WITH_FREERTOS
struct sigaction sat, oldAction;
sat.sa_handler = CtrlHandler;
sigemptyset (&sat.sa_mask);
@ -411,7 +411,7 @@ done:
#ifdef _WIN32
SetConsoleCtrlHandler (0, FALSE);
#else
#elif !DDSRT_WITH_FREERTOS
sigaction (SIGINT, &oldAction, 0);
#endif

View file

@ -20,7 +20,7 @@ static bool CtrlHandler (DWORD fdwCtrlType)
dds_waitset_set_trigger (waitSet, true);
return true; //Don't let other handlers handle this key
}
#else
#elif !DDSRT_WITH_FREERTOS
static void CtrlHandler (int sig)
{
(void)sig;
@ -87,7 +87,7 @@ int main (int argc, char *argv[])
#ifdef _WIN32
SetConsoleCtrlHandler ((PHANDLER_ROUTINE)CtrlHandler, TRUE);
#else
#elif !DDSRT_WITH_FREERTOS
struct sigaction sat, oldAction;
sat.sa_handler = CtrlHandler;
sigemptyset (&sat.sa_mask);
@ -130,7 +130,7 @@ int main (int argc, char *argv[])
#ifdef _WIN32
SetConsoleCtrlHandler (0, FALSE);
#else
#elif !DDSRT_WITH_FREERTOS
sigaction (SIGINT, &oldAction, 0);
#endif

View file

@ -0,0 +1,32 @@
#
# Copyright(c) 2006 to 2018 ADLINK Technology Limited and others
#
# This program and the accompanying materials are made available under the
# terms of the Eclipse Public License v. 2.0 which is available at
# http://www.eclipse.org/legal/epl-2.0, or the Eclipse Distribution License
# v. 1.0 which is available at
# http://www.eclipse.org/org/documents/edl-v10.php.
#
# SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
#
idlc_generate(Throughput_lib Throughput.idl)
add_executable(ThroughputPublisher publisher.c)
add_executable(ThroughputSubscriber subscriber.c)
target_link_libraries(ThroughputPublisher Throughput_lib CycloneDDS::ddsc)
target_link_libraries(ThroughputSubscriber Throughput_lib CycloneDDS::ddsc)
install(
FILES
"Throughput.idl"
"publisher.c"
"subscriber.c"
DESTINATION "${CMAKE_INSTALL_EXAMPLESDIR}/throughput"
COMPONENT dev)
install(
FILES "CMakeLists.export"
RENAME "CMakeLists.txt"
DESTINATION "${CMAKE_INSTALL_EXAMPLESDIR}/throughput"
COMPONENT dev)

View file

@ -147,6 +147,9 @@ static dds_entity_t prepare_dds(dds_entity_t *writer, const char *partitionName)
if (participant < 0)
DDS_FATAL("dds_create_participant: %s\n", dds_strretcode(-participant));
/* Enable write batching */
dds_write_set_batch (true);
/* A topic is created for our sample type on the domain participant. */
topic = dds_create_topic (participant, &ThroughputModule_DataType_desc, "Throughput", NULL, NULL);
if (topic < 0)
@ -171,9 +174,6 @@ static dds_entity_t prepare_dds(dds_entity_t *writer, const char *partitionName)
DDS_FATAL("dds_create_writer: %s\n", dds_strretcode(-*writer));
dds_delete_qos (dwQos);
/* Enable write batching */
dds_write_set_batch (true);
return participant;
}
@ -232,7 +232,7 @@ static void start_writing(
if (burstCount < burstSize)
{
status = dds_write (writer, sample);
if (dds_err_nr(status) == DDS_RETCODE_TIMEOUT)
if (status == DDS_RETCODE_TIMEOUT)
{
timedOut = true;
}
@ -285,7 +285,7 @@ static void start_writing(
static void finalize_dds(dds_entity_t participant, dds_entity_t writer, ThroughputModule_DataType sample)
{
dds_return_t status = dds_dispose (writer, &sample);
if (dds_err_nr (status) != DDS_RETCODE_TIMEOUT && status < 0)
if (status != DDS_RETCODE_TIMEOUT && status < 0)
DDS_FATAL("dds_dispose: %s\n", dds_strretcode(-status));
dds_free (sample.payload._buffer);

View file

@ -1,159 +0,0 @@
#!/bin/bash
usage () {
cat >&2 <<EOF
usage: $0 [OPTIONS] user@remote [user@remote...]
OPTIONS
-i IF use network interface IF (default: eth0)
-b 100|1000 network bandwidth (100Mbps/1000Gbps) for calculating load
% given load in bytes/second (default: 1000)
-d DIR use DIR on remote (default: PWD)
-p provision required binaries in DIR (default: false)
first ssh's in to try mkdir -p DIR, then follows up with scp
-t DUR run for DUR seconds per size (default 20)
-a ASYNCLIST run for delivery async settings ASYNCLIST (default: "0 1")
-m MODELIST run with subscriber mode settings MODELIST (default: "-1 0 1")
-s SIZELIST run for sizes in SIZELIST (default: "0 16 32 64 128 256")
-l LOOPBACK enable/disable multicast loopback (true/false, default: true)
-o DIR store results in dir (default: throughput-result)
Local host runs ThroughputSubscriber, first remote runs ThroughputPublisher,
further remotes also run ThroughputSubscriber. It assumes these are
available in DIR/bin. It also assumes that ssh user@remote works without
requiring a password.
EOF
exit 1
}
export nwif=eth0
bandwidth=1000
remotedir="$PWD"
provision=false
asynclist="0 1"
modelist="-1 0 1"
sizelist="0 16 32 64 128 256"
timeout=20
loopback=true
resultdir="throughput-result"
while getopts "i:b:d:pa:m:s:t:o:l:" opt ; do
case $opt in
i) nwif="$OPTARG" ;;
b) bandwidth="$OPTARG" ;;
d) remotedir="$OPTARG" ;;
p) provision=true ;;
a) asynclist="$OPTARG" ;;
m) modelist="$OPTARG" ;;
s) sizelist="$OPTARG" ;;
l) loopback="OPTARG" ;;
t) timeout="$OPTARG" ;;
o) resultdir="$OPTARG" ;;
h) usage ;;
esac
done
shift $((OPTIND-1))
if [ $# -lt 1 ] ; then usage ; fi
ethload=`dirname $0`/ethload
pubremote=$1
shift
cfg=cdds-simple.xml
cat >$cfg <<EOF
<CycloneDDS>
<Domain>
<Id>17</Id>
</Domain>
<DDSI2E>
<General>
<NetworkInterfaceAddress>$nwif</NetworkInterfaceAddress>
<EnableMulticastLoopback>$loopback</EnableMulticastLoopback>
</General>
<Internal>
<Watermarks>
<WhcHigh>500kB</WhcHigh>
</Watermarks>
<SynchronousDeliveryPriorityThreshold>${async:-0}</SynchronousDeliveryPriorityThreshold>
<LeaseDuration>3s</LeaseDuration>
</Internal>
</DDSI2E>
</CycloneDDS>
EOF
if [ ! -x bin/ThroughputPublisher -o ! -x bin/ThroughputSubscriber -o ! -x $ethload ] ; then
echo "some check for existence of a file failed on the local machine" >&2
exit 1
fi
[ -d $resultdir ] || { echo "output directory $resultdir doesn't exist" >&2 ; exit 1 ; }
if $provision ; then
echo "provisioning ..."
for r in $pubremote "$@" ; do
ssh $r mkdir -p $remotedir $remotedir/bin $remotedir/lib
scp lib/libddsc.so.0 $r:$remotedir/lib
scp bin/ThroughputPublisher bin/ThroughputSubscriber $r:$remotedir/bin
done
fi
export CYCLONEDDS_URI=file://$PWD/$cfg
for r in $pubremote "$@" ; do
scp $cfg $r:$remotedir || { echo "failed to copy $cfg to $remote:$PWD" >&2 ; exit 1 ; }
done
for async in $asynclist ; do
export async
for mode in $modelist ; do
echo "======== ASYNC $async MODE $mode ========="
cat > run-publisher.tmp <<EOF
export CYCLONEDDS_URI=file://$remotedir/$cfg
export async=$async
cd $remotedir
rm -f pub-top.log
for size in $sizelist ; do
echo "size \$size"
bin/ThroughputPublisher \$size > pub.log & ppid=\$!
top -b -d1 -p \$ppid >> pub-top.log & tpid=\$!
sleep $timeout
kill \$tpid
kill -2 \$ppid
wait \$ppid
sleep 5
done
wait
EOF
scp run-publisher.tmp $pubremote:$remotedir || { echo "failed to copy $cfg to $remote:$PWD" >&2 ; exit 2 ; }
killremotesubs=""
if [ $# -gt 0 ] ; then
cat > run-subscriber.tmp <<EOF
export CYCLONEDDS_URI=file://$remotedir/$cfg
export async=$async
cd $remotedir
nohup bin/ThroughputSubscriber 0 $mode > /dev/null &
echo \$!
EOF
for r in "$@" ; do
scp run-subscriber.tmp $r:$remotedir
rsubpid=`ssh $r ". $remotedir/run-subscriber.tmp"`
killremotesubs="$killremotesubs ssh $r kill -9 $rsubpid &"
done
fi
outdir=$resultdir/data-async$async-mode$mode
mkdir $outdir
rm -f sub-top.log
$ethload $nwif $bandwidth > $outdir/sub-ethload.log & lpid=$!
bin/ThroughputSubscriber 0 $mode > $outdir/sub.log & spid=$!
top -b -d1 -p $spid >> $outdir/sub-top.log & tpid=$!
tail -f $outdir/sub.log & xpid=$!
ssh $pubremote ". $remotedir/run-publisher.tmp"
kill $tpid
kill -2 $spid
eval $killremotesubs
sleep 1
kill $lpid $xpid
wait
scp $pubremote:$remotedir/{pub-top.log,pub.log} $outdir
done
done

View file

@ -1,59 +0,0 @@
#!/usr/bin/perl -w
use strict;
my @dirs = ("async0-mode-1", "async0-mode0", "async0-mode1",
"async1-mode-1", "async1-mode0", "async1-mode1");
my $dataset = 0;
my $basedir = "throughput-result";
$basedir = $ARGV[0] if @ARGV== 1;
my $load_threshold = 20;
for my $dir (@dirs) {
my @loads = ();
{
open LH, "< $basedir/data-$dir/sub-ethload.log" or next; # die "can't open $basedir/data-$dir/sub-ethload.log";
my @curload = ();
while (<LH>) {
next unless /^r +([0-9.]+).*\( *(\d+)/;
push @curload, $2 if $1 > $load_threshold;
if (@curload && $1 < $load_threshold) {
push @loads, median (@curload);
@curload = ();
}
}
push @loads, median (@curload) if @curload;
close LH;
}
open FH, "< $basedir/data-$dir/sub.log" or next; # die "can't open $basedir/data-$dir/sub.log";
print "\n\n" if $dataset++;
print "# mode $dir\n";
print "# payloadsize rate[samples/s] appl.bandwidth[Mb/s] raw.bandwidth[Mb/s]\n";
my $psz;
my @rate = ();
while (<FH>) {
next unless /Payload size: ([0-9]+).*Transfer rate: ([0-9.]+)/;
my $psz_cur = $1; my $rate_cur = $2;
$psz = $psz_cur unless defined $psz;
if ($psz != $psz_cur) {
my $load = shift @loads;
my $rate = median (@rate);
printf "%d %f %f %f\n", $psz, $rate, $rate * (8 + $psz) / 125e3, $load / 125e3;
@rate = ();
}
$psz = $psz_cur;
push @rate, ($rate_cur + 0.0);
}
my $load = shift @loads;
my $rate = median (@rate);
printf "%d %f %f %f\n", $psz, $rate, $rate * (8 + $psz) / 125e3, $load / 125e3;
close FH;
}
sub median {
my @xs = sort { $a <=> $b } @_;
return (@xs % 2) ? $xs[(@xs - 1) / 2] : ($xs[@xs/2 - 1] + $xs[@xs/2]) / 2;
}

View file

@ -1,14 +0,0 @@
#!/bin/bash
`dirname $0`/throughput-test-extract > data.txt
gnuplot <<\EOF
set term png size 1024,768
set output "throughput-polling.png"
set st d l
set title "Throughput (polling with 1ms sleeps)"
set ylabel "M sample/s"
set y2label "Mbps"
set y2tics
set xlabel "payload size [bytes]"
p "data.txt" i 5 u 1:($2/1e6) ti "rate [M sample/s]", "" i 5 u 1:3 axes x1y2 ti "app bandwidth [Mbps]", "" i 5 u 1:4 axes x1y2 ti "GbE bandwidth [Mbps]"
EOF

View file

@ -0,0 +1,126 @@
#
# Copyright(c) 2006 to 2018 ADLINK Technology Limited and others
#
# This program and the accompanying materials are made available under the
# terms of the Eclipse Public License v. 2.0 which is available at
# http://www.eclipse.org/legal/epl-2.0, or the Eclipse Distribution License
# v. 1.0 which is available at
# http://www.eclipse.org/org/documents/edl-v10.php.
#
# SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
#
cmake_minimum_required(VERSION 3.5)
project(FreeRTOS-Sim VERSION 10.0.2.0)
include(GNUInstallDirs)
# Some distributions place libraries in lib64 when the architecture is x86_64,
# but since the simulator is compiled with -m32, lib is a better name.
if(UNIX AND CMAKE_INSTALL_LIBDIR STREQUAL "lib64")
set(CMAKE_INSTALL_LIBDIR "lib")
endif()
# Conflicts may be introduced when placing the libraries or headers in the
# default system locations, i.e. /usr/lib and /usr/include on *NIX platforms.
# The install prefix must therefore be postfixed with the project name.
if(UNIX)
set(CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}/${CMAKE_PROJECT_NAME}")
endif()
set(ENTRYPOINT "real_main"
CACHE STRING "Alternate name of original entrypoint")
set(FREERTOS_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/FreeRTOS-Sim"
CACHE STRING "Location of FreeRTOS POSIX Port sources")
set(source_path "${FREERTOS_SOURCE_DIR}/Source")
list(APPEND sources
"${source_path}/croutine.c"
"${source_path}/event_groups.c"
"${source_path}/list.c"
"${source_path}/queue.c"
"${source_path}/tasks.c"
"${source_path}/timers.c"
"${source_path}/portable/MemMang/heap_3.c"
"${source_path}/portable/GCC/POSIX/port.c")
list(APPEND headers
"${source_path}/include/croutine.h"
"${source_path}/include/deprecated_definitions.h"
"${source_path}/include/event_groups.h"
"${source_path}/include/FreeRTOS.h"
"${source_path}/include/list.h"
"${source_path}/include/mpu_prototypes.h"
"${source_path}/include/mpu_wrappers.h"
"${source_path}/include/portable.h"
"${source_path}/include/projdefs.h"
"${source_path}/include/queue.h"
"${source_path}/include/semphr.h"
"${source_path}/include/StackMacros.h"
"${source_path}/include/task.h"
"${source_path}/include/timers.h"
"${source_path}/portable/GCC/POSIX/portmacro.h")
list(APPEND headers
"${CMAKE_CURRENT_SOURCE_DIR}/include/FreeRTOSConfig.h")
add_library(freertos-sim ${sources})
target_compile_definitions(
freertos-sim PUBLIC __GCC_POSIX=1 MAX_NUMBER_OF_TASKS=300)
target_compile_options(
freertos-sim
PUBLIC
-m32
PRIVATE
-W -Wall -Werror -Wmissing-braces -Wno-cast-align -Wparentheses -Wshadow
-Wno-sign-compare -Wswitch -Wuninitialized -Wunknown-pragmas
-Wunused-function -Wunused-label -Wunused-parameter -Wunused-value
-Wunused-variable -Wmissing-prototypes)
target_include_directories(
freertos-sim
PUBLIC
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>"
"$<BUILD_INTERFACE:${source_path}/include>"
"$<BUILD_INTERFACE:${source_path}/portable/GCC/POSIX>"
"$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>")
target_link_libraries(
freertos-sim PUBLIC -m32 -pthread)
if(CMAKE_BUILD_TYPE STREQUAL "DEBUG" OR
CMAKE_BUILD_TYPE STREQUAL "RELWITHDEBINFO")
target_compile_options(freertos-sim PUBLIC -ggdb)
target_link_libraries(freertos-sim PUBLIC -ggdb)
endif()
# The FreeRTOS POSIX Port does not require hardware to be initialized (unless
# lwIP is used), but the scheduler must be started before it is safe to execute
# application code. A "loader" is built to avoid modifications to existing
# code. The generated toolchain file will automatically redefine "main" to
# "real_main". The "real_main" function is executed once the scheduler is
# started.
#
# The loader is not part of the freertos-sim target as it has no place in the
# board support package.
add_library(freertos-sim-loader
"${CMAKE_CURRENT_SOURCE_DIR}/src/loader.c")
set_source_files_properties(
"${CMAKE_CURRENT_SOURCE_DIR}/src/loader.c"
PROPERTIES COMPILE_DEFINITIONS real_main=${ENTRYPOINT})
target_link_libraries(freertos-sim-loader freertos-sim)
install(
FILES ${headers}
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}")
configure_file("freertos-sim.cmake.in" "freertos-sim.cmake" @ONLY)
install(
FILES "${CMAKE_CURRENT_BINARY_DIR}/freertos-sim.cmake"
DESTINATION "${CMAKE_INSTALL_DATADIR}")
install(
TARGETS freertos-sim freertos-sim-loader
EXPORT "${CMAKE_PROJECT_NAME}"
RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}"
LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}"
ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}")

View file

@ -0,0 +1,83 @@
# FreeRTOS POSIX Port
FreeRTOS is a supported platform for Eclipse Cyclone DDS. This document
explains how to build and run Eclipse Cyclone DDS on the FreeRTOS POSIX Port.
For basic information, see: [freertos.md](/docs/dev/freertos.md).
As the steps for building and running on the FreeRTOS POSIX Port are largely
the same as building and running on an actual embedded target, this document
should provide an excellent starting point for users. Apart from that, the
simulator can be used to verify commits do not break FreeRTOS compatibility.
> lwIP can also be used in combination with both UNIX and Windows targets, but
> the simulator does not yet have integration. Once integration between both
> is figured out, this document should be updated accordingly.
## Build and install the simulator
The FreeRTOS POSIX Port is not maintained by the FreeRTOS project. Various
projects are maintained across the internet. At the time of writing, the
version maintained by [Shilin][1] seemed the best as the version maintained by
[megakilo][2] was archived.
[1]: https://github.com/shlinym/FreeRTOS-Sim.git
[2]: https://github.com/megakilo/FreeRTOS-Sim
> A [FreeRTOS Linux Port][3] is in the works. Once it becomes stable, please
> update this document accordingly.
[3]: https://sourceforge.net/p/freertos/discussion/382005/thread/f28af711/
1. Clone the repository. The `CMakeLists.txt` in this directory assumes the
sources are available `./FreeRTOS-Sim` by default, but a different location
can be specified using the CMake option `FREERTOS_SOURCE_DIR`.
```
git clone https://github.com/shlinym/FreeRTOS-Sim.git
```
2. Specify an installation prefix and build the simulator like any other
CMake project.
```
mkdir build
cd build
cmake -DCMAKE_INSTALL_PREFIX=$(pwd)/install ..
cmake --build . --target install
```
> A CMake toolchain file is generated and installed into a `share` directory
> located under CMAKE\_INSTALL\_PREFIX/FreeRTOS-Sim. The compiler that CMake
> discovers and uses to build the simulator is exported in the toolchain file
> and will also be used to build Eclipse Cyclone DDS in the following steps.
## Build Eclipse Cyclone DDS for the simulator
1. Change to the root of the repository and install the dependencies.
```
mkdir build
cd build
conan install -s arch=x86 ..
```
> For actual cross-compilation environments the instructions above will not
> install the correct packages. Even when e.g. Clang instead of GCC was used
> to build the simulator, the mismatch between Conan and CMake will break the
> build. To install the correct packages for the target, specify the required
> settings e.g. when the simulator was built using Clang 7.0, use
> `conan install -s arch=x86 -s compiler=clang -s compiler.version=7.0 ..`.
> If packages are not yet available for the target, as is usually the case
> with actual embedded targets, export the path to the toolchain file in the
> `CONAN_CMAKE_TOOLCHAIN_FILE` environment variable and add the `-b` flag to
> build the packages.
2. Build Eclipse Cyclone DDS.
```
$ cmake -DCMAKE_TOOLCHAIN_FILE=/path/to/toolchain/file -DWITH_FREERTOS=on ../src
```
> Examples (and tests) can be executed like usual. The simulator provides a
> *loader* that initializes the hardware (not used on non-embedded targets),
> starts the scheduler and loads the application.

View file

@ -0,0 +1,33 @@
#
# Copyright(c) 2006 to 2018 ADLINK Technology Limited and others
#
# This program and the accompanying materials are made available under the
# terms of the Eclipse Public License v. 2.0 which is available at
# http://www.eclipse.org/legal/epl-2.0, or the Eclipse Distribution License
# v. 1.0 which is available at
# http://www.eclipse.org/org/documents/edl-v10.php.
#
# SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
#
#
# CMake toolchain file generated by @CMAKE_PROJECT_NAME@
#
set(CMAKE_C_COMPILER "@CMAKE_C_COMPILER@")
set(CMAKE_CXX_COMPILER "@CMAKE_CXX_COMPILER@")
set(include_path "@CMAKE_INSTALL_PREFIX@/@CMAKE_INSTALL_INCLUDEDIR@")
set(library_path "@CMAKE_INSTALL_PREFIX@/@CMAKE_INSTALL_LIBDIR@")
set(CMAKE_C_FLAGS "-I${include_path} -Dmain=@ENTRYPOINT@ -m32")
set(CMAKE_EXE_LINKER_FLAGS "-L${library_path}")
set(CMAKE_SHARED_LINKER_FLAGS "-L${library_path}")
set(CMAKE_C_STANDARD_LIBRARIES "-Wl,--start-group,-lfreertos-sim,-lfreertos-sim-loader,--end-group -m32 -lpthread")
set(CMAKE_FIND_ROOT_PATH ${CMAKE_SYSROOT})
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM BOTH)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)

View file

@ -0,0 +1,74 @@
#ifndef FREERTOS_CONFIG_H
#define FREERTOS_CONFIG_H
/*-----------------------------------------------------------
* Application specific definitions.
*
* These definitions should be adjusted for your particular hardware and
* application requirements.
*
* THESE PARAMETERS ARE DESCRIBED WITHIN THE 'CONFIGURATION' SECTION OF THE
* FreeRTOS API DOCUMENTATION AVAILABLE ON THE FreeRTOS.org WEB SITE.
*
* See http://www.freertos.org/a00110.html.
*----------------------------------------------------------*/
#define configUSE_PREEMPTION 1
#define configUSE_IDLE_HOOK 1
#define configUSE_TICK_HOOK 1
#define configTICK_RATE_HZ ( ( portTickType ) 1000 )
#define configMINIMAL_STACK_SIZE ( ( unsigned portSHORT ) 64 ) /* This can be made smaller if required. */
#define configTOTAL_HEAP_SIZE ( ( size_t ) ( 64 * 1024 ) )
#define configMAX_TASK_NAME_LEN ( 16 )
#define configUSE_TRACE_FACILITY 1
#define configUSE_16_BIT_TICKS 0
#define configIDLE_SHOULD_YIELD 1
#define configUSE_MUTEXES 1
#define configCHECK_FOR_STACK_OVERFLOW 0 /* Do not use this option on the PC port. */
#define configUSE_RECURSIVE_MUTEXES 1
#define configQUEUE_REGISTRY_SIZE 20
#define configUSE_MALLOC_FAILED_HOOK 1
#define configUSE_APPLICATION_TASK_TAG 1
#define configUSE_COUNTING_SEMAPHORES 1
#define configUSE_ALTERNATIVE_API 0
//#define configMAX_SYSCALL_INTERRUPT_PRIORITY 1
#define configUSE_QUEUE_SETS 1
#define configUSE_TASK_NOTIFICATIONS 1
/* Software timer related configuration options. */
#define configUSE_TIMERS 1
#define configTIMER_TASK_PRIORITY ( configMAX_PRIORITIES - 1 )
#define configTIMER_QUEUE_LENGTH 20
#define configTIMER_TASK_STACK_DEPTH ( configMINIMAL_STACK_SIZE * 2 )
#define configMAX_PRIORITIES ( 10 )
#define configGENERATE_RUN_TIME_STATS 1
/* Set the following definitions to 1 to include the API function, or zero
to exclude the API function. In most cases the linker will remove unused
functions anyway. */
#define INCLUDE_vTaskPrioritySet 1
#define INCLUDE_uxTaskPriorityGet 1
#define INCLUDE_vTaskDelete 1
#define INCLUDE_vTaskSuspend 1
#define INCLUDE_vTaskDelayUntil 1
#define INCLUDE_vTaskDelay 1
#define INCLUDE_uxTaskGetStackHighWaterMark 0 /* Do not use this option on the PC port. */
#define INCLUDE_xTaskGetSchedulerState 1
#define INCLUDE_xTimerGetTimerDaemonTaskHandle 1
#define INCLUDE_xTaskGetIdleTaskHandle 1
#define INCLUDE_pcTaskGetTaskName 1
#define INCLUDE_eTaskGetState 1
#define INCLUDE_xSemaphoreGetMutexHolder 1
#define INCLUDE_xTimerPendFunctionCall 1
#define INCLUDE_xTaskAbortDelay 1
#define INCLUDE_xTaskGetHandle 1
/* It is a good idea to define configASSERT() while developing. configASSERT()
uses the same semantics as the standard C assert() macro. */
extern void vAssertCalled( unsigned long ulLine, const char * const pcFileName );
#define configASSERT( x ) if( ( x ) == 0 ) vAssertCalled( __LINE__, __FILE__ )
#endif /* FREERTOS_CONFIG_H */

View file

@ -0,0 +1,165 @@
/*
* Copyright(c) 2006 to 2018 ADLINK Technology Limited and others
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0, or the Eclipse Distribution License
* v. 1.0 which is available at
* http://www.eclipse.org/org/documents/edl-v10.php.
*
* SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
*/
/*
* Launcher to run existing programs in the FreeRTOS+lwIP Simulator.
*
* Verification of FreeRTOS+lwIP compatibility in Continuous Integration (CI)
* setups is another intended purpose.
*/
#include <assert.h>
#include <getopt.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#if _WIN32
# define EX_OK (0)
# define EX_USAGE (64)
# define LF "\r\n"
#else
# include <sysexits.h>
# define LF "\n"
#endif
#include <FreeRTOS.h>
#include <task.h>
/* Setup system hardware. */
void prvSetupHardware(void)
{
/* No hardware to setup when running in the simulator. */
return;
}
void vAssertCalled(unsigned long ulLine, const char * const pcFileName)
{
taskENTER_CRITICAL();
{
fprintf(stderr, "[ASSERT] %s:%lu"LF, pcFileName, ulLine);
}
taskEXIT_CRITICAL();
abort();
}
void vApplicationMallocFailedHook(void)
{
vAssertCalled(__LINE__, __FILE__);
}
void vApplicationIdleHook(void) { return; }
void vApplicationTickHook( void ) { return; }
static void usage(const char *name)
{
static const char fmt[] =
"Usage: %s LAUNCHER_OPTIONS -- PROGRAM_OPTIONS"LF
"Try '%s -h' for more information"LF;
fprintf(stderr, fmt, name, name);
}
static void help(const char *name)
{
static const char fmt[] =
"Usage: %s LAUNCHER_OPTIONS -- PROGRAM_OPTIONS"LF
""LF
"Launcher options:"LF
" -h Show this help message and exit"LF;
fprintf(stdout, fmt, name);
}
typedef struct {
int argc;
char **argv;
} args_t;
extern int real_main(int argc, char *argv[]);
static void vMainTask(void *ptr)
{
args_t *args = (args_t *)ptr;
/* Reset getopt global variables. */
opterr = 1;
optind = 1;
(void)real_main(args->argc, args->argv);
vPortFree(args->argv);
vPortFree(args);
vTaskDelete(NULL);
_Exit(0);
}
int
main(int argc, char *argv[])
{
int opt;
char *name;
args_t *args = NULL;
/* Determine program name. */
assert(argc >= 0 && argv[0] != NULL);
name = strrchr(argv[0], '/');
if (name != NULL) {
name++;
} else {
name = argv[0];
}
if ((args = pvPortMalloc(sizeof(*args))) == NULL) {
return EX_OSERR;
}
memset(args, 0, sizeof(*args));
/* Parse command line options. */
while ((opt = getopt(argc, argv, ":a:dg:hn:")) != -1) {
switch (opt) {
case 'h':
help(name);
exit(EX_OK);
case '?':
fprintf(stderr, "Unknown option '%c'"LF, opt);
usage(name);
exit(EX_USAGE);
case ':':
/* fall through */
default:
fprintf(stderr, "Option '%c' requires an argument"LF, opt);
usage(name);
exit(EX_USAGE);
}
}
/* Copy leftover arguments into a new array. */
args->argc = (argc - optind) + 1;
args->argv = pvPortMalloc((args->argc + 1) * sizeof(*args->argv));
if (args->argv == NULL) {
return EX_OSERR;
}
args->argv[0] = argv[0];
for (int i = optind, j = 1; i < argc; i++, j++) {
args->argv[j] = argv[i];
}
prvSetupHardware();
xTaskCreate(vMainTask, name,
configMINIMAL_STACK_SIZE, args, (tskIDLE_PRIORITY + 1UL),
(xTaskHandle *) NULL);
vTaskStartScheduler();
return EX_SOFTWARE;
}

View file

@ -0,0 +1,40 @@
# Solaris 2.6 / sun4m port
Building for Solaris 2.6 / sun4m, e.g., a Sun Microsystems SPARCStation 20 running Solaris 2.6,
firstly involves getting a sufficiently modern gcc onto the machine (gcc-4.3.x with GNU binutils
certainly works, but it is very well possible that older versions and/or using the Sun assembler and
linker work fine, too) and a sufficiently new gmake (3.81 should do).
Secondly, because the port relies on a custom makefile rather than "cmake", and that makefile
doesn't build the Java-based IDL preprocessor to avoid pulling in tons of dependencies, you will
need to do a build on a "normal" platform first. The makefile assumes that the required parts of
that build process are available in a "build" directory underneath the project root. Note that only
the CMake generate export.h and the ddsperf-related IDL preprocessor output is required (if other
applications are to be be built, they may require additional files).
The results are stored in a directory named "gen". After a successful build, there will be
libddsc.so and ddsperf in that directory. No attempts are made at tracking header file
dependencies. It seems unlikely that anyone would want to use such a machine as a development
machine.
The makefile expects to be run from the project root directory.
E.g., on a regular supported platform:
```
# mkdir build && cd build
# cmake ../src
# make
# cd ..
# git archive -o cdds.zip HEAD
# find build -name '*.[ch]' | xargs zip -9r cdds.zip
```
copy cdds.zip to the Solaris box, log in and:
```
# mkdir cdds && cd cdds
# unzip .../cdds.zip
# make -f ports/solaris2.6/makefile -j4
# gen/ddsperf -D20 sub & gen/ddsperf -D20 pub &
```
It takes about 10 minutes to do the build on a quad 100MHz HyperSPARC.

264
ports/solaris2.6/config.mk Normal file
View file

@ -0,0 +1,264 @@
ifeq "$(CONFIG)" ""
override CONFIG := $(shell $(dir $(lastword $(MAKEFILE_LIST)))/guess-config)
ifeq "$(CONFIG)" ""
$(error "Failed to guess config")
endif
endif
OS := $(shell echo $(CONFIG) | sed -e 's/^[^.]*\.//' -e 's/^\([^-_]*\)[-_].*/\1/')
PROC := $(shell echo $(CONFIG) | sed -e 's/^\([^.]*\)\..*/\1/')
ifeq "$(OS)" "darwin"
DDSRT = $(OS) posix
RULES = darwin
CC = clang
LD = $(CC)
OPT = -fsanitize=address #-O3 -DNDEBUG
PROF =
CPPFLAGS += -Wall -g $(OPT) $(PROF)
CFLAGS += $(CPPFLAGS) #-fno-inline
LDFLAGS += -g $(OPT) $(PROF)
X =
O = .o
A = .a
SO = .dylib
LIBPRE = lib
endif
ifeq "$(OS)" "solaris2.6"
DDSRT = $(OS) posix
RULES = unix
CC = gcc -std=gnu99 -mcpu=v8
LD = $(CC)
OPT = -O2 -DNDEBUG
PROF =
CPPFLAGS += -Wall -g $(OPT) $(PROF) -D_REENTRANT -D__EXTENSIONS__ -D__SunOS_5_6 -I$(PWD)/ports/solaris2.6/include
CFLAGS += $(CPPFLAGS)
LDFLAGS += -g $(OPT) $(PROF)
LDLIBS += -lposix4 -lsocket -lnsl -lc
X =
O = .o
A = .a
SO = .so
LIBPRE = lib
endif
ifeq "$(OS)" "linux"
DDSRT = posix
RULES = unix
CC = gcc-6.2 -std=gnu99 -fpic -mcx16
OPT = #-fsanitize=address
# CC = gcc-6.2 -std=gnu99 -fpic -mcx16
# OPT = -O3 -DNDEBUG -flto
LD = $(CC)
PROF =
CPPFLAGS += -Wall -g $(OPT) $(PROF)
CFLAGS += $(CPPFLAGS) #-fno-inline
LDFLAGS += -g $(OPT) $(PROF)
X =
O = .o
A = .a
SO = .so
LIBPRE = lib
endif
ifeq "$(OS)" "win32"
DDSRT = windows
RULES = windows
CC = cl
LD = link
# OPT = -O2 -DNDEBUG
OPT = -MDd
PROF =
CPPFLAGS = -Zi -W3 $(OPT) $(PROF) -TC # -bigobj
CFLAGS += $(CPPFLAGS)
LDFLAGS += -nologo -incremental:no -subsystem:console -debug
X = .exe
O = .obj
A = .lib
SO = .dll
LIBPRE =
# VS_VERSION=12.0
# ifeq "$(VS_VERSION)" "12.0" # This works for VS2013 + Windows 10
# VS_HOME=/cygdrive/c/Program Files (x86)/Microsoft Visual Studio 12.0
# WINDOWSSDKDIR=/cygdrive/c/Program Files (x86)/Windows Kits/8.1
# else # This works for VS2010 + Windows 7
# VS_HOME=/cygdrive/C/Program Files (x86)/Microsoft Visual Studio 10.0
# WINDOWSSDKDIR=/cygdrive/C/Program Files (x86)/Microsoft SDKs/Windows/v7.0A
# endif
endif
ifeq "$(OS)" "wine"
export WINEDEBUG=-all
DDSRT = windows
RULES = wine
GEN = gen.wine
CC = wine cl
LD = wine link
CPPFLAGS = -nologo -W3 -TC -analyze -D_WINNT=0x0604 -Drestrict=
CFLAGS += $(CPPFLAGS)
LDFLAGS += -nologo -incremental:no -subsystem:console -debug
X = .exe
O = .obj
A = .lib
SO = .dll
LIBPRE =
endif
# use $(DDSRT) as a proxy for $(CONFIG) not matching anything
ifeq "$(DDSRT)" ""
$(error "$(CONFIG): unsupported config")
endif
# We're assuming use of cygwin, which means Windows path names can be
# obtained using "cygpath". With "-m" we get slashes (rather than
# backslashes), which all of MS' tools accept and which are far less
# troublesome in make.
ifeq "$(CC)" "cl"
N_PWD := $(shell cygpath -m '$(PWD)')
#N_VS_HOME := $(shell cygpath -m '$(VS_HOME)')
#N_WINDOWSSDKDIR := $(shell cygpath -m '$(WINDOWSSDKDIR)')
else # not Windows
N_PWD := $(PWD)
endif
# More machine- and platform-specific matters.
ifeq "$(CC)" "cl" # Windows
ifeq "$(PROC)" "x86_64"
MACHINE = -machine:X64
endif
LDFLAGS += $(MACHINE)
OBJ_OFLAG = -Fo
EXE_OFLAG = -out:
SHLIB_OFLAG = -out:
CPPFLAGS += -D_CRT_SECURE_NO_WARNINGS
# ifeq "$(VS_VERSION)" "12.0" # This works for VS2013 + Windows 10
# CPPFLAGS += '-I$(N_VS_HOME)/VC/include' '-I$(N_WINDOWSSDKDIR)/Include/um' '-I$(N_WINDOWSSDKDIR)/Include/shared'
# ifeq "$(PROC)" "x86_64"
# LDFLAGS += '-libpath:$(N_VS_HOME)/VC/lib/amd64' '-libpath:$(N_WINDOWSSDKDIR)/lib/winv6.3/um/x64'
# else
# LDFLAGS += '-libpath:$(N_VS_HOME)/VC/lib' '-libpath:$(N_WINDOWSSDKDIR)/lib/winv6.3/um/x86'
# endif
# else # This works for VS2010 + Windows 7
# CPPFLAGS += '-I$(N_VS_HOME)/VC/include' '-I$(N_WINDOWSSDKDIR)/Include'
# ifeq "$(PROC)" "x86_64"
# LDFLAGS += '-libpath:$(N_VS_HOME)/VC/lib/amd64' '-libpath:$(N_WINDOWSSDKDIR)/lib/x64'
# else
# LDFLAGS += '-libpath:$(N_VS_HOME)/VC/lib' '-libpath:$(N_WINDOWSSDKDIR)/lib'
# endif
# endif
else
ifeq "$(CC)" "wine cl"
OBJ_OFLAG =-Fo
EXE_OFLAG = -out:
SHLIB_OFLAG = -out:
CPPFLAGS += -D_CRT_SECURE_NO_WARNINGS
else # not Windows (-like)
OBJ_OFLAG = -o
EXE_OFLAG = -o
SHLIB_OFLAG = -o
ifeq "$(PROC)" "x86"
CFLAGS += -m32
LDFLAGS += -m32
endif
ifeq "$(PROC)" "x86_64"
CFLAGS += -m64
LDFLAGS += -m64
endif
endif
endif
ifeq "$(CC)" "cl"
LDFLAGS += -libpath:$(N_PWD)/gen
LIBDEP_SYS = kernel32 ws2_32
else
ifeq "$(CC)" "wine cl"
else
LDFLAGS += -L$(N_PWD)/gen
LIBDEP_SYS = kernel32 ws2_32
endif
endif
getabspath=$(abspath $1)
ifeq "$(RULES)" "darwin"
ifneq "$(findstring clang, $(CC))" ""
define make_exe
$(LD) $(LDFLAGS) $(patsubst -L%, -rpath %, $(filter -L%, $(LDFLAGS))) $(EXE_OFLAG)$@ $^ $(LDLIBS)
endef
define make_shlib
$(LD) $(LDFLAGS) $(patsubst -L%, -rpath %, $(filter -L%, $(LDFLAGS))) -dynamiclib -install_name @rpath/$(notdir $@) $(SHLIB_OFLAG)$@ $^ $(LDLIBS)
endef
else # assume gcc
comma=,
define make_exe
$(LD) $(LDFLAGS) $(patsubst -L%, -Wl$(comma)-rpath$(comma)%, $(filter -L%, $(LDFLAGS))) $(EXE_OFLAG)$@ $^ $(LDLIBS)
endef
define make_shlib
$(LD) $(LDFLAGS) $(patsubst -L%, -Wl$(comma)-rpath$(comma)%, $(filter -L%, $(LDFLAGS))) -dynamiclib -Wl,-install_name,@rpath/$(notdir $@) $(SHLIB_OFLAG)$@ $^ $(LDLIBS)
endef
endif
define make_archive
ar -ru $@ $?
endef
define make_dep
$(CC) -M $(CPPFLAGS) $< | sed 's|[a-zA-Z0-9_-]*\.o|gen/&|' > $@ || { rm $@ ; exit 1 ; }
endef
else
ifeq "$(RULES)" "unix"
LDLIBS += -lpthread
comma=,
define make_exe
$(LD) $(LDFLAGS) $(patsubst -L%,-Wl$(comma)-rpath$(comma)%, $(filter -L%, $(LDFLAGS))) $(EXE_OFLAG)$@ $^ $(LDLIBS)
endef
define make_shlib
$(LD) $(LDFLAGS) -Wl$(comma)--no-allow-shlib-undefined $(patsubst -L%,-Wl$(comma)-rpath$(comma)%, $(filter -L%, $(LDFLAGS))) -shared $(SHLIB_OFLAG)$@ $^ $(LDLIBS)
endef
define make_archive
ar -ru $@ $?
endef
define make_dep
$(CC) -M $(CPPFLAGS) $< | sed 's|[a-zA-Z0-9_-]*\.o|gen/&|' > $@ || { rm $@ ; exit 1 ; }
endef
else
ifeq "$(RULES)" "windows"
define make_exe
$(LD) $(LDFLAGS) $(EXE_OFLAG)$@ $^ $(LDLIBS)
endef
define make_shlib
$(LD) $(LDFLAGS) $(SHLIB_OFLAG)$@ $^ $(LDLIBS)
endef
define make_archive
lib $(MACHINE) /out:$@ $^
endef
define make_dep
$(CC) -E $(CPPFLAGS) $(CPPFLAGS) $< | grep "^#line.*\\\\vdds\\\\" | cut -d '"' -f 2 | sort -u | sed -e 's@\([A-Za-z]\)\:@ /cygdrive/\1@' -e 's@\\\\@/@g' -e '$$!s@$$@ \\@' -e '1s@^@$*$O: @' >$@
endef
else
ifeq "$(RULES)" "wine"
COMPILE_MANY_ATONCE=true
getabspath=$1
lc = $(subst A,a,$(subst B,b,$(subst C,c,$(subst D,d,$(subst E,e,$(subst F,f,$(subst G,g,$(subst H,h,$(subst I,i,$(subst J,j,$(subst K,k,$(subst L,l,$(subst M,m,$(subst N,n,$(subst O,o,$(subst P,p,$(subst Q,q,$(subst R,r,$(subst S,s,$(subst T,t,$(subst U,u,$(subst V,v,$(subst W,w,$(subst X,x,$(subst Y,y,$(subst Z,z,$1))))))))))))))))))))))))))
FAKEPWD = $(call lc,z:$(subst /,\\\\,$(PWD)))
define make_exe
$(LD) $(LDFLAGS) $(EXE_OFLAG)$@ $^ $(LDLIBS)
endef
define make_shlib
$(LD) $(LDFLAGS) $(SHLIB_OFLAG)$@ $^ $(LDLIBS)
endef
define make_archive
lib $(MACHINE) /out:$@ $^
endef
define make_dep
$(CC) -E $(CPPFLAGS) $(CPPFLAGS) $< | grep "^#line.*\\\\vdds\\\\" | cut -d '"' -f 2 | sort -u | sed -e 's@$(FAKEPWD)\(\\\\\)*@ @' -e 's@\\\\@/@g' -e '$$!s@$$@ \\@' -e '1s@^@$*$O: @' >$@
endef
else
$(error "$(OS) not covered by build macros for")
endif
endif
endif
endif
ifeq "$(GEN)" ""
GEN = gen
endif
%$O:
%$X:
%$(SO):
%.d:

52
ports/solaris2.6/guess-config Executable file
View file

@ -0,0 +1,52 @@
#!/bin/sh
s=`uname -s`
case "$s" in
[Dd]arwin)
# default to G4 for now
m=`uname -m`
case "$m" in
x86_64)
cfg="x86_64.darwin"
;;
*)
echo "guess-config: darwin: didn't recognize machine type $m - please fix" 2>&1
;;
esac
;;
[Ll]inux)
m=`uname -m`
case "$m" in
arm*)
cfg=arm.linux.6
;;
x86_64)
cfg=x86_64.linux.6
;;
*)
cfg=x86.linux.6
;;
esac
;;
[Ss]un[Oo][Ss]|[Ss]olaris)
m=`uname -m`:`uname -r`
#should check OS rev
case "$m" in
sun4m:5.6)
cfg="sparc.solaris2.6"
;;
sun4u:*)
cfg="sparcv9.solaris"
;;
*)
cfg="x86_64.solaris"
;;
esac
;;
*)
echo "guess-config: didn't recognize system type $s - please fix" 2>&1
;;
esac
[ -z "$cfg" ] && cfg="asjemenou"
echo $cfg

View file

@ -0,0 +1,8 @@
#ifndef DDSRT_FIXUP_INTTYPES_H
#define DDSRT_FIXUP_INTTYPES_H
#include_next "inttypes.h"
#define PRIuPTR "lu"
#define PRIxPTR "lx"
#endif /* DDSRT_FIXUP_INTTYPES_H */

View file

@ -0,0 +1,22 @@
#ifndef DDSRT_FIXUP_MATH_H
#define DDSRT_FIXUP_MATH_H
#include_next "math.h"
/* INFINITY, HUGE_VALF, HUGE_VALL are all standard C99, but Solaris 2.6
antedates that by a good margin and GCC's fixed-up headers don't
define it, so we do it here */
#undef HUGE_VAL
#ifdef __GNUC__
# define INFINITY (__builtin_inff ())
# define HUGE_VAL (__builtin_huge_val ())
# define HUGE_VALF (__builtin_huge_valf ())
# define HUGE_VALL (__builtin_huge_vall ())
#else
# define INFINITY 1e10000
# define HUGE_VAL 1e10000
# define HUGE_VALF 1e10000f
# define HUGE_VALL 1e10000L
#endif
#endif /* DDSRT_FIXUP_MATH_H */

View file

@ -0,0 +1,10 @@
#ifndef DDSRT_FIXUP_NETINET_IN_H
#define DDSRT_FIXUP_NETINET_IN_H
#include_next "netinet/in.h"
#ifndef INET_ADDRSTRLEN
#define INET_ADDRSTRLEN 16
#endif
#endif /* DDSRT_FIXUP_NETINET_IN_H */

View file

@ -0,0 +1,11 @@
#ifndef DDSRT_FIXUP_STDINT_H
#define DDSRT_FIXUP_STDINT_H
#include <sys/int_types.h>
#include <limits.h>
#ifndef UINT32_C
#define UINT32_C(v) (v ## U)
#endif
#endif /* DDSRT_FIXUP_STDINT_H */

View file

@ -0,0 +1,14 @@
#ifndef DDSRT_FIXUP_SYS_SOCKET_H
#define DDSRT_FIXUP_SYS_SOCKET_H
#include "netinet/in.h"
#include_next "sys/socket.h"
typedef size_t socklen_t;
struct sockaddr_storage {
sa_family_t ss_family;
struct sockaddr_in stuff;
};
#endif /* DDSRT_FIXUP_SYS_SOCKET_H */

59
ports/solaris2.6/makefile Normal file
View file

@ -0,0 +1,59 @@
.PHONY: all clean
include $(dir $(lastword $(MAKEFILE_LIST)))/config.mk
CPPFLAGS += -Isrc/core/ddsc/src -Isrc/core/ddsc/include -Isrc/core/ddsi/include -Isrc/ddsrt/include
CPPFLAGS += $(addprefix -I, $(wildcard src/ddsrt/src/*/include))
CPPFLAGS += -Ibuild/src/core/include -Ibuild/src/ddsrt/include
CPPFLAGS += -DDDSI_INCLUDE_NETWORK_PARTITIONS # -DDDSI_INCLUDE_BANDWIDTH_LIMITING -DDDSI_INCLUDE_NETWORK_CHANNELS
SHLIBS = ddsc
EXES = ddsperf
all: $(SHLIBS:%=$(GEN)/$(LIBPRE)%$(SO)) $(EXES:%=$(GEN)/%$X)
lib: $(SHLIBS:%=$(GEN)/$(LIBPRE)%$(SO))
clean:
rm -rf $(GEN)/*
LIBCDDS_SRCDIRS := src/core/ddsi/src src/core/ddsc/src src/ddsrt/src $(DDSRT:%=src/ddsrt/src/*/%)
LIBCDDS_SRC := $(filter-out %/getopt.c, $(wildcard $(LIBCDDS_SRCDIRS:%=%/*.c)))
ifeq "$(words $(DDSRT))" "2" # max = 2 ...
pct=%
XX=$(filter src/ddsrt/src/%/$(word 1, $(DDSRT))/, $(dir $(LIBCDDS_SRC)))
YY=$(patsubst %/$(word 1, $(DDSRT))/, %/$(word 2, $(DDSRT))/, $(XX))
LIBCDDS_SRC := $(filter-out $(YY:%=%$(pct)), $(LIBCDDS_SRC))
endif
$(GEN)/$(LIBPRE)ddsc$(SO): CPPFLAGS += -Dddsc_EXPORTS
$(GEN)/$(LIBPRE)ddsc$(SO): CPPFLAGS += -fPIC
ifneq "$(COMPILE_MANY_ATONCE)" "true"
$(GEN)/$(LIBPRE)ddsc$(SO): $(LIBCDDS_SRC:%.c=$(GEN)/%$O)
$(make_shlib)
else # /Fo bit is MSVC specific
$(GEN)/$(LIBPRE)ddsc$(SO): $(LIBCDDS_SRC)
xs="" ;\
for x in $(foreach x, $^, $(call getabspath, $x)) ; do \
[ $$x -nt $(GEN)/`basename $$x .c`$O ] && xs="$$xs $$x" ; \
done ; \
echo "compile: $$xs" ; \
[ -z "$$xs" ] || $(CC) $(CPPFLAGS) -MP8 -Fo.\\$(GEN)\\ -c $$xs
$(LD) $(LDFLAGS) $(SHLIB_OFLAG)$@ $(LIBCDDS_SC:%=$(GEN)/%$O) $(LDLIBS)
endif
DDSPERF_SRCDIRS := src/tools/ddsperf build/src/tools/ddsperf
DDSPERF_SRC := $(wildcard $(DDSPERF_SRCDIRS:%=%/*.c))
$(GEN)/ddsperf$X: LDLIBS += -L. -lddsc
$(GEN)/ddsperf$X: CPPFLAGS += -Ibuild/src/tools/ddsperf
$(GEN)/ddsperf$X: $(DDSPERF_SRC:%.c=%.o) | $(GEN)/$(LIBPRE)ddsc$(SO)
$(make_exe)
$(GEN)/%.STAMP: ; @[ -d $(dir $@) ] || { mkdir -p $(dir $@) ; touch $@ ; }
$(GEN)/%$O: %.c $(GEN)/%.STAMP
$(CC) $(CPPFLAGS) $(OBJ_OFLAG)$@ -c $<
$(GEN)/%.d: %.c
$(make_dep)

View file

@ -1,5 +1,5 @@
#
# Copyright(c) 2006 to 2018 ADLINK Technology Limited and others
# Copyright(c) 2019 ADLINK Technology Limited and others
#
# This program and the accompanying materials are made available under the
# terms of the Eclipse Public License v. 2.0 which is available at
@ -11,192 +11,21 @@
#
cmake_minimum_required(VERSION 3.7)
# Set a default build type if none was specified
set(default_build_type "RelWithDebInfo")
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
message(STATUS "Setting build type to '${default_build_type}' as none was specified.")
set(CMAKE_BUILD_TYPE "${default_build_type}" CACHE
STRING "Choose the type of build." FORCE)
# Set the possible values of build type for cmake-gui
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS
"Debug" "Release" "MinSizeRel" "RelWithDebInfo")
if(NOT ${PROJECT_NAME} STREQUAL "CycloneDDS")
get_filename_component(dir ${CMAKE_CURRENT_LIST_DIR} DIRECTORY)
message(FATAL_ERROR "Top-level CMakeLists.txt was moved to the top-level directory. Please run cmake on ${dir} instead of ${CMAKE_CURRENT_LIST_DIR}")
endif()
FUNCTION(PREPEND var prefix)
SET(listVar "")
FOREACH(f ${ARGN})
LIST(APPEND listVar "${prefix}/${f}")
ENDFOREACH(f)
SET(${var} "${listVar}" PARENT_SCOPE)
ENDFUNCTION(PREPEND)
# Update the git submodules
execute_process(COMMAND git submodule init
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})
execute_process(COMMAND git submodule update
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})
# Set module path before defining project so platform files will work.
set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake/modules")
set(CMAKE_PROJECT_NAME_FULL "Eclipse Cyclone DDS")
set(PROJECT_NAME "CycloneDDS")
project(${PROJECT_NAME} VERSION 0.1.0)
# Set some convenience variants of the project-name
string(REPLACE " " "-" CMAKE_PROJECT_NAME_DASHED "${CMAKE_PROJECT_NAME_FULL}")
string(TOUPPER ${CMAKE_PROJECT_NAME} CMAKE_PROJECT_NAME_CAPS)
string(TOLOWER ${CMAKE_PROJECT_NAME} CMAKE_PROJECT_NAME_SMALL)
set(CMAKE_C_STANDARD 99)
if(CMAKE_SYSTEM_NAME STREQUAL "VxWorks")
add_definitions(-std=c99)
endif()
if(${CMAKE_C_COMPILER_ID} STREQUAL "SunPro")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -m64 -xc99 -D__restrict=restrict -D__deprecated__=")
set(CMAKE_LINKER_FLAGS "${CMAKE_LINKER_FLAGS} -m64")
endif()
# Conan
if(EXISTS "${CMAKE_BINARY_DIR}/conanbuildinfo.cmake")
include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
if(APPLE)
# By default Conan strips all RPATHs (see conanbuildinfo.cmake), which
# causes tests to fail as the executables cannot find the library target.
# By setting KEEP_RPATHS, Conan does not set CMAKE_SKIP_RPATH and the
# resulting binaries still have the RPATH information. This is fine because
# CMake will strip the build RPATH information in the install step.
#
# NOTE:
# Conan's default approach is to use the "imports" feature, which copies
# all the dependencies into the bin directory. Of course, this doesn't work
# quite that well for libraries generated in this Project (see Conan
# documentation).
#
# See the links below for more information.
# https://github.com/conan-io/conan/issues/337
# https://docs.conan.io/en/latest/howtos/manage_shared_libraries/rpaths.html
# https://gitlab.kitware.com/cmake/community/wikis/doc/cmake/RPATH-handling
conan_basic_setup(KEEP_RPATHS)
else()
conan_basic_setup()
endif()
conan_define_targets()
endif()
# Set reasonably strict warning options for clang, gcc, msvc
# Enable coloured ouput if Ninja is used for building
if(${CMAKE_C_COMPILER_ID} STREQUAL "Clang" OR ${CMAKE_C_COMPILER_ID} STREQUAL "AppleClang")
add_definitions(-Wall -Wextra -Wconversion -Wunused)
if(${CMAKE_GENERATOR} STREQUAL "Ninja")
add_definitions(-Xclang -fcolor-diagnostics)
endif()
elseif(${CMAKE_C_COMPILER_ID} STREQUAL "GNU")
add_definitions(-Wall -Wextra -Wconversion)
if(${CMAKE_GENERATOR} STREQUAL "Ninja")
add_definitions(-fdiagnostics-color=always)
endif()
elseif(${CMAKE_C_COMPILER_ID} STREQUAL "MSVC")
add_definitions(/W3)
endif()
# I don't know how to enable warnings properly so that it ends up in Xcode projects as well
if(${CMAKE_GENERATOR} STREQUAL "Xcode")
set (CMAKE_XCODE_ATTRIBUTE_CLANG_WARN_EMPTY_BODY YES)
set (CMAKE_XCODE_ATTRIBUTE_GCC_WARN_SHADOW YES)
set (CMAKE_XCODE_ATTRIBUTE_CLANG_WARN_BOOL_CONVERSION YES)
set (CMAKE_XCODE_ATTRIBUTE_CLANG_WARN_CONSTANT_CONVERSION YES)
set (CMAKE_XCODE_ATTRIBUTE_GCC_WARN_64_TO_32_BIT_CONVERSION YES)
set (CMAKE_XCODE_ATTRIBUTE_CLANG_WARN_ENUM_CONVERSION YES)
set (CMAKE_XCODE_ATTRIBUTE_CLANG_WARN_FLOAT_CONVERSION YES)
set (CMAKE_XCODE_ATTRIBUTE_CLANG_WARN_INT_CONVERSION YES)
set (CMAKE_XCODE_ATTRIBUTE_CLANG_WARN_NON_LITERAL_NULL_CONVERSION YES)
set (CMAKE_XCODE_ATTRIBUTE_CLANG_WARN_IMPLICIT_SIGN_CONVERSION YES)
set (CMAKE_XCODE_ATTRIBUTE_CLANG_WARN_INFINITE_RECURSION YES)
set (CMAKE_XCODE_ATTRIBUTE_GCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED YES)
set (CMAKE_XCODE_ATTRIBUTE_GCC_WARN_ABOUT_RETURN_TYPE YES)
set (CMAKE_XCODE_ATTRIBUTE_GCC_WARN_MISSING_PARENTHESES YES)
set (CMAKE_XCODE_ATTRIBUTE_GCC_WARN_ABOUT_MISSING_FIELD_INITIALIZERS YES)
set (CMAKE_XCODE_ATTRIBUTE_GCC_WARN_ABOUT_MISSING_NEWLINE YES)
set (CMAKE_XCODE_ATTRIBUTE_CLANG_WARN_ASSIGN_ENUM YES)
set (CMAKE_XCODE_ATTRIBUTE_CLANG_WARN_SEMICOLON_BEFORE_METHOD_BODY YES)
set (CMAKE_XCODE_ATTRIBUTE_GCC_WARN_SIGN_COMPARE YES)
set (CMAKE_XCODE_ATTRIBUTE_CLANG_WARN_STRICT_PROTOTYPES YES)
set (CMAKE_XCODE_ATTRIBUTE_CLANG_WARN_COMMA YES)
set (CMAKE_XCODE_ATTRIBUTE_CLANG_WARN_SUSPICIOUS_IMPLICIT_CONVERSION YES)
set (CMAKE_XCODE_ATTRIBUTE_GCC_WARN_UNINITIALIZED_AUTOS YES_AGGRESSIVE)
set (CMAKE_XCODE_ATTRIBUTE_GCC_WARN_UNUSED_FUNCTION YES)
set (CMAKE_XCODE_ATTRIBUTE_GCC_WARN_UNUSED_LABEL YES)
set (CMAKE_XCODE_ATTRIBUTE_GCC_WARN_UNUSED_PARAMETER YES)
set (CMAKE_XCODE_ATTRIBUTE_GCC_WARN_UNUSED_VALUE YES)
set (CMAKE_XCODE_ATTRIBUTE_GCC_WARN_UNUSED_VARIABLE YES)
endif()
# Make it easy to enable one of Clang's/gcc's analyzers, and default to using
# the address sanitizer for ordinary debug builds; gcc is giving some grief on
# Travis, so don't enable it for gcc by default
if(NOT USE_SANITIZER)
if(${CMAKE_BUILD_TYPE} STREQUAL "Debug" AND
NOT (${CMAKE_GENERATOR} STREQUAL "Xcode") AND
(${CMAKE_C_COMPILER_ID} STREQUAL "Clang"
OR ${CMAKE_C_COMPILER_ID} STREQUAL "AppleClang"))
message(STATUS "Enabling address sanitizer; set USE_SANITIZER=none to prevent this")
set(USE_SANITIZER address)
else()
set(USE_SANITIZER none)
endif()
endif()
if(NOT (${USE_SANITIZER} STREQUAL "none"))
message(STATUS "Sanitizer set to ${USE_SANITIZER}")
add_compile_options(-fno-omit-frame-pointer -fsanitize=${USE_SANITIZER})
link_libraries(-fno-omit-frame-pointer -fsanitize=${USE_SANITIZER})
endif()
include(GNUInstallDirs)
include(AnalyzeBuild)
if(APPLE)
set(CMAKE_INSTALL_RPATH "@loader_path/../${CMAKE_INSTALL_LIBDIR}")
else()
set(CMAKE_INSTALL_RPATH "$ORIGIN/../${CMAKE_INSTALL_LIBDIR}")
endif()
# Include Coverage before CTest so that COVERAGE_COMMAND can be modified
# in the Coverage module should that ever be necessary.
include(Coverage)
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")
# By default building the testing tree is enabled by including CTest, but
# since not everybody has CUnit, and because it is not strictly required to
# build the product itself, switch to off by default.
option(BUILD_TESTING "Build the testing tree." OFF)
include(CTest)
# Build all executables and libraries into the top-level /bin and /lib folders.
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin")
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib")
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib")
add_subdirectory(idlc)
add_subdirectory(ddsrt)
add_subdirectory(etc)
# some of the tests in the core rely on preprocessing IDL, so idlc has to
# come first
if(BUILD_IDLC)
add_subdirectory(idlc)
endif()
add_subdirectory(security/api)
add_subdirectory(core)
add_subdirectory(tools)
add_subdirectory(scripts)
option(USE_DOCS "Enable documentation." OFF)
if(USE_DOCS)
add_subdirectory(docs)
else()
message(STATUS "${CMAKE_PROJECT_NAME} documentation: disabled (-DUSE_DOCS=1 to enable)")
endif()
add_subdirectory(examples)
if (BUILD_TESTING)
# Multi Process Tests
if(BUILD_TESTING AND HAVE_MULTI_PROCESS AND BUILD_IDLC)
add_subdirectory(mpt)
endif()
# Pull-in CPack and support for generating <Package>Config.cmake and packages.
include(Packaging)

View file

@ -1,31 +0,0 @@
#
# Copyright(c) 2006 to 2018 ADLINK Technology Limited and others
#
# This program and the accompanying materials are made available under the
# terms of the Eclipse Public License v. 2.0 which is available at
# http://www.eclipse.org/legal/epl-2.0, or the Eclipse Distribution License
# v. 1.0 which is available at
# http://www.eclipse.org/org/documents/edl-v10.php.
#
# SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
#
cmake_minimum_required(VERSION 3.5)
set(COVERAGE_SOURCE_DIR "@PROJECT_SOURCE_DIR@")
set(COVERAGE_RUN_DIR "@CMAKE_BINARY_DIR@")
set(COVERAGE_OUTPUT_DIR "@CMAKE_BINARY_DIR@/coverage")
# TODO: Make this a list instead of separate variables when more directories
# need to be excluded. Currently there's actually only one directory to
# be excluded, but when the test(s) are moved, more directories will be
# added. I just added two directories to indicate how the coverage
# generators handle multiple exclusion directories.
#
# Do not include the various test directories.
set(COVERAGE_EXCLUDE_TESTS "tests")
set(COVERAGE_EXCLUDE_EXAMPLES "examples")
set(COVERAGE_EXCLUDE_BUILD_SUPPORT "cmake")
# Add this flag when you want to suppress LCOV and ctest outputs during coverage collecting.
#set(COVERAGE_QUIET_FLAG "--quiet")

View file

@ -1,26 +0,0 @@
@echo off
REM Copyright(c) 2006 to 2018 ADLINK Technology Limited and others
REM
REM This program and the accompanying materials are made available under the
REM terms of the Eclipse Public License v. 2.0 which is available at
REM http://www.eclipse.org/legal/epl-2.0, or the Eclipse Distribution License
REM v. 1.0 which is available at
REM http://www.eclipse.org/org/documents/edl-v10.php.
REM
REM SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
REM VxWorks toolchain requires WIND_BASE to be exported, should the user be
REM compiling for VxWorks and not have WIND_BASE exported, do that here before
REM invoking the compiler.
if "%WIND_BASE%" == "" (
set WIND_BASE="@WIND_BASE@"
)
REM Strip C compiler from command line arguments for compatibility because
REM this launcher may also be used from an integrated development environment
REM at some point.
if "%1" == "@CMAKE_C_COMPILER@" (
shift
)
"@CMAKE_C_COMPILER@" %*

View file

@ -1,40 +0,0 @@
#!/bin/sh
#
# Copyright(c) 2006 to 2018 ADLINK Technology Limited and others
#
# This program and the accompanying materials are made available under the
# terms of the Eclipse Public License v. 2.0 which is available at
# http://www.eclipse.org/legal/epl-2.0, or the Eclipse Distribution License
# v. 1.0 which is available at
# http://www.eclipse.org/org/documents/edl-v10.php.
#
# SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
#
# VxWorks toolchain requires WIND_BASE to be exported, should the user be
# compiling for VxWorks and not have WIND_BASE exported, to that here before
# invoking the compiler.
if [ -z "${WIND_BASE}" ] && [ -n "@WIND_BASE@" ]; then
WIND_BASE="@WIND_BASE@"
export WIND_BASE
fi
if [ -n "@WIND_LMAPI@" ]; then
if [ -z "${LD_LIBRARY_PATH}" ]; then
LD_LIBRARY_PATH="@WIND_LMAPI@"
export LD_LIBRARY_PATH
elif [[ "${LD_LIBRARY_PATH}" == ?(*:)"@WIND_LMAPI@"?(:*) ]]; then
LD_LIBRARY_PATH="@WIND_LMAPI@:${LD_LIBRARY_PATH}"
export LD_LIBRARY_PATH
fi
fi
# Strip C compiler from command line arguments for compatibility because this
# launcher may also be used from an integrated development environment at some
# point.
if [ "$1" = "@CMAKE_C_COMPILER@" ]; then
shift
fi
exec "@CMAKE_C_COMPILER@" "$@"

View file

@ -1,26 +0,0 @@
@echo off
REM Copyright(c) 2006 to 2018 ADLINK Technology Limited and others
REM
REM This program and the accompanying materials are made available under the
REM terms of the Eclipse Public License v. 2.0 which is available at
REM http://www.eclipse.org/legal/epl-2.0, or the Eclipse Distribution License
REM v. 1.0 which is available at
REM http://www.eclipse.org/org/documents/edl-v10.php.
REM
REM SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
REM VxWorks toolchain requires WIND_BASE to be exported, should the user be
REM compiling for VxWorks and not have WIND_BASE exported, do that here before
REM invoking the compiler.
if "%WIND_BASE%" == "" (
set WIND_BASE="@WIND_BASE@"
)
REM Strip C compiler from command line arguments for compatibility because
REM this launcher may also be used from an integrated development environment
REM at some point.
if "%1" == "@CMAKE_CXX_COMPILER@" (
shift
)
"@CMAKE_CXX_COMPILER@" %*

View file

@ -1,40 +0,0 @@
#!/bin/sh
#
# Copyright(c) 2006 to 2018 ADLINK Technology Limited and others
#
# This program and the accompanying materials are made available under the
# terms of the Eclipse Public License v. 2.0 which is available at
# http://www.eclipse.org/legal/epl-2.0, or the Eclipse Distribution License
# v. 1.0 which is available at
# http://www.eclipse.org/org/documents/edl-v10.php.
#
# SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
#
# VxWorks toolchain requires WIND_BASE to be exported, should the user be
# compiling for VxWorks and not have WIND_BASE exported, to that here before
# invoking the compiler.
if [ -z "${WIND_BASE}" ] && [ -n "@WIND_BASE@" ]; then
WIND_BASE="@WIND_BASE@"
export WIND_BASE
fi
if [ -n "@WIND_LMAPI@" ]; then
if [ -z "${LD_LIBRARY_PATH}" ]; then
LD_LIBRARY_PATH="@WIND_LMAPI@"
export LD_LIBRARY_PATH
elif [[ "${LD_LIBRARY_PATH}" == ?(*:)"@WIND_LMAPI@"?(:*) ]]; then
LD_LIBRARY_PATH="@WIND_LMAPI@:${LD_LIBRARY_PATH}"
export LD_LIBRARY_PATH
fi
fi
# Strip C compiler from command line arguments for compatibility because this
# launcher may also be used from an integrated development environment at some
# point.
if [ "$1" = "@CMAKE_CXX_COMPILER@" ]; then
shift
fi
exec "@CMAKE_CXX_COMPILER@" "$@"

View file

@ -1,50 +0,0 @@
#
# Copyright(c) 2006 to 2018 ADLINK Technology Limited and others
#
# This program and the accompanying materials are made available under the
# terms of the Eclipse Public License v. 2.0 which is available at
# http://www.eclipse.org/legal/epl-2.0, or the Eclipse Distribution License
# v. 1.0 which is available at
# http://www.eclipse.org/org/documents/edl-v10.php.
#
# SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
#
if("${CMAKE_BUILD_TYPE}" STREQUAL "Coverage")
set(BUILD_TYPE_SUPPORTED False)
mark_as_advanced(BUILD_TYPE_SUPPORTED)
if(CMAKE_COMPILER_IS_GNUCXX)
set(BUILD_TYPE_SUPPORTED True)
elseif(("${CMAKE_C_COMPILER_ID}" MATCHES "(Apple)?[Cc]lang") AND
("${CMAKE_C_COMPILER_VERSION}" VERSION_GREATER "3.0.0"))
set(BUILD_TYPE_SUPPORTED True)
endif()
if(NOT BUILD_TYPE_SUPPORTED)
message(FATAL_ERROR "Coverage build type not supported. (GCC or Clang "
">3.0.0 required)")
endif()
# NOTE: Since either GCC or Clang is required for now, and the coverage
# flags are the same for both, there is no need for seperate branches
# to set compiler flags. That might change in the future.
# CMake has per build type compiler and linker flags. If 'Coverage' is
# chosen, the flags below are automatically inserted into CMAKE_C_FLAGS.
#
# Any optimizations are disabled to ensure coverage results are correct.
# See https://gcc.gnu.org/onlinedocs/gcc/Gcov-and-Optimization.html.
set(CMAKE_C_FLAGS_COVERAGE
"-DNDEBUG -g -O0 --coverage -fprofile-arcs -ftest-coverage")
set(CMAKE_CXX_FLAGS_COVERAGE
"-DNDEBUG -g -O0 --coverage -fprofile-arcs -ftest-coverage")
mark_as_advanced(
CMAKE_C_FLAGS_COVERAGE
CMAKE_CXX_FLAGS_COVERAGE
CMAKE_EXE_LINKER_FLAGS_COVERAGE
CMAKE_SHARED_LINKER_FLAGS_COVERAGE)
configure_file(${CMAKE_MODULE_PATH}/../CoverageSettings.cmake.in CoverageSettings.cmake @ONLY)
message(STATUS "Coverage build type available")
endif()

Binary file not shown.

Before

Width:  |  Height:  |  Size: 84 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

View file

@ -1,228 +0,0 @@
<!--
Copyright(c) 2006 to 2018 ADLINK Technology Limited and others
This program and the accompanying materials are made available under the
terms of the Eclipse Public License v. 2.0 which is available at
http://www.eclipse.org/legal/epl-2.0, or the Eclipse Distribution License
v. 1.0 which is available at
http://www.eclipse.org/org/documents/edl-v10.php.
SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
-->
<!--
Installing the Hello World! example at the USERPROFILE directory.
-->
<CPackWiXPatch>
<CPackWiXFragment Id="#PRODUCT">
<DirectoryRef Id="TARGETDIR">
<Directory Id="PersonalFolder">
<Directory Id="CYCLONEUSERDIR" Name="Cyclone DDS">
<Directory Id="CM_DP_dev.usr.CycloneDDS.examples" Name="examples">
<Directory Id="CM_DP_dev.usr.CycloneDDS.examples.helloworld" Name="helloworld">
<Directory Id="CM_DP_dev.usr.CycloneDDS.examples.helloworld.vs" Name="vs"/>
<Directory Id="CM_DP_dev.usr.CycloneDDS.examples.helloworld.generated" Name="generated"/>
</Directory>
<Directory Id="CM_DP_dev.usr.CycloneDDS.examples.roundtrip" Name="roundtrip" />
<Directory Id="CM_DP_dev.usr.CycloneDDS.examples.throughput" Name="throughput" />
</Directory>
</Directory>
</Directory>
</DirectoryRef>
<Feature Id="UserWritableExampleFeature" Display="expand" Absent="disallow" ConfigurableDirectory="CYCLONEUSERDIR" Title="Cyclone DDS Examples" Description="Example code to getting started with DDS development." Level="1">
<Feature Id="CM_C_usr" Title="Cyclone DDS Development Examples" Description="Example Development files for use with Cyclone DDS. Typically installed in the users 'Document' directory.">
<ComponentRef Id="CM_CP_dev.usr.CycloneDDS.Launcher.ApplicationShortcut" />
<ComponentRef Id="CM_CP_dev.usr.CycloneDDS.examples.environment" />
<ComponentRef Id="CM_CP_dev.usr.CycloneDDS.cmake.prefix.path" />
<!-- helloworld -->
<ComponentRef Id="CM_CP_dev.usr.CycloneDDS.examples.remove" />
<ComponentRef Id="CM_CP_dev.usr.CycloneDDS.examples.helloworld.HelloWorldData.idl" />
<ComponentRef Id="CM_CP_dev.usr.CycloneDDS.examples.helloworld.HelloWorldData.sln" />
<ComponentRef Id="CM_CP_dev.usr.CycloneDDS.examples.helloworld.HelloWorldPublisher.vcxproj" />
<ComponentRef Id="CM_CP_dev.usr.CycloneDDS.examples.helloworld.HelloWorldSubscriber.vcxproj" />
<ComponentRef Id="CM_CP_dev.usr.CycloneDDS.examples.helloworld.HelloWorldType.vcxproj" />
<ComponentRef Id="CM_CP_dev.usr.CycloneDDS.examples.helloworld.HelloWorldData.c" />
<ComponentRef Id="CM_CP_dev.usr.CycloneDDS.examples.helloworld.HelloWorldData.h" />
<ComponentRef Id="CM_CP_dev.usr.CycloneDDS.examples.helloworld.directories.props" />
<ComponentRef Id="CM_CP_dev.usr.CycloneDDS.examples.helloworld.publisher.c" />
<ComponentRef Id="CM_CP_dev.usr.CycloneDDS.examples.helloworld.subscriber.c" />
<ComponentRef Id="CM_CP_dev.usr.CycloneDDS.examples.helloworld.CMakeLists.txt" />
<!-- roundtrip -->
<ComponentRef Id="CM_CP_dev.usr.CycloneDDS.examples.roundtrip.RoundTrip.idl" />
<ComponentRef Id="CM_CP_dev.usr.CycloneDDS.examples.roundtrip.ping.c" />
<ComponentRef Id="CM_CP_dev.usr.CycloneDDS.examples.roundtrip.pong.c" />
<ComponentRef Id="CM_CP_dev.usr.CycloneDDS.examples.roundtrip.CMakeLists.txt" />
<!-- throughput -->
<ComponentRef Id="CM_CP_dev.usr.CycloneDDS.examples.throughput.Throughput.idl" />
<ComponentRef Id="CM_CP_dev.usr.CycloneDDS.examples.throughput.publisher.c" />
<ComponentRef Id="CM_CP_dev.usr.CycloneDDS.examples.throughput.subscriber.c" />
<ComponentRef Id="CM_CP_dev.usr.CycloneDDS.examples.throughput.CMakeLists.txt" />
</Feature>
</Feature>
<Component Id="CM_CP_dev.usr.CycloneDDS.examples.remove" Directory="CYCLONEUSERDIR" Guid="">
<RegistryValue Type="string" Root="HKCU" Key="Software\$(var.CPACK_PACKAGE_VENDOR)\$(var.CPACK_PACKAGE_NAME)" Name="Remove.CM_CP_dev.usr.CycloneDDS.examples" Value="Remove.CM_CP_dev.usr.CycloneDDS.examples" KeyPath="yes" />
<!-- helloworld -->
<RemoveFolder Id="Remove.CM_DP_dev.usr.CycloneDDS.examples.helloworld.vs" Directory="CM_DP_dev.usr.CycloneDDS.examples.helloworld.vs" On="uninstall"/>
<RemoveFolder Id="Remove.CM_DP_dev.usr.CycloneDDS.examples.helloworld.generated" Directory="CM_DP_dev.usr.CycloneDDS.examples.helloworld.generated" On="uninstall"/>
<RemoveFolder Id="Remove.CM_DP_dev.usr.CycloneDDS.examples.helloworld" Directory="CM_DP_dev.usr.CycloneDDS.examples.helloworld" On="uninstall"/>
<!-- roundtrip -->
<RemoveFolder Id="Remove.CM_DP_dev.usr.CycloneDDS.examples.roundtrip" Directory="CM_DP_dev.usr.CycloneDDS.examples.roundtrip" On="uninstall"/>
<!-- throughput -->
<RemoveFolder Id="Remove.CM_DP_dev.usr.CycloneDDS.examples.throughput" Directory="CM_DP_dev.usr.CycloneDDS.examples.throughput" On="uninstall"/>
<RemoveFolder Id="Remove.CM_DP_dev.usr.CycloneDDS.examples" Directory="CM_DP_dev.usr.CycloneDDS.examples" On="uninstall"/>
<RemoveFolder Id="Remove.CM_DP_dev.usr.CycloneDDS" Directory="CYCLONEUSERDIR" On="uninstall"/>
</Component>
<!-- Hello World - files -->
<Component Id="CM_CP_dev.usr.CycloneDDS.examples.helloworld.HelloWorldData.idl" Directory="CM_DP_dev.usr.CycloneDDS.examples.helloworld" Guid="">
<RegistryValue Type="string" Root="HKCU" Key="Software\$(var.CPACK_PACKAGE_VENDOR)\$(var.CPACK_PACKAGE_NAME)" Name="CM_FP_usr.usr.CycloneDDS.examples.helloworld.HelloWorldData.idl" Value="CM_FP_usr.usr.CycloneDDS.examples.helloworld.HelloWorldData.idl" KeyPath="yes" />
<File Id="CM_FP_usr.usr.CycloneDDS.examples.helloworld.HelloWorldData.idl" Source="$(sys.SOURCEFILEDIR)/$(var.CPACK_PACKAGE_NAME)-$(var.CPACK_PACKAGE_VERSION)-win64/dev/share/CycloneDDS/examples/helloworld/HelloWorldData.idl" KeyPath="no"/>
</Component>
<Component Id="CM_CP_dev.usr.CycloneDDS.examples.helloworld.HelloWorldData.sln" Directory="CM_DP_dev.usr.CycloneDDS.examples.helloworld" Guid="">
<RegistryValue Type="string" Root="HKCU" Key="Software\$(var.CPACK_PACKAGE_VENDOR)\$(var.CPACK_PACKAGE_NAME)" Name="CM_FP_usr.usr.CycloneDDS.examples.helloworld.HelloWorld.sln" Value="CM_FP_usr.usr.CycloneDDS.examples.helloworld.HelloWorld.sln" KeyPath="yes" />
<File Id="CM_FP_usr.usr.CycloneDDS.examples.helloworld.HelloWorld.sln" Source="$(sys.SOURCEFILEDIR)/$(var.CPACK_PACKAGE_NAME)-$(var.CPACK_PACKAGE_VERSION)-win64/dev/share/CycloneDDS/examples/helloworld/HelloWorld.sln" KeyPath="no"/>
</Component>
<Component Id="CM_CP_dev.usr.CycloneDDS.examples.helloworld.HelloWorldPublisher.vcxproj" Directory="CM_DP_dev.usr.CycloneDDS.examples.helloworld.vs" Guid="">
<RegistryValue Type="string" Root="HKCU" Key="Software\$(var.CPACK_PACKAGE_VENDOR)\$(var.CPACK_PACKAGE_NAME)" Name="CM_CP_dev.usr.CycloneDDS.examples.helloworld.HelloWorldPublisher.vcxproj" Value="CM_CP_dev.usr.CycloneDDS.examples.helloworld.HelloWorldPublisher.vcxproj" KeyPath="yes" />
<File Id="CM_FP_usr.usr.CycloneDDS.examples.helloworld.HelloWorldPublisher.vcxproj" Source="$(sys.SOURCEFILEDIR)/$(var.CPACK_PACKAGE_NAME)-$(var.CPACK_PACKAGE_VERSION)-win64/dev/share/CycloneDDS/examples/helloworld/vs/HelloWorldPublisher.vcxproj" KeyPath="no"/>
</Component>
<Component Id="CM_CP_dev.usr.CycloneDDS.examples.helloworld.HelloWorldSubscriber.vcxproj" Directory="CM_DP_dev.usr.CycloneDDS.examples.helloworld.vs" Guid="">
<RegistryValue Type="string" Root="HKCU" Key="Software\$(var.CPACK_PACKAGE_VENDOR)\$(var.CPACK_PACKAGE_NAME)" Name="CM_CP_dev.usr.CycloneDDS.examples.helloworld.HelloWorldSubscriber.vcxproj" Value="CM_CP_dev.usr.CycloneDDS.examples.helloworld.HelloWorldSubscriber.vcxproj" KeyPath="yes" />
<File Id="CM_FP_usr.usr.CycloneDDS.examples.helloworld.HelloWorldSubscriber.vcxproj" Source="$(sys.SOURCEFILEDIR)/$(var.CPACK_PACKAGE_NAME)-$(var.CPACK_PACKAGE_VERSION)-win64/dev/share/CycloneDDS/examples/helloworld/vs/HelloWorldSubscriber.vcxproj" KeyPath="no"/>
</Component>
<Component Id="CM_CP_dev.usr.CycloneDDS.examples.helloworld.HelloWorldType.vcxproj" Directory="CM_DP_dev.usr.CycloneDDS.examples.helloworld.vs" Guid="">
<RegistryValue Type="string" Root="HKCU" Key="Software\$(var.CPACK_PACKAGE_VENDOR)\$(var.CPACK_PACKAGE_NAME)" Name="CM_CP_dev.usr.CycloneDDS.examples.helloworld.HelloWorldType.vcxproj" Value="CM_CP_dev.usr.CycloneDDS.examples.helloworld.HelloWorldType.vcxproj" KeyPath="yes" />
<File Id="CM_FP_usr.usr.CycloneDDS.examples.helloworld.HelloWorldType.vcxproj" Source="$(sys.SOURCEFILEDIR)/$(var.CPACK_PACKAGE_NAME)-$(var.CPACK_PACKAGE_VERSION)-win64/dev/share/CycloneDDS/examples/helloworld/vs/HelloWorldType.vcxproj" KeyPath="no"/>
</Component>
<Component Id="CM_CP_dev.usr.CycloneDDS.examples.helloworld.directories.props" Directory="CM_DP_dev.usr.CycloneDDS.examples.helloworld.vs" Guid="">
<RegistryValue Type="string" Root="HKCU" Key="Software\$(var.CPACK_PACKAGE_VENDOR)\$(var.CPACK_PACKAGE_NAME)" Name="CM_CP_dev.usr.CycloneDDS.examples.helloworld.directories.props" Value="CM_CP_dev.usr.CycloneDDS.examples.helloworld.directories.props" KeyPath="yes" />
<File Id="CM_FP_usr.usr.CycloneDDS.examples.helloworld.directories.props" Source="$(sys.SOURCEFILEDIR)/$(var.CPACK_PACKAGE_NAME)-$(var.CPACK_PACKAGE_VERSION)-win64/dev/share/CycloneDDS/examples/helloworld/vs/directories.props" KeyPath="no"/>
</Component>
<Component Id="CM_CP_dev.usr.CycloneDDS.examples.helloworld.HelloWorldData.c" Directory="CM_DP_dev.usr.CycloneDDS.examples.helloworld.generated" Guid="">
<RegistryValue Type="string" Root="HKCU" Key="Software\$(var.CPACK_PACKAGE_VENDOR)\$(var.CPACK_PACKAGE_NAME)" Name="CM_CP_dev.usr.CycloneDDS.examples.helloworld.HelloWorldData.c" Value="CM_CP_dev.usr.CycloneDDS.examples.helloworld.HelloWorldData.c" KeyPath="yes" />
<File Id="CM_FP_usr.usr.CycloneDDS.examples.helloworld.HelloWorldData.c" Source="$(sys.SOURCEFILEDIR)/$(var.CPACK_PACKAGE_NAME)-$(var.CPACK_PACKAGE_VERSION)-win64/dev/share/CycloneDDS/examples/helloworld/generated/HelloWorldData.c" KeyPath="no"/>
</Component>
<Component Id="CM_CP_dev.usr.CycloneDDS.examples.helloworld.HelloWorldData.h" Directory="CM_DP_dev.usr.CycloneDDS.examples.helloworld.generated" Guid="">
<RegistryValue Type="string" Root="HKCU" Key="Software\$(var.CPACK_PACKAGE_VENDOR)\$(var.CPACK_PACKAGE_NAME)" Name="CM_CP_dev.usr.CycloneDDS.examples.helloworld.HelloWorldData.h" Value="CM_CP_dev.usr.CycloneDDS.examples.helloworld.HelloWorldData.h" KeyPath="yes" />
<File Id="CM_FP_usr.usr.CycloneDDS.examples.helloworld.HelloWorldData.h" Source="$(sys.SOURCEFILEDIR)/$(var.CPACK_PACKAGE_NAME)-$(var.CPACK_PACKAGE_VERSION)-win64/dev/share/CycloneDDS/examples/helloworld/generated/HelloWorldData.h" KeyPath="no"/>
</Component>
<Component Id="CM_CP_dev.usr.CycloneDDS.examples.helloworld.publisher.c" Directory="CM_DP_dev.usr.CycloneDDS.examples.helloworld" Guid="">
<RegistryValue Type="string" Root="HKCU" Key="Software\$(var.CPACK_PACKAGE_VENDOR)\$(var.CPACK_PACKAGE_NAME)" Name="CM_CP_dev.usr.CycloneDDS.examples.helloworld.publisher.c" Value="CM_CP_dev.usr.CycloneDDS.examples.helloworld.publisher.c" KeyPath="yes" />
<File Id="CM_FP_usr.usr.CycloneDDS.examples.helloworld.publisher.c" Source="$(sys.SOURCEFILEDIR)/$(var.CPACK_PACKAGE_NAME)-$(var.CPACK_PACKAGE_VERSION)-win64/dev/share/CycloneDDS/examples/helloworld/publisher.c" KeyPath="no"/>
</Component>
<Component Id="CM_CP_dev.usr.CycloneDDS.examples.helloworld.subscriber.c" Directory="CM_DP_dev.usr.CycloneDDS.examples.helloworld" Guid="">
<RegistryValue Type="string" Root="HKCU" Key="Software\$(var.CPACK_PACKAGE_VENDOR)\$(var.CPACK_PACKAGE_NAME)" Name="CM_CP_dev.usr.CycloneDDS.examples.helloworld.subscriber.c" Value="CM_CP_dev.usr.CycloneDDS.examples.helloworld.subscriber.c" KeyPath="yes" />
<File Id="CM_FP_usr.usr.CycloneDDS.examples.helloworld.subscriber.c" Source="$(sys.SOURCEFILEDIR)/$(var.CPACK_PACKAGE_NAME)-$(var.CPACK_PACKAGE_VERSION)-win64/dev/share/CycloneDDS/examples/helloworld/subscriber.c" KeyPath="no"/>
</Component>
<Component Id="CM_CP_dev.usr.CycloneDDS.examples.helloworld.CMakeLists.txt" Directory="CM_DP_dev.usr.CycloneDDS.examples.helloworld" Guid="">
<RegistryValue Type="string" Root="HKCU" Key="Software\$(var.CPACK_PACKAGE_VENDOR)\$(var.CPACK_PACKAGE_NAME)" Name="CM_CP_dev.usr.CycloneDDS.examples.helloworld.CMakeLists.txt" Value="CM_CP_dev.usr.CycloneDDS.examples.helloworld.CMakeLists.txt" KeyPath="yes" />
<File Id="CM_FP_usr.usr.CycloneDDS.examples.helloworld.CMakeLists.txt" Source="$(sys.SOURCEFILEDIR)/$(var.CPACK_PACKAGE_NAME)-$(var.CPACK_PACKAGE_VERSION)-win64/dev/share/CycloneDDS/examples/helloworld/CMakeLists.txt" KeyPath="no"/>
</Component>
<!-- RoundTrip - files -->
<Component Id="CM_CP_dev.usr.CycloneDDS.examples.roundtrip.CMakeLists.txt" Directory="CM_DP_dev.usr.CycloneDDS.examples.roundtrip" Guid="">
<RegistryValue Type="string" Root="HKCU" Key="Software\$(var.CPACK_PACKAGE_VENDOR)\$(var.CPACK_PACKAGE_NAME)" Name="CM_CP_dev.usr.CycloneDDS.examples.roundtrip.CMakeLists.txt" Value="CM_CP_dev.usr.CycloneDDS.examples.roundtrip.CMakeLists.txt" KeyPath="yes" />
<File Id="CM_FP_usr.usr.CycloneDDS.examples.roundtrip.CMakeLists.txt" Source="$(sys.SOURCEFILEDIR)/$(var.CPACK_PACKAGE_NAME)-$(var.CPACK_PACKAGE_VERSION)-win64/dev/share/CycloneDDS/examples/roundtrip/CMakeLists.txt" KeyPath="no"/>
</Component>
<Component Id="CM_CP_dev.usr.CycloneDDS.examples.roundtrip.RoundTrip.idl" Directory="CM_DP_dev.usr.CycloneDDS.examples.roundtrip" Guid="">
<RegistryValue Type="string" Root="HKCU" Key="Software\$(var.CPACK_PACKAGE_VENDOR)\$(var.CPACK_PACKAGE_NAME)" Name="CM_CP_dev.usr.CycloneDDS.examples.roundtrip.RoundTrip.idl" Value="CM_CP_dev.usr.CycloneDDS.examples.roundtrip.RoundTrip.idl" KeyPath="yes" />
<File Id="CM_FP_usr.usr.CycloneDDS.examples.roundtrip.RoundTrip.idl" Source="$(sys.SOURCEFILEDIR)/$(var.CPACK_PACKAGE_NAME)-$(var.CPACK_PACKAGE_VERSION)-win64/dev/share/CycloneDDS/examples/roundtrip/RoundTrip.idl" KeyPath="no"/>
</Component>
<Component Id="CM_CP_dev.usr.CycloneDDS.examples.roundtrip.ping.c" Directory="CM_DP_dev.usr.CycloneDDS.examples.roundtrip" Guid="">
<RegistryValue Type="string" Root="HKCU" Key="Software\$(var.CPACK_PACKAGE_VENDOR)\$(var.CPACK_PACKAGE_NAME)" Name="CM_CP_dev.usr.CycloneDDS.examples.roundtrip.ping.c" Value="CM_CP_dev.usr.CycloneDDS.examples.roundtrip.ping.c" KeyPath="yes" />
<File Id="CM_FP_usr.usr.CycloneDDS.examples.roundtrip.ping.c" Source="$(sys.SOURCEFILEDIR)/$(var.CPACK_PACKAGE_NAME)-$(var.CPACK_PACKAGE_VERSION)-win64/dev/share/CycloneDDS/examples/roundtrip/ping.c" KeyPath="no"/>
</Component>
<Component Id="CM_CP_dev.usr.CycloneDDS.examples.roundtrip.pong.c" Directory="CM_DP_dev.usr.CycloneDDS.examples.roundtrip" Guid="">
<RegistryValue Type="string" Root="HKCU" Key="Software\$(var.CPACK_PACKAGE_VENDOR)\$(var.CPACK_PACKAGE_NAME)" Name="CM_CP_dev.usr.CycloneDDS.examples.roundtrip.pong.c" Value="CM_CP_dev.usr.CycloneDDS.examples.roundtrip.pong.c" KeyPath="yes" />
<File Id="CM_FP_usr.usr.CycloneDDS.examples.roundtrip.pong.c" Source="$(sys.SOURCEFILEDIR)/$(var.CPACK_PACKAGE_NAME)-$(var.CPACK_PACKAGE_VERSION)-win64/dev/share/CycloneDDS/examples/roundtrip/pong.c" KeyPath="no"/>
</Component>
<!-- Throughput - files -->
<Component Id="CM_CP_dev.usr.CycloneDDS.examples.throughput.CMakeLists.txt" Directory="CM_DP_dev.usr.CycloneDDS.examples.throughput" Guid="">
<RegistryValue Type="string" Root="HKCU" Key="Software\$(var.CPACK_PACKAGE_VENDOR)\$(var.CPACK_PACKAGE_NAME)" Name="CM_CP_dev.usr.CycloneDDS.examples.throughput.CMakeLists.txt" Value="CM_CP_dev.usr.CycloneDDS.examples.throughput.CMakeLists.txt" KeyPath="yes" />
<File Id="CM_FP_usr.usr.CycloneDDS.examples.throughput.CMakeLists.txt" Source="$(sys.SOURCEFILEDIR)/$(var.CPACK_PACKAGE_NAME)-$(var.CPACK_PACKAGE_VERSION)-win64/dev/share/CycloneDDS/examples/throughput/CMakeLists.txt" KeyPath="no"/>
</Component>
<Component Id="CM_CP_dev.usr.CycloneDDS.examples.throughput.Throughput.idl" Directory="CM_DP_dev.usr.CycloneDDS.examples.throughput" Guid="">
<RegistryValue Type="string" Root="HKCU" Key="Software\$(var.CPACK_PACKAGE_VENDOR)\$(var.CPACK_PACKAGE_NAME)" Name="CM_CP_dev.usr.CycloneDDS.examples.throughput.Throughput.idl" Value="CM_CP_dev.usr.CycloneDDS.examples.throughput.Throughput.idl" KeyPath="yes" />
<File Id="CM_FP_usr.usr.CycloneDDS.examples.throughput.Throughput.idl" Source="$(sys.SOURCEFILEDIR)/$(var.CPACK_PACKAGE_NAME)-$(var.CPACK_PACKAGE_VERSION)-win64/dev/share/CycloneDDS/examples/throughput/Throughput.idl" KeyPath="no"/>
</Component>
<Component Id="CM_CP_dev.usr.CycloneDDS.examples.throughput.publisher.c" Directory="CM_DP_dev.usr.CycloneDDS.examples.throughput" Guid="">
<RegistryValue Type="string" Root="HKCU" Key="Software\$(var.CPACK_PACKAGE_VENDOR)\$(var.CPACK_PACKAGE_NAME)" Name="CM_CP_dev.usr.CycloneDDS.examples.throughput.publisher.c" Value="CM_CP_dev.usr.CycloneDDS.examples.throughput.publisher.c" KeyPath="yes" />
<File Id="CM_FP_usr.usr.CycloneDDS.examples.throughput.publisher.c" Source="$(sys.SOURCEFILEDIR)/$(var.CPACK_PACKAGE_NAME)-$(var.CPACK_PACKAGE_VERSION)-win64/dev/share/CycloneDDS/examples/throughput/publisher.c" KeyPath="no"/>
</Component>
<Component Id="CM_CP_dev.usr.CycloneDDS.examples.throughput.subscriber.c" Directory="CM_DP_dev.usr.CycloneDDS.examples.throughput" Guid="">
<RegistryValue Type="string" Root="HKCU" Key="Software\$(var.CPACK_PACKAGE_VENDOR)\$(var.CPACK_PACKAGE_NAME)" Name="CM_CP_dev.usr.CycloneDDS.examples.throughput.subscriber.c" Value="CM_CP_dev.usr.CycloneDDS.examples.throughput.subscriber.c" KeyPath="yes" />
<File Id="CM_FP_usr.usr.CycloneDDS.examples.throughput.subscriber.c" Source="$(sys.SOURCEFILEDIR)/$(var.CPACK_PACKAGE_NAME)-$(var.CPACK_PACKAGE_VERSION)-win64/dev/share/CycloneDDS/examples/throughput/subscriber.c" KeyPath="no"/>
</Component>
<!-- Add the location of the ddsc.dll to the system path -->
<Component Id="CM_CP_dev.usr.CycloneDDS.examples.environment" Directory="CYCLONEUSERDIR" Guid="">
<!-- CreateFolder and RegistryValue are needed to keep Wix happy -->
<CreateFolder Directory="CYCLONEUSERDIR"/>
<RegistryValue Type="string" Root="HKCU" Key="Software\$(var.CPACK_PACKAGE_VENDOR)\$(var.CPACK_PACKAGE_NAME)" Name="CM_CP_dev.usr.CycloneDDS.environment" Value="CM_CP_dev.usr.CycloneDDS.environment" KeyPath="yes" />
<Environment Action="set" Id="CycloneDDSPath" Name="PATH" Part="last" Permanent="yes" System="yes" Value="[INSTALL_ROOT]bin"/>
</Component>
<Component Id="CM_CP_dev.usr.CycloneDDS.cmake.prefix.path" Directory="CYCLONEUSERDIR" Guid="">
<!-- CreateFolder and RegistryValue are needed to keep Wix happy -->
<CreateFolder Directory="CYCLONEUSERDIR"/>
<RegistryValue Type="string" Root="HKCU" Key="Software\$(var.CPACK_PACKAGE_VENDOR)\$(var.CPACK_PACKAGE_NAME)" Name="CM_CP_dev.usr.CycloneDDS.cmake.prefix.path" Value="CM_CP_dev.usr.CycloneDDS.cmake.prefix.path" KeyPath="yes" />
<Environment Action="set" Id="CMakePrefixPath" Name="CMAKE_PREFIX_PATH" Permanent="no" Value="[INSTALL_ROOT]share/CycloneDDS"/>
</Component>
<!-- Offer the user the ability the start the launcher -->
<Property Id="WIXUI_EXITDIALOGOPTIONALTEXT" Value="After clicking Finish, the Vortex DDS Launcher will start (if indicated below). The Vortex DDS Laucher will help to get started with Cyclone DDS." />
<Property Id="WIXUI_EXITDIALOGOPTIONALCHECKBOX" Value="1"/>
<Property Id="WIXUI_EXITDIALOGOPTIONALCHECKBOXTEXT" Value="Start the Vortex DDS Launcher" />
<Property Id="WixShellExecTarget" Value="[INSTALL_ROOT]/bin/vortexddslauncher.exe" />
<CustomAction Id="CM_CA_dev.user.CycloneDDS.Launcher.Launch" BinaryKey="WixCA" DllEntry="WixShellExec" Impersonate="yes" />
<UI>
<UIRef Id="$(var.CPACK_WIX_UI_REF)" />
<Publish Dialog="ExitDialog" Control="Finish" Event="DoAction" Value="CM_CA_dev.user.CycloneDDS.Launcher.Launch">WIXUI_EXITDIALOGOPTIONALCHECKBOX = 1 and NOT Installed</Publish>
</UI>
<!-- Create start-menu -->
<DirectoryRef Id="TARGETDIR">
<Directory Id="ProgramMenuFolder">
<Directory Id="ApplicationProgramsFolder" Name="Cyclone DDS"/>
</Directory>
</DirectoryRef>
<DirectoryRef Id="ApplicationProgramsFolder">
<Component Id="CM_CP_dev.usr.CycloneDDS.Launcher.ApplicationShortcut" Guid="C21831A3-FBCE-44D0-A098-A1F21FD4846F">
<Shortcut Id="ApplicationStartMenuShortcut"
Name="CycloneDDS Launcher"
Directory="ApplicationProgramsFolder"
Description="My Application Description"
Target="[INSTALL_ROOT]/bin/vortexddslauncher.exe"
Icon="ShortcutIcon"
IconIndex="0">
<Icon Id="ShortcutIcon" SourceFile="$(var.CPACK_WIX_PRODUCT_ICON)" />
</Shortcut>
<RemoveFolder Id="CleanUpShortCut" Directory="ApplicationProgramsFolder" On="uninstall"/>
<RegistryValue Root="HKCU" Key="Software\AdLink" Name="installed" Type="integer" Value="1" KeyPath="yes"/>
</Component>
</DirectoryRef>
</CPackWiXFragment>
</CPackWiXPatch>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 30 KiB

View file

@ -1,213 +0,0 @@
#
# Copyright(c) 2006 to 2018 ADLINK Technology Limited and others
#
# This program and the accompanying materials are made available under the
# terms of the Eclipse Public License v. 2.0 which is available at
# http://www.eclipse.org/legal/epl-2.0, or the Eclipse Distribution License
# v. 1.0 which is available at
# http://www.eclipse.org/org/documents/edl-v10.php.
#
# SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
#
#
# CMake Platform file for VxWorks
#
# This file will be used as platform file if CMAKE_SYSTEM_NAME is defined
# as VxWorks in the toolchain file.
#
# Most information is resolved by analyzing the absolute location of the
# compiler on the file system, but can be overridden if required.
#
# Setting CMAKE_SYSTEM_PROCESSOR is mandatory. The variable should be set to
# e.g. ARMARCH* if the target architecture is arm.
#
# NOTES:
# * For now support for VxWorks Diab compiler will NOT be implemented.
# * If certain settings are not explicitly defined, this platform file will
# try to deduce it from the installation path. It will, however, not go out
# of it's way to validate and cross-reference settings.
#
# https://cmake.org/Wiki/CMake_Cross_Compiling
#
if((NOT "${CMAKE_GENERATOR}" MATCHES "Makefiles") AND
(NOT "${CMAKE_GENERATOR}" MATCHES "Ninja"))
message(FATAL_ERROR "Cross compilation for VxWorks is not supported for "
"${CMAKE_GENERATOR}")
endif()
set(WIND_PROCESSOR_TYPE_PATTERN ".*(cc|c\\+\\+)(arm|mips|pentium|ppc).*")
set(WIND_HOST_TYPE_PATTERN "^x86-(linux2|win32)$")
set(WIND_PLATFORM_PATTERN "^[0-9\.]+-vxworks-([0-9\.]+)$")
# Try to deduce the system architecture from either CMAKE_C_COMPILER or
# CMAKE_CXX_COMPILER (one of which must be specified).
#
# Path examples:
# <WindRiver>/gnu/4.3.3-vxworks-6.9/x86-linux2/bin
# <WindRiver>/gnu/4.1.2-vxworks-6.8/x86-win32/bin
foreach(COMPILER CMAKE_C_COMPILER CMAKE_CXX_COMPILER)
if("${${COMPILER}}" MATCHES "${WIND_PROCESSOR_TYPE_PATTERN}")
string(
REGEX REPLACE
"${WIND_PROCESSOR_TYPE_PATTERN}" "\\2"
PROCESSOR_TYPE
${${COMPILER}})
if(NOT WIND_PROCESSOR_TYPE)
set(WIND_PROCESSOR_TYPE ${PROCESSOR_TYPE})
endif()
get_filename_component(COMPILER_NAME "${${COMPILER}}" NAME)
if((NOT "${COMPILER_NAME}" STREQUAL "${${COMPILER}}") AND
(NOT "${COMPILER_DIRECTORY}"))
get_filename_component(
COMPILER_PATH "${${COMPILER}}" REALPATH)
get_filename_component(
COMPILER_DIRECTORY "${COMPILER_PATH}" DIRECTORY)
endif()
else()
message(FATAL_ERROR "${COMPILER} did not conform to the expected "
"executable format. i.e. it did not end with "
"arm, mips, pentium, or ppc.")
endif()
endforeach()
get_filename_component(C_COMPILER_NAME "${CMAKE_C_COMPILER}" NAME)
get_filename_component(CXX_COMPILER_NAME "${CMAKE_CXX_COMPILER}" NAME)
# Ideally the location of the compiler should be resolved at this, but invoke
# find_program as a last resort.
if(NOT COMPILER_DIRECTORY)
find_program(
COMPILER_PATH NAMES "${C_COMPILER_NAME}" "${CXX_COMPILER_NAME}")
if(COMPILER_PATH)
get_filename_component(
COMPILER_DIRECTORY "${COMPILER_PATH}" COMPILER_PATH)
else()
# The compiler must be successfully be detected by now.
message(FATAL_ERROR "Could not determine location of compiler path.")
endif()
endif()
get_filename_component(basename "${COMPILER_DIRECTORY}" NAME)
get_filename_component(basedir "${COMPILER_DIRECTORY}" DIRECTORY)
while(basename)
if("${basename}" MATCHES "${WIND_PLATFORM_PATTERN}")
string(
REGEX REPLACE "${WIND_PLATFORM_PATTERN}" "\\1" version ${basename})
if(NOT CMAKE_SYSTEM_VERSION)
set(CMAKE_SYSTEM_VERSION ${version})
endif()
# The current base directory may be the WindRiver directory depending
# on wether a "gnu" directory exists or not, but that is evaluated in
# the next iteration.
set(WIND_HOME "${basedir}")
set(WIND_PLATFORM "${basename}")
elseif(CMAKE_SYSTEM_VERSION AND WIND_HOME AND WIND_HOST_TYPE)
# The "gnu" directory may not be part of the path. If it is, strip it.
if("${basename}" STREQUAL "gnu")
set(WIND_HOME "${basedir}")
endif()
break()
elseif("${basename}" MATCHES "${WIND_HOST_TYPE_PATTERN}")
set(WIND_HOST_TYPE "${basename}")
endif()
get_filename_component(basename ${basedir} NAME)
get_filename_component(basedir ${basedir} DIRECTORY)
endwhile()
# VxWorks commands require the WIND_BASE environment variable, so this script
# will support it too. If the environment variable is not set, the necessary
# path information is deduced from the compiler path.
if(NOT WIND_BASE)
set(WIND_BASE $ENV{WIND_BASE})
endif()
if(NOT WIND_BASE)
set(WIND_BASE "${WIND_HOME}/vxworks-${CMAKE_SYSTEM_VERSION}")
endif()
# Verify the location WIND_BASE references actually exists.
if(NOT EXISTS ${WIND_BASE})
message(FATAL_ERROR "VxWorks base directory ${WIND_BASE} does not exist, "
"please ensure the toolchain information is correct.")
elseif(NOT ENV{WIND_BASE})
# WIND_BASE environment variable must be exported during generation
# otherwise compiler tests will fail.
set(ENV{WIND_BASE} "${WIND_BASE}")
endif()
if(NOT CMAKE_C_COMPILER_VERSION)
execute_process(
COMMAND "${CMAKE_C_COMPILER}" -dumpversion
OUTPUT_VARIABLE CMAKE_C_COMPILER_VERSION)
string(STRIP "${CMAKE_C_COMPILER_VERSION}" CMAKE_C_COMPILER_VERSION)
message(STATUS "VxWorks C compiler version ${CMAKE_C_COMPILER_VERSION}")
endif()
if(NOT CMAKE_CXX_COMPILER_VERSION)
execute_process(
COMMAND "${CMAKE_CXX_COMPILER}" -dumpversion
OUTPUT_VARIABLE CMAKE_CXX_COMPILER_VERSION)
string(STRIP "${CMAKE_CXX_COMPILER_VERSION}" CMAKE_CXX_COMPILER_VERSION)
message(STATUS "VxWorks CXX compiler version ${CMAKE_C_COMPILER_VERSION}")
endif()
set(CMAKE_C_COMPILER_ID GNU)
set(CMAKE_CXX_COMPILER_ID GNU)
# CMAKE_SOURCE_DIR does not resolve to the actual source directory because
# platform files are processed to early on in the process.
set(ROOT "${CMAKE_MODULE_PATH}/../")
if(WIN32)
set(CMAKE_C_COMPILER_LAUNCHER "${CMAKE_BINARY_DIR}/launch-c.bat")
set(CMAKE_CXX_COMPILER_LAUNCHER "${CMAKE_BINARY_DIR}/launch-cxx.bat")
configure_file(
"${ROOT}/launch-c.bat.in" "${CMAKE_C_COMPILER_LAUNCHER}" @ONLY)
configure_file(
"${ROOT}/launch-cxx.bat.in" "${CMAKE_CXX_COMPILER_LAUNCHER}" @ONLY)
else()
# Check if a directory like lmapi-* exists (VxWorks 6.9) and append it to
# LD_LIBRARY_PATH.
file(GLOB WIND_LMAPI LIST_DIRECTORIES true "${WIND_HOME}/lmapi-*")
if(WIND_LMAPI)
set(WIND_LMAPI "${WIND_LMAPI}/${WIND_HOST_TYPE}/lib")
endif()
set(CMAKE_C_COMPILER_LAUNCHER "${CMAKE_BINARY_DIR}/launch-c")
set(CMAKE_CXX_COMPILER_LAUNCHER "${CMAKE_BINARY_DIR}/launch-cxx")
configure_file(
"${ROOT}/launch-c.in" "${CMAKE_C_COMPILER_LAUNCHER}" @ONLY)
configure_file(
"${ROOT}/launch-cxx.in" "${CMAKE_CXX_COMPILER_LAUNCHER}" @ONLY)
execute_process(COMMAND chmod a+rx "${CMAKE_C_COMPILER_LAUNCHER}")
execute_process(COMMAND chmod a+rx "${CMAKE_CXX_COMPILER_LAUNCHER}")
endif()
set(WIND_INCLUDE_DIRECTORY "${WIND_BASE}/target/h")
# Versions before 6.8 have a different path for common libs.
if("${CMAKE_SYSTEM_VERSION}" VERSION_GREATER "6.8")
set(WIND_LIBRARY_DIRECTORY "${WIND_BASE}/target/lib/usr/lib/${WIND_PROCESSOR_TYPE}/${CMAKE_SYSTEM_PROCESSOR}/common")
else()
set(WIND_LIBRARY_DIRECTORY "${WIND_BASE}/target/usr/lib/${WIND_PROCESSOR_TYPE}/${CMAKE_SYSTEM_PROCESSOR}/common")
endif()
if(NOT EXISTS "${WIND_LIBRARY_DIRECTORY}")
message(FATAL_ERROR "${CMAKE_SYSTEM_PROCESSOR} is not part of the "
"${WIND_PROCESSOR_TYPE} processor family.")
endif()
include_directories(BEFORE SYSTEM "${WIND_INCLUDE_DIRECTORY}")
link_directories("${WIND_LIBRARY_DIRECTORY}")

View file

@ -1,134 +0,0 @@
#
# Copyright(c) 2006 to 2018 ADLINK Technology Limited and others
#
# This program and the accompanying materials are made available under the
# terms of the Eclipse Public License v. 2.0 which is available at
# http://www.eclipse.org/legal/epl-2.0, or the Eclipse Distribution License
# v. 1.0 which is available at
# http://www.eclipse.org/org/documents/edl-v10.php.
#
# SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
#
#
# This script will run all tests and generates various coverage reports.
#
# Example usage:
# $ cmake -DCOVERAGE_SETTINGS=<cham bld>/CoverageSettings.cmake -P <cham src>/cmake/scripts/CoverageConvenience.cmake
# If you start the scripts while in <cham bld> then you don't have to provide the COVERAGE_SETTINGS file.
#
cmake_minimum_required(VERSION 3.5)
# Get Coverage configuration file
if(NOT COVERAGE_SETTINGS)
set(COVERAGE_SETTINGS ${CMAKE_CURRENT_BINARY_DIR}/CoverageSettings.cmake)
endif()
include(${COVERAGE_SETTINGS})
message(STATUS "Config file: ${COVERAGE_SETTINGS}")
message(STATUS "Source directory: ${COVERAGE_SOURCE_DIR}")
message(STATUS "Test directory: ${COVERAGE_RUN_DIR}")
message(STATUS "Output directory: ${COVERAGE_OUTPUT_DIR}")
set(COVERAGE_SCRIPTS_DIR "${COVERAGE_SOURCE_DIR}/cmake/scripts")
###############################################################################
#
# Detect generators
#
###############################################################################
set(GENERATE_COVERAGE TRUE)
if(GENERATE_COVERAGE)
find_program(GCOV_PATH gcov PARENT_SCOPE)
if(NOT GCOV_PATH)
set(GENERATE_COVERAGE FALSE)
message(STATUS "[SKIP] Coverage generators - gcov (could not find gcov)")
endif()
endif()
if(GENERATE_COVERAGE)
message(STATUS "[ OK ] Coverage generators - gcov")
endif()
set(GENERATE_COVERAGE_HTML TRUE)
if(GENERATE_COVERAGE_HTML)
find_program(LCOV_PATH lcov PARENT_SCOPE)
if(NOT LCOV_PATH)
set(GENERATE_COVERAGE_HTML FALSE)
message(STATUS "[SKIP] Coverage generators - HTML (could not find lcov)")
endif()
endif()
if(GENERATE_COVERAGE_HTML)
find_program(GENHTML_PATH genhtml PARENT_SCOPE)
if(NOT GENHTML_PATH)
set(GENERATE_COVERAGE_HTML FALSE)
message(STATUS "[SKIP] Coverage generators - HTML (could not find genhtml)")
endif()
endif()
if(GENERATE_COVERAGE_HTML)
message(STATUS "[ OK ] Coverage generators - HTML (lcov and genhtml)")
endif()
set(GENERATE_COVERAGE_COBERTURA TRUE)
if(GENERATE_COVERAGE_COBERTURA)
find_program(GCOVR_PATH gcovr PARENT_SCOPE)
if(NOT GCOVR_PATH)
set(GENERATE_COVERAGE_COBERTURA FALSE)
message(STATUS "[SKIP] Coverage generators - Cobertura (could not find gcovr)")
endif()
endif()
if(GENERATE_COVERAGE_COBERTURA)
message(STATUS "[ OK ] Coverage generators - Cobertura (gcovr)")
endif()
if(NOT GENERATE_COVERAGE)
message(FATAL_ERROR "Could not find the main coverage generator 'gcov'")
elseif(NOT GENERATE_COVERAGE_HTML AND NOT GENERATE_COVERAGE_COBERTURA)
message(FATAL_ERROR "Could not find either of the two coverage report generators")
endif()
###############################################################################
#
# Setup environment
#
###############################################################################
message(STATUS "Setup environment")
if(GENERATE_COVERAGE_HTML)
execute_process(COMMAND ${CMAKE_COMMAND} -DCOVERAGE_SETTINGS=${COVERAGE_SETTINGS} -P ${COVERAGE_SCRIPTS_DIR}/CoveragePreHtml.cmake
WORKING_DIRECTORY ${COVERAGE_RUN_DIR})
endif()
if(GENERATE_COVERAGE_COBERTURA)
execute_process(COMMAND ${CMAKE_COMMAND} -DCOVERAGE_SETTINGS=${COVERAGE_SETTINGS} -P ${COVERAGE_SCRIPTS_DIR}/CoveragePreCobertura.cmake
WORKING_DIRECTORY ${COVERAGE_RUN_DIR})
endif()
###############################################################################
#
# Generate coverage results by running all the tests
#
###############################################################################
message(STATUS "Run all test to get coverage")
execute_process(COMMAND ctest ${COVERAGE_QUIET_FLAG} -T test
WORKING_DIRECTORY ${COVERAGE_RUN_DIR})
execute_process(COMMAND ctest ${COVERAGE_QUIET_FLAG} -T coverage
WORKING_DIRECTORY ${COVERAGE_RUN_DIR})
###############################################################################
#
# Generate coverage reports
#
###############################################################################
if(GENERATE_COVERAGE_HTML)
execute_process(COMMAND ${CMAKE_COMMAND} -DCOVERAGE_SETTINGS=${COVERAGE_SETTINGS} -P ${COVERAGE_SCRIPTS_DIR}/CoveragePostHtml.cmake
WORKING_DIRECTORY ${COVERAGE_RUN_DIR})
endif()
if(GENERATE_COVERAGE_COBERTURA)
execute_process(COMMAND ${CMAKE_COMMAND} -DCOVERAGE_SETTINGS=${COVERAGE_SETTINGS} -P ${COVERAGE_SCRIPTS_DIR}/CoveragePostCobertura.cmake
WORKING_DIRECTORY ${COVERAGE_RUN_DIR})
endif()

View file

@ -1,52 +0,0 @@
#
# Copyright(c) 2006 to 2018 ADLINK Technology Limited and others
#
# This program and the accompanying materials are made available under the
# terms of the Eclipse Public License v. 2.0 which is available at
# http://www.eclipse.org/legal/epl-2.0, or the Eclipse Distribution License
# v. 1.0 which is available at
# http://www.eclipse.org/org/documents/edl-v10.php.
#
# SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
#
#
# This script assumes that all test have been run and gcov results are available.
# It will generate the Cobertura output from the gcov results.
#
# Example usage:
# $ cmake -DCOVERAGE_SETTINGS=<cham bld>/CoverageSettings.cmake -P <cham src>/cmake/scripts/CoveragePreCobertura.cmake
# $ ctest -T test
# $ ctest -T coverage
# $ ctest -DCOVERAGE_SETTINGS=<cham bld>/CoverageSettings.cmake -P <cham src>/cmake/scripts/CoveragePostCobertura.cmake
# If you start the scripts while in <cham bld> then you don't have to provide the COVERAGE_SETTINGS file.
#
cmake_minimum_required(VERSION 3.5)
# Get Coverage configuration file
if(NOT COVERAGE_SETTINGS)
set(COVERAGE_SETTINGS ${CMAKE_CURRENT_BINARY_DIR}/CoverageSettings.cmake)
endif()
include(${COVERAGE_SETTINGS})
# Some debug
#message(STATUS "Config file: ${COVERAGE_SETTINGS}")
#message(STATUS "Source directory: ${COVERAGE_SOURCE_DIR}")
#message(STATUS "Test directory: ${COVERAGE_RUN_DIR}")
#message(STATUS "Output directory: ${COVERAGE_OUTPUT_DIR}")
# Find gcovr to generate Cobertura results
find_program(GCOVR_PATH gcovr PARENT_SCOPE)
if(NOT GCOVR_PATH)
message(FATAL_ERROR "Could not find gcovr to generate Cobertura coverage.")
endif()
# Create location to put the result file.
file(MAKE_DIRECTORY ${COVERAGE_OUTPUT_DIR})
execute_process(COMMAND ${GCOVR_PATH} -x -r ${COVERAGE_SOURCE_DIR} -e ".*/${COVERAGE_EXCLUDE_TESTS}/.*" -e ".*/${COVERAGE_EXCLUDE_EXAMPLES}/.*" -e ".*/${COVERAGE_EXCLUDE_BUILD_SUPPORT}/.*" -o ${COVERAGE_OUTPUT_DIR}/cobertura.xml
WORKING_DIRECTORY ${COVERAGE_RUN_DIR})
message(STATUS "The Cobertura report can be found here: ${COVERAGE_OUTPUT_DIR}/cobertura.xml")

Some files were not shown because too many files have changed in this diff Show more