shaka-project / shaka-packager

A media packaging and development framework for VOD and Live DASH and HLS applications, supporting Common Encryption for Widevine and other DRM Systems.
https://shaka-project.github.io/shaka-packager/
Other
1.9k stars 496 forks source link

Macro DISALLOW_COPY_AND_ASSIGN include/file.h #1406

Closed zaki699 closed 4 weeks ago

zaki699 commented 1 month ago

Hi Everyone,

is that normal that include/file.h contains this line:

#include <packager/macros/classes.h>

From the README These are the public headers for libpackager. They can only reference other public headers or standard system headers. They cannot reference internal headers (in packager/...) or third-party dependency headers (in packager/third_party/...).

Is that a mistake or I am missing something ?

Regards,

joeyparrish commented 4 weeks ago

I think you are correct. This is a violation that would break header installation for the shared library build. macros/classes.h should be moved to the public headers.

zaki699 commented 4 weeks ago

Yes that’s a bit of a problem on my side as I am currently using libpackager. I have to manually copy the file macros/classes into include which is not great. Should I create a pull request to add macros/classes to the public include ?

joeyparrish commented 4 weeks ago

Yes, please!

joeyparrish commented 4 weeks ago

There is a CMake target that is meant to catch errors like these. I'm going to figure out why it didn't.

joeyparrish commented 4 weeks ago

Commands for configuring shared libs and building the link test, which compiles a simple application with libpackager and the public headers:

cmake -S . -B build/ -DCMAKE_BUILD_TYPE=Debug -G Ninja -DBUILD_SHARED_LIBS=ON
cmake --build build/ --parallel -- packager_link_test

It works. However, the main file includes only packager.h, which includes all the other header files except file.h. If we add file.h to packager.h, the build fails.