NanoMichael / MicroTeX

A dynamic, cross-platform, and embeddable LaTeX rendering library
MIT License
418 stars 69 forks source link

Check XDG/FHS locations #38

Closed sp1ritCS closed 3 years ago

sp1ritCS commented 3 years ago

As @blackhole89 has already written in #36, cLaTeXMath is not checking locations for it's resources. The best way to do this, is to have a hidden file (.clatexmath-res_root) inside the resource directory. Then check the list of XDG/FHS complainant paths to see if one of them contains the file. I've written a small sample how this could be done - tho it requires c++17 and cLaTeXMath does not compile with std=c++17.

https://gist.github.com/sp1ritCS/9c81ae26a283ec5102c59a77c7fb5c3c

NanoMichael commented 3 years ago

I'm not familiar with XDG/FHS, but this project is completely compatible with C++17, and I'm glad to upgrade to C++17 (some legacy code need to be removed, and I'm now focusing on introducing open math and needs some C++17 features), any PR is appreciated :smiley:

sp1ritCS commented 3 years ago

if I change cpp_std to c++17 it throws a lot of error: ISO C++17 does not allow dynamic exception specifications

See build log with warning_level 0: https://gist.github.com/sp1ritCS/57675e4564c84f2b3e4cde82ac3bad4d


I'm not familiar with XDG/FHS

if you take a look at the sample, I think it should be obvious what paths are possible, as I've commented every no totally obvious path.

NanoMichael commented 3 years ago

I see... The "dynamic exception specifications" should be removed if introduce c++17. I'll make a PR to solve this issue.

NanoMichael commented 3 years ago

I make a PR #39 that remove dynamic exception specifications and upgrade CMake build to c++17, the Meson build could be updated.