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] Added macros resolved in srt.h to pkg-config file #2806

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

ethouris
Copy link
Collaborator

@ethouris ethouris commented Oct 2, 2023

Fixes #2610

Replaces #2696

There are several preprocessor macros that are used as conditionals in srt.h; they should be always resolved before including this file.

In order to achieve this, you should add the result of pkg-config --cflags srt to your applications' compile command line options, just as well the result of pkg-config --libs srt to your applications' linker options. This will provide all required options your application should be compiled with, including macrodefinitions with which the library was originally compiled.

@ethouris ethouris added Type: Maintenance Work required to maintain or clean up the code [build] Area: Changes in build files [API] Area: Changes in SRT library API labels Oct 2, 2023
@jeandube
Copy link
Collaborator

jeandube commented Oct 3, 2023

pkg-config --cflags srt is not terrible for cross compiling. First it adds -I /usr/local/include and second, the install dir of a cross-compiled SRT is rarely the build system's PKG_CONFIG_PATH to which most developers don't have access anyway.

@ethouris
Copy link
Collaborator Author

ethouris commented Oct 3, 2023

How do you get access to libssl then? This is also using pkg-config in the SRT build. This will likely have to use the right version of pkg-config from the cross-compile toolchain. I found something about it here

@jeandube
Copy link
Collaborator

jeandube commented Oct 3, 2023

openssl is built and installed by the maintainer of the build computer. SRT is kind of part of the firmware build

@ethouris
Copy link
Collaborator Author

ethouris commented Oct 4, 2023

Ok, so there's an alternative, enabled with -DENABLE_CONFIG_HEADER=ON.

If enabled, these flags will be placed in the generated version.h file. This file is automatically included by srt.h, so if configured this way, you don't have to do anything.

The controversy is that every user that is including the SRT header will have to use pkg-config by default, or request this flag otherwise.

@maxsharabayko maxsharabayko added this to the v1.6.0 milestone Oct 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[API] Area: Changes in SRT library API [build] Area: Changes in build files Type: Maintenance Work required to maintain or clean up the code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FR] Build options shall be available to application writers
3 participants