Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ 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_GENERATE_SCHEME YES)
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)
Expand Down Expand Up @@ -264,9 +265,40 @@ set(MEMORYCHECK_COMMAND_OPTIONS "--track-origins=yes --leak-check=full --trace-c
# library so we can actually build the tests.
option(BUILD_TESTING "Build the testing tree." OFF)

# ROS2 build use BUILD_TESTING but it makes (1) little sense to include the Cyclone tests
# in a ROS2 test run, and (2) some variant of the Windows CI platform ran into:
#
# Auto build dll exports
#
# $P: error MSB3073: The command "setlocal [C:\ci\ws\build\cyclonedds\src\core\ddsc.vcxproj]
# $P: error MSB3073: cd C:\ci\ws\build\cyclonedds\src\core [C:\ci\ws\build\cyclonedds\src\core\ddsc.vcxproj]
# $P: error MSB3073: if %errorlevel% neq 0 goto :cmEnd [C:\ci\ws\build\cyclonedds\src\core\ddsc.vcxproj]
# ...
#
# where P = C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\
# ...Microsoft\VC\v160\Microsoft.CppCommon.targets(150,5)
set(CYCLONEDDS_BUILD_TESTING "AUTO" CACHE STRING "Override regular BUILD_TESTING")
set_property(CACHE CYCLONEDDS_BUILD_TESTING PROPERTY STRINGS ON OFF AUTO)
if(NOT CYCLONEDDS_BUILD_TESTING STREQUAL "AUTO")
if(CYCLONEDDS_BUILD_TESTING)
if(NOT BUILD_TESTING)
message(WARNING "Enabling test code: CYCLONEDDS_BUILD_TESTING and not BUILD_TESTING")
set(BUILD_TESTING TRUE)
endif()
else()
if(BUILD_TESTING)
message(WARNING "Disabling test code: not CYCLONEDDS_BUILD_TESTING and BUILD_TESTING")
set(BUILD_TESTING FALSE)
endif()
endif()
endif()

# For special-purpose builds it can be useful to export all symbols from the library,
# like we do when building the tests.
option(EXPORT_ALL_SYMBOLS "Export all symbols from the library." OFF)
if(BUILD_TESTING OR EXPORT_ALL_SYMBOLS)
message(STATUS "Exporting all symbols from library")
endif()

# Include the xtests for idlc. These tests use the idl compiler (C back-end) to
# compile an idl file at (test) runtime, and use the C compiler to build a test
Expand Down
36 changes: 18 additions & 18 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,17 @@ variables:

jobs:
- job: build_and_test
displayName: Build and test Cyclone
displayName: 'B&T'
pool:
vmImage: $(image)
strategy:
matrix:
'Ubuntu 22.04 (Release, x86_64)':
'Ub 22.04 (Rel, x86_64)':
image: ubuntu-22.04
build_type: Release
sanitizer: undefined
cc: gcc
'Ubuntu 24.04 (Debug, x86_64, Iceoryx)':
'Ub 24.04 (Deb, x86_64, Iceoryx)':
image: ubuntu-24.04
# No address sanitizer because of this in test run:
# Shadow memory range interleaves with an existing memory mapping.
Expand All @@ -40,7 +40,7 @@ jobs:
iceoryx: on
cc: gcc
coverage: on
'Ubuntu 24.04 (Debug, x86_64, Iceoryx2)':
'Ub 24.04 (Deb, x86_64, Iceoryx2)':
image: ubuntu-24.04
# No address sanitizer because of this in test run:
# Shadow memory range interleaves with an existing memory mapping.
Expand All @@ -51,13 +51,13 @@ jobs:
iceoryx2: on
cc: gcc
coverage: on
'Ubuntu 24.04 (Release, x86_64)':
'Ub 24.04 (Rel, x86_64)':
image: ubuntu-24.04
build_type: Release
sanitizer: undefined
cc: gcc-14
cxx: g++-14
'Ubuntu 24.04 with GCC 12 (Debug, x86_64, security only)':
'Ub 24.04 + GCC 12 (Deb, x86_64, security only)':
image: ubuntu-24.04
sanitizer: address,undefined
ssl: off
Expand All @@ -67,62 +67,62 @@ jobs:
topic_discovery: off
idlc_xtests: off # temporary disabled because of passing -t option to idlc in this test for recursive types
cc: gcc-12
'Ubuntu 24.04 with GCC 12 (Debug, x86_64, no tests)':
'Ub 24.04 + GCC 12 (Deb, x86_64, no tests)':
image: ubuntu-24.04
cc: gcc-12
testing: off
idlc_xtests: off
'Ubuntu 24.04 with Clang (Debug, x86_64)':
'Ub 24.04 + Clang (Deb, x86_64)':
image: ubuntu-24.04
analyzer: on
sanitizer: address,undefined
cc: clang
'Ubuntu 24.04 with Clang (Debug, x86_64, no security)':
'Ub 24.04 + Clang (Deb, x86_64, no security)':
image: ubuntu-24.04
sanitizer: address,undefined
security: off
cc: clang
'Ubuntu 24.04 with Clang (Release, x86_64, no topic discovery)':
'Ub 24.04 + Clang (Rel, x86_64, no topic discovery)':
image: ubuntu-24.04
build_type: Release
sanitizer: undefined
topic_discovery: off
idlc_xtests: off # temporary disabled because of passing -t option to idlc in this test for recursive types
cc: clang
'macOS 14 with Clang (Debug, x86_64)':
'macOS 14 + Clang (Deb, x86_64)':
image: macos-14
sanitizer: address,undefined
deadline_update_skip: on
cc: clang
coverage: on
'macOS 14 with Clang (Release, x86_64)':
'macOS 14 + Clang (Rel, x86_64)':
image: macos-14
build_type: Release
sanitizer: undefined
cc: clang
'macOS 14 with GCC 14 (Debug, analyzer, x86_64)':
'macOS 14 + GCC 14 (Deb, analyzer, x86_64)':
image: macos-14
cc: gcc-14
analyzer: on
# 32-bit Windows: without SSL/security because Chocolateley only provides 64-bit OpenSSL
'Windows 2025 with Visual Studio 2022 (Debug, x86, no security)':
'Win 2025 + VS 2022 (Deb, x86, no security)':
arch: x86
image: windows-2025
ssl: off
security: off
idlc_xtests: off
generator: 'Visual Studio 17 2022'
'Windows 2025 with Visual Studio 2022 (Debug, x86_64)':
'Win 2025 + VS 2022 (Deb, x86_64)':
image: windows-2025
idlc_xtests: off
generator: 'Visual Studio 17 2022'
'Windows 2025 with Visual Studio 2022 (Release, x86_64, no tests)':
'Win 2025 + VS 2022 (Rel, x86_64, no tests)':
image: windows-2025
build_type: Release
testing: off
idlc_xtests: off
generator: 'Visual Studio 17 2022'
'Windows 2022 with Visual Studio 2022 (RelWithDebInfo, x86_64)':
'Win 2022 + VS 2022 (RelWithDebInfo, x86_64)':
image: windows-2022
build_type: RelWithDebInfo
idlc_xtests: off
Expand All @@ -134,7 +134,7 @@ jobs:
# generator: 'MinGW Makefiles'
# cc: 'C:/msys64/mingw64/bin/gcc.exe'
# cxx: 'C:/msys64/mingw64/bin/g++.exe'
'Ubuntu 24.04 with default GCC (Release, Iceoryx, Static, x86_64)':
'Ub 24.04 Static (Rel, Iceoryx, x86_64)':
image: ubuntu-24.04
idlc_xtests: off
build_type: Release
Expand Down
7 changes: 7 additions & 0 deletions cmake/Modules/Generate.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -227,8 +227,15 @@ function(IDLC_GENERATE_GENERIC)
endforeach()

add_custom_target("${_target}_generate" DEPENDS "${_outputs}")
if(${CMAKE_GENERATOR} MATCHES "Xcode")
set_target_properties("${_target}_generate" PROPERTIES XCODE_GENERATE_SCHEME NO)
endif()

add_library(${_target} INTERFACE)
target_sources(${_target} INTERFACE ${_outputs})
target_include_directories(${_target} INTERFACE "${_dir}")
add_dependencies(${_target} "${_target}_generate")
if(${CMAKE_GENERATOR} MATCHES "Xcode")
set_target_properties("${_target}" PROPERTIES XCODE_GENERATE_SCHEME NO)
endif()
endfunction()
2 changes: 1 addition & 1 deletion colcon.pkg
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"cmake-args": [ "-DBUILD_IDLC=AUTO" ]
"cmake-args": [ "-DBUILD_IDLC=AUTO", "-DBUILD_TESTING=0" ]
}
2 changes: 1 addition & 1 deletion src/core/ddsc/tests/cdrstream.c
Original file line number Diff line number Diff line change
Expand Up @@ -2135,7 +2135,7 @@ CU_Test (ddsc_cdrstream, check_string_invalid)
{ D(t2, true, {'a','b'}, "cd", 3), 0,NULL, CDR(32,3) },
{ D(t3, true, { "a", {'c','d'} }, 5), 0,NULL, CDR(32,5) },
{ D(t4, true, CSEQ0, STRSB({'c','d'}), 7), 0,NULL, CDR(32,7) },
{ D(t5, true, { 2, { .ws1 = "ab" } }, 11), 0,NULL, CDR(32,11) },
{ D(t5, true, { 2, { .ws1 = {'a','b'} } }, 11), 0,NULL, CDR(32,11) },
{ D(t5, true, { 4, { .ws1bs = STRSB({'c','d'}) } }, 13), 0,NULL, CDR(32,13) },
{ D(t5, true, { 5, { .ws1a = { "a", {'c','d'} } } }, 17), 0,NULL, CDR(32,17) },
{ D(t5, true, { 6, { .ws1abs = { CSEQ0, STRSB({'c','d'}) } } }, 19), 0,NULL, CDR(32,19) },
Expand Down