feature: can build on MACOS ARM
增加了macos arm芯片的编译适配
https://github.com/BoomingTech/Piccolo/issues/508 修复这个issue
It still failed to build on my M2 Pro chip model. First of all, I met an error threw by CMake in engine/3rdparty/tinyobjloader/CMakeLists.txt claiming that cmake_minimum_required when it was generating XCode project, which can be fixed after I modified the line like this:
cmake_minimum_required(VERSION 3.5...3.27)
However I still met an error within the compatibility of the implementation of sol2 library. With the assist of AI agent, I found that the problem lies in engine/3rdparty/sol2-3.3.0/include/sol/optional_implementation.hpp line 2193. It can be fixed with the following changes:
// return a reference to the temporary object
T temp(std::forward<Args>(args)...);
m_value = std::addressof(temp);
return *m_value;
I've pushed the fixes to my fork. Here's the link: https://github.com/AMagicPear/Piccolo-macOS-fix/tree/macos_arm_feature
With these fixes, the editor can be successfully built and launched.