Hi. I have some c++ code that uses some embedded (copied over) files from another open source project (Asio). I have previously managed to make it compile as a standalone CMake library using c++ only (c++20).
Now I am trying to use SPM (Swift 6.0) to build a mixed language project, but it can never find my asio.hpp when I run swift build. Here is a link to the repository: GitHub - RussBaz/lumengine
Can anyone please advise how to properly set up my Package.swift file for this case? I am pretty sure it is related to the headerSearchPath, but I can never find the correct path.
I have progressed a bit further. By adding a public header path and a .cpp file and runing swift build, I am now getting different errors. Such as:
/Users/user/Projects/GitHub/lumengine/Sources/cxxLumengine/asio/include/asio/detail/io_uring_null_buffers_op.hpp:32:41: error: expected class name
30 |
31 | template <typename Handler, typename IoExecutor>
32 | class io_uring_null_buffers_op : public io_uring_operation
| `- error: expected class name
33 | {
34 | public:
These errors are not part of my code, though.
However, this is not the strangest part because I managed to compile the project myself using clang++ and swiftc directly! Here are the two commands that I used successfully (from the project root):