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

fastgltf doesn't automatically use find_package with FASTGLTF_DOWNLOAD_SIMDJSON=OFF #22

Closed toge closed 9 months ago

toge commented 1 year ago

I met a compilation error on fastgltf/0.5.0 with FASTGLTF_DOWNLOAD_SIMDJSON=ON. It works well on fastgltf/0.4.0.

I think this error is due to following commit: https://github.com/spnda/fastgltf/commit/41f1793d848297fa6aa480402a9ec7e68a96a712

How to use fastgltf/0.5.0 with FASTGLTF_DOWNLOAD_SIMDJSON=ON? Is it needed to prepare CMakeLists.txt wrapper?

spnda commented 1 year ago

FASTGLTF_DOWNLOAD_SIMDJSON is ON by default, and therefore should work. The relevant change doesn't change anything about the download functionality. When I get home, however, I can try and debug why it might not work.

Are you perhaps referring to setting it to OFF, so that you can supply a custom version of simdjson? If so, you'll just need to make a simdjson::simdjson target available before including fastgltf.

toge commented 1 year ago

@spnda Sorry, it's my mistake.

I met a compilation error on fastgltf/0.5.0 with FASTGLTF_DOWNLOAD_SIMDJSON=OFF. Error messages is followings:

src/base64.cpp:46:10: fatal error: simdjson.h: No such file or directory
   46 | #include "simdjson.h"
      |          ^~~~~~~~~~~~
spnda commented 1 year ago

Is that all? Then your simdjson::simdjson target is missing the include directory. Can you show how that target is configured?

spnda commented 9 months ago

Even though there was no response, you were able to fix your issue a long time ago (see conan-io/conan-center-index#18301). Furthermore, with the recent commit https://github.com/spnda/fastgltf/commit/3dd326efb089f66ca393a9cc68d07df42ba82fbd the code to link to simdjson has been refactored and now also covers the case you were having an issue with. The patch used with conan is now unnecessary with any future version of fastgltf.