为什么在为 iOS 编译 assimp 时出现“当前目标不支持线程本地存储”错误

mat*_*ace 10 c++ ios assimp

我目前正在尝试在虚幻引擎项目中使用 assimp 库http://assimp.org 。我能够编译该库的 Windows 和 Mac 版本,以便我可以将它们链接到我的项目。

我现在面临的问题是编译iOS版本。正如我在项目中提交的 github 问题中所述,在编译时我不断遇到以下问题。https://github.com/assimp/assimp/issues/3690

我不认为这是它本身的问题assimp。我相信这是 macOS 及其编译 C++ 代码方式的问题。

这是我提交的 github 问题。我相信它包含解释我遇到的错误所需的所有信息。我只是不确定此时如何解决它。

在 macOS 上,我已从 cmake --build cd 构建了 assimp 到 port/iOS/ ./build.sh 中,但出现以下错误。

[ 92%] Building CXX object code/CMakeFiles/assimp.dir/AssetLib/Assjson/json_exporter.cpp.o

In file included from ~/assimp/code/Pbrt/PbrtExporter.cpp:87:
~/assimp/code/Pbrt/stb_image.h:931:1: error: thread-local storage is not supported for the
      current target
STBI_THREAD_LOCAL
^
~/assimp/code/Pbrt/stb_image.h:592:39: note: expanded from macro 'STBI_THREAD_LOCAL'
      #define STBI_THREAD_LOCAL       thread_local
                                      ^
~/assimp/code/Pbrt/stb_image.h:1070:8: error: thread-local storage is not supported for the
      current target
static STBI_THREAD_LOCAL int stbi__vertically_flip_on_load_local, stbi__vertically_flip_on_load_set;
       ^
~/assimp/code/Pbrt/stb_image.h:592:39: note: expanded from macro 'STBI_THREAD_LOCAL'
      #define STBI_THREAD_LOCAL       thread_local
                                      ^
~/assimp/code/Pbrt/stb_image.h:1070:8: error: thread-local storage is not supported for the
      current target
~/assimp/code/Pbrt/stb_image.h:592:39: note: expanded from macro 'STBI_THREAD_LOCAL'
      #define STBI_THREAD_LOCAL       thread_local
[ 92%] Building CXX object code/CMakeFiles/assimp.dir/AssetLib/Assjson/mesh_splitter.cpp.o
Run Code Online (Sandbox Code Playgroud)

**桌面 **

操作系统:macOS 11.2.1 M1 mac mini 2021 计算机尝试为 iOS 进行编译