Commit graph

11 commits

Author SHA1 Message Date
Olivier Goffart
54f81d4d29 C++ Only link against the backend library
For some raison, not all symbols gets exported,
add some dummy code which seems to do the trick
2020-06-17 18:38:47 +02:00
Simon Hausmann
afd7319ae5 Rename corelib to sixtyfps_corelib
This is consistent with the other packages and since corelib is now also
a cdylib, libsixtyfps_corelib.so looks much better than libcorelib.so
:-)
2020-06-09 13:27:18 +02:00
Simon Hausmann
547a732e33 Fix rebuild issues, part 10523
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.
2020-06-09 13:08:59 +02:00
Olivier Goffart
0553ab8b1a Use env::var_os instead of env::var
For the unliekly case in which the git repository is checked out in a directory
that cannot be represented with unicode
2020-06-05 13:45:37 +02:00
Simon Hausmann
31da762245 Complete compilation and running of .60 to mapped c++ tests
* Fix text-file-busy error when running the binary by replacing the use
  of named temp file with simply using the input source file and the
  extension replaced. A scope guard make sure to also delete the binary.
* Fix hard-coded library dependencies by sharing code with the cmake
  xtask that needs the same list.
2020-06-05 13:30:13 +02:00
Simon Hausmann
fef5004780 Fix repeated rebuilds
Don't try to determine the native libs dependency *and* the artifact
collection in one go by setting RUSTFLAGS, as that causes everything to
be rebuilt over and over again.

Instead, go back to invoking rustc once to determine the native libs
dependencies.
2020-06-04 19:25:44 +02:00
Simon Hausmann
5d2b5f7e4c Simplify cmake xtask
Call cargo only once by building the target package (gl renderer) right
away and passing the RUSTFLAGS to get the native library dependency.

Suggested by Olivier :)
2020-06-04 17:52:26 +02:00
Simon Hausmann
45879a4e04 Add an install option to the cmake xtask to run cmake --install 2020-06-04 15:29:19 +02:00
Simon Hausmann
a4da4de8c8 Add the ability to specify an install prefix for the cmake xtask build 2020-06-04 15:29:19 +02:00
Simon Hausmann
c5001703d4 Build the cmake module for our runtime as xtask, part 2
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.
2020-06-04 15:29:19 +02:00
Simon Hausmann
8a2a7ae8cb Add a boilerplate for the xtask concept
This shall provide a task to build the cmake module.
2020-06-04 15:29:19 +02:00