For some reason, The cargo test for the cpp driver test puts the
libslint_cpp.so library in the `deps` foilder, in addition to the
cdynlib which is generated in the normal target folder. So we end
up with two .so.
We need to have the cpp lib as a dependency because its metadata give us the
metadata on where to find the headers.
Ideally it should be an artifact dependency but this is not yet existing
Since cargo sets the LD_LIBRARY_PATH or the PATH env variable when
running the test, running the runtime built binaries work by taking
the library that is in the deps folder.
The README.md contains the warning that used to be in lib.rs.
Add README.md files to all internal crates
... pointing to the official public crate to use instead.
Rename internal crates
fixup: README files
fixup rename
Move "internal" crates into the `internal` directory. This first batch
includes most of sixtyfps_runtime but leaves the rendering backends
alone for now.
pre-commit applied some cleanups to the moved files:
- Consistent newline at end of file policy
- trimming trailing whitespace
- Formatting Cargo.toml files.
The ffi function wrapper need to be changed because in the 2021 edition, when
the capture is moved into the closure, it moves the individual field instead
of the whole wrapper. But we need to move the whole wrapper because the Drop
of the wrapper will delete the C++ closure, and we don't want to call the
closure after it is deleted.
These originate from the time when the driver would call cbindgen. Now
we depend on the sixtyfps-cpp crate, which runs cbindgen and
communicates the path to the generated headers via _DEP_ cargo link
variable.
Don't generate the headers by default in the source directory, put them
into a sub-directory in OUT_DIR instead and convey that location via
links to the C++ test driver.
Make install would still trigger the generated_headers_target CMake
custom command - due to the use of add_dependencies - and that would end
up running cbindgen. That in turn breaks "make install" when it's run in
an environment that doesn't have cargo in PATH (for example when using
"sudo make install").
This patch folds the generation of the C++ header files into the build
of the sixtyfps-cpp crate - via build.rs. By default the headers are
placed in api/sixtyfps-cpp/generated_include but the CMake build
redirects that into the build directory.
Note: Due to the way that corrosion works, cargo is still run when
running "make install", but it's path is absolute and there should not
be any reliance on the PATH environment variable.