justdan96 / tsMuxer

tsMuxer is a transport stream muxer for remuxing/muxing elementary streams, EVO/VOB/MPG, MKV/MKA, MP4/MOV, TS, M2TS to TS to M2TS. Supported video codecs H.264/AVC, H.265/HEVC, VC-1, MPEG2. Supported audio codecs AAC, AC3 / E-AC3(DD+), DTS/ DTS-HD.
Apache License 2.0
853 stars 144 forks source link

Check for std::filesystem and Correct Linker Flags #585

Closed justdan96 closed 2 years ago

justdan96 commented 2 years ago

This is a first step to supporting std::filesystem, std::experimental::filesystem, ghc::filesystem and boost::filesystem. For now we just check that we can correctly use std::filesystem and we try to figure out the correct linker flags.

justdan96 commented 2 years ago

Clearly something else is going wrong if the Mac native build fails at the CMake stage - I'll mark this as WIP.

justdan96 commented 2 years ago

This one has grown a bit over what I thought it would take to solve these issues. It does look this is necessary though, as I plan to update the Docker container to only use Ubuntu 18.04 and that would require these changes. @xavery could you please cast an eye over these and suggest if they look okay?

lighterowl commented 2 years ago

What a mess ... wasn't std::filesystem supposed to make life easier? :rofl:

The only reason why std::filesystem usage was introduced in this file was to handle symlinks to font files, in 1d50191c0a3c40475cd1684654be4bb148eedaa5 . I don't think anybody expected it back then to be such a headache, requiring extra 100-some lines in cmake just to build, and all for the purpose of canonicalising a file path.

The FreeType renderer is used only on Linux and Mac anyway, and I don't think anybody ever attempted using it on Windows. Taking this into account ... wouldn't it be possible to just use realpath here and avoid std::filesystem problems altogether? Have to admit I haven't tried using it under Mac yet.

lighterowl commented 2 years ago

The changes replacing std::filesystem with realpath are in #588 . It looks like they build okay on both Linux and Mac. I don't think it makes a lot of sense to stick to std::filesystem seeing how we only use it in this one place, but I understand if you disagree and choose to merge this instead, seeing how you've done the hard part already anyway.

justdan96 commented 2 years ago

It did feel like creating a Rube Goldberg machine just to crack an egg, thanks for looking over it!

justdan96 commented 2 years ago

588 obsoletes these changes