spnda / fastgltf

A modern C++17 glTF 2.0 library focused on speed, correctness, and usability

Home Page:https://fastgltf.readthedocs.io/v0.7.x/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

C++ 20 support

preetishkakkar opened this issue · comments

Currently, cmake seems to make sure that we can't use it with a C++ 20 project? Is there a reason to have this restricted to C++ 17, can this limit be removed?

commented

fastgltf definitely supports C++20 and even includes a few additional things in the headers, if you should use the utilities it adds. Additionally, CMake should not have any issue with the C++ version of your project and fastgltf. Would you mind pasting the error message you encountered?

ahh never mind, looks like since there was no easy way to compile only parts of fastgltf, I added below to my cmake,
add_library(fastgltf STATIC ${fastgltf_SOURCE_DIR}/src/base64_decode.cpp ${fastgltf_SOURCE_DIR}/src/fastgltf.cpp ${fastgltf_SOURCE_DIR}/simdjson/simdjson.cpp)

which somehow didn't pick the correct cxx flags set at project level, adding this target_compile_features(fastgltf PRIVATE cxx_std_20) works! thanks..

It will be good to have possibility to configuring it such that examples & test can be turned off when using FetchContent_Declare

Feel free to close this issue

commented

I will keep it open to remind me about adding a FASTGLTF_TESTS and FASTGLTF_EXAMPLES that fully stops anything regarding tests and examples of running. But thank you.

commented

I've now added this with e9e4c34.