Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[build] Fixed possibility to compile examples with C++03 standard #1830

Merged

Conversation

ethouris
Copy link
Collaborator

Fixed:

The examples were enforced to be compiled with C++11 standard even though they are written in C++03 or even in C style.

After the fix it is possible to compile the library and examples using a compiler that is not C++11 capable using options:

./configure --disable-apps --use-c++-std=03 --enable-examples

@ethouris ethouris added Priority: High Type: Bug Indicates an unexpected problem or unintended behavior [build] Area: Changes in build files labels Feb 24, 2021
@ethouris ethouris added this to the v1.4.3 milestone Feb 24, 2021
@ethouris ethouris self-assigned this Feb 24, 2021
Copy link
Collaborator

@stevomatthews stevomatthews left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor edits.

Co-authored-by: stevomatthews <smatthews@haivision.com>
CMakeLists.txt Outdated
Comment on lines 418 to 420
#if (DEFINED USE_CXX_STD)
# message(FATAL_ERROR "USE_CXX_STD can be set only when ENABLE_CXX11 is on")
#endif()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can be removed

Comment on lines 91 to 104
2. The examples (to be enabled by `--enable-examples`) require either C++03 or C89 standard.
3. The following require C++11 standard:
* demo applications
* testing applications (to be enabled by `--enable-testing`)
* unit tests (to be enabled by `--enable-unittests`)

Note that C++11 standard will be enforced if you have enabled applications
and haven't specified the C++ standard explicitly. When you have an old compiler
that does not support C++11 and you want to compile as many parts as possible,
the simplest way is to use the following options:

```
./configure --disable-apps --use-c++-std=03 --enable-examples
```
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CMake should be the default build system. TCL is not available on Windows by default.

cmake . -DENABLE_APPS=ON and so on

Comment on lines 102 to 106
```
./configure --disable-apps --use-c++-std=03 --enable-examples
```

Note also that there are several other options that, when enabled, may require that the SRT library be compiled using C++11 standard (`--enable-stdc++-sync` for example).
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Convert to cmake

@maxsharabayko maxsharabayko merged commit 1dced8b into Haivision:master Feb 26, 2021
@ethouris ethouris deleted the dev-fix-old-standard-examples branch February 26, 2021 11:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[build] Area: Changes in build files Priority: High Type: Bug Indicates an unexpected problem or unintended behavior
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants