spnda / fastgltf

A modern C++17 glTF 2.0 library focused on speed, correctness, and usability
https://fastgltf.readthedocs.io/v0.8.x/
MIT License
312 stars 48 forks source link

Fix CMake debug optimization flags on MinGW #82

Closed santiberna closed 6 hours ago

santiberna commented 2 days ago

I have been working on a MinGW CMake project and noticed that my debug optimization level was -Og as opposed to -O0 without changing it myself. I found out that fastgltf declares -Og as a PUBLIC compilation flag on debug builds in MinGW.

This pull request simply replaces the PUBLIC specifier to PRIVATE, stopping this flag from leaking to users of the library. With this change the library still correctly compiles and loads models correctly, but it is worth testing if this doesn't break any specific use case.