Closed Lelelo1 closed 3 years ago
Actually there is no Swift
target. But see post by https://community.haxe.org/t/swift-target-support/579/3. It might be possible to output objective-c with hxcpp
I will use the Test.h
snipper to see if I can run the cpp successfully: https://community.haxe.org/t/use-a-cpp-function-in-my-haxe-code/2293/3
It's probably possible to add cpp source code to xcode. When doing that I got promoted to create a bridge header: https://github.com/CleverTap/ios-10-demo/blob/master/demo10/app-extension-bridging-header.h. After all, react-native has cpp code in xcode.
Information about create bidding header (to consume objectivec in swift): https://stackoverflow.com/questions/31716413/xcode-not-automatically-creating-bridging-header
When putting the compiled cpp (cpp
folder) into the xcode folder it has some #include "hxcpp.h"
imports, and I get File not found
. According to this issue it has to to do with precompilation in haxe.
.. does not work. It might work to do what is suggested here: https://github.com/HaxeFoundation/hxcpp/issues/559#issuecomment-318958353
https://github.com/HaxeFoundation/hxcpp/tree/master/include
..should be the missing code. They could might be able to be be installed with vcpkg somehow. cppBuild.hxml like the following does not give the needed files:
-cp src
-main src.Main
--library hxcpp
-cpp bin/cpp
The cpp -> objetivec+swift does not seem trustworthy and stable enough in haxe, so I am inclined to use python instead which seems to be able to be embedded and invokable on all platforms:
Supported on all apple products: https://github.com/beeware/Python-Apple-support (js can't be called from apple watch) Flutter (Dart) embedding: https://smazee.com/blog/how-to-run-the-python-code-in-the-flutter-app And when it comes to C# it has plenty of example and nugets as well
Python not supported: https://github.com/beeware/Python-Apple-support/issues/87
Found: https://github.com/heremaps/gluecodium which means I can have the main bulk of search service in c++ (or haxe-> c++).
I get the following problem with gluecodium: might work with: https://stackoverflow.com/questions/1140358/how-to-initialize-log4j-properly
Seems Haxe approach after getting help: https://community.haxe.org/t/missing-hxcpp-h-in-cpp-compilation/2975/4 So I will investigate it further and consume portion by portion of haxe to see if it works
As suggested by Haxiomic it's better to give arch flag in terrain instead, for faster build's.
haxe build-dev.hxml -D watchsimulator -D HXCPP_ARM64
in terminal
It's more convenient if another dev joins project, they will specify their own needed arch with ONLY_ACTIVE_ARCH
in Xcode
Xcode already had that setting active in debug, and was still requiring multiple archs.. So will go for multi arch in both debug and setting: https://github.com/Lelelo1/seek-search/blob/master/watchos.hxml
Lucene cpp seems to be most stable, so will add that after test build and running with cpp test dep
Solr preferably, otherwise Lucene
.. for platforms
.Net
andSwift