Tear it out of the CMakeLists.txt and instead run it via
cargo xtask cppdocs
This allows the build_and_test step in the CI to only run cmake for the
library/header related bits and the docs_and_demos step to only generate
docs and not require a full host build of the library (as cargo xtask
cmake would otherwise do).
Doxygen's markdown support can't quite deal with the Github flavor,
the language reference looks terrible.
So instead, this change switches to using Sphinx,
with two extensions that call Doxygen for us and allow including markdown.
The result is a read-the-docs themed sphinx site that includes search even
in the language reference.
By setting RUSTFLAGS in the Cargo config we run into the situation that
when doing a host build, all rust files are compiled with the flags,
including build.rs. When cross-compiling, build.rs is not build with the
RUSTFLAGS specified. That makes kind of sense, but it also means that
all the build scripts are always recompiled when switching between a
target and a host build - and that applies to *all* packages, including
dependencies.
So short of a better solution, this patch removes the need to set
RUSTFLAGS. It was used to extract the system library dependencies for
the static library we'd create. Instead we're now building two shared
libraries and are linking against them. They contain the rust library
twice, so that's not really a desirable final state either, but
productivity wins right now :-)
It might make sense to go back to creating *one* shared library through
a dedicated crate and -- since 'pub extern "C"' functions are not
transitively exported, it may require re-exporting them by hand or using
some clever build trick perhaps.
The cargo target directory tree is now populated with a cmake package
file and that's also installed into the prefix specified with the cargo
cmake xtask.
As a consequence, the cpptest example can be built by first building the
cmake package:
cargo xtask cmake
or
cargo xtask cmake --release --target some-triplet)
or
cargo xtask cmake --release --prefix /somewhere --install
and then run cmake in the cpptest example with a prefix path:
-DCMAKE_PREFIX_PATH=/where/you/installed/it or simply
-DCMAKE_PREFIX_PATH=../../target/debug for example.
Pending still is the sixtyfps compiler tool installation and discovery.
This is done by calling cargo with json output to build the libraries,
collect the .a files, extract the native libraries needed for final
linkage and pass all that to a CMake project that cobbles together the
.a files into a propery cmake target with include paths, etc.