Babylon Native Swift project

Hello,

I’m new to babylon native. I’ve tried to follow the steps to integrate Babylon native to my existing swift project.
I’ve used this command to do the cmake: cmake -B ./build/iOS -S “/Users/…/BabylonNative” -G Xcode “-DCMAKE_SYSTEM_NAME=iOS” “-DCMAKE_OSX_ARCHITECTURES=arm64” “-DCMAKE_POLICY_VERSION_MINIMUM=3.5” “-DCMAKE_OSX_DEPLOYMENT_TARGET=15.0” “-DCMAKE_XCODE_ATTRIBUTE_CODE_SIGNING_ALLOWED=NO” “-DCMAKE_BUILD_TYPE=Debug” “-DCMAKE_XCODE_ATTRIBUTE_CODE_SIGNING_REQUIRED=NO”

Everything worked perfectly, I built the project in xcode and made all install, I could run the playground project. I had however had problems when integrating the library in my existing project.
I added the .a files and all the files under /include like mentionned in the forum, I added the header search paths, user header search paths, added the library search paths, checked the link binary with libraries (all .a files are in there), added these 2 lines in Apple clang - preprocessing
NODE_ADDON_API_DISABLE_DEPRECATED
NODE_ADDON_API_DISABLE_NODE_SPECIFIC
changed the c++ language dialect to c++17
I have problems in include files .h
‘napi/env.h’ file not found in #include <napi/env.h> and I’m sure once I fix this one I will have lot more problems
PS: “$(PROJECT_DIR)/Resources/BabylonNative/include” is in header search paths and it’s recursive.

What am I missing? Were can I find the error?

pinging @BabylonNative

1 Like

Hi @lilia-mdg

Can you find the napi/env.h in the include directory? Did the installation run fine?

1 Like

Hello @Cedric ,
Yes I can find the napi/env.h
I could solve the problem, it was in the path in header search paths, the app name was missing after project_dir.
Thank you very much!

2 Likes