Skip to content

Use CMAKE_CXX_STANDARD and related properties to set C++ standards for compilation [13673] #2083

@pablorcum

Description

@pablorcum

Expected Behavior

Use CMAKE_CXX_STANDARD, CMAKE_CXX_STANDARD_REQUIRED and CMAKE_CXX_EXTENSIONS as defined in CMake documentation to set C++ standards to compile.
Also, missing CMAKE_CXX_EXTENSIONS makes build fail in certain scenarios (for example with QNX), unless the toolchain file explicitly defines them.

Current Behavior

Manually setting C++ compile standards with add_compile_options($<$<COMPILE_LANGUAGE:CXX>:-std=c++17>.

Steps to Reproduce

  1. Build for any target and verify that C++ standards are properly set.

System information

  • Fast-RTPS version: d12789c
  • OS: Windows 10
  • Target OS: QNX v7.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions