Commit graph

33 commits

Author SHA1 Message Date
Simon Hausmann
33cfe03dc9 Rework the C++ facing build system, part 1
The objective is to automatically create a propery cmake module, with a
FindSixtyFPSConfig.cmake, corresponding targets .cmake files, etc. This
should encapsulate the build profile (debug vs. release) and also allow
making the choice of shared vs. static transparent.

Unfortunately it does not seem to be possible to easily combine different
crates into one cdylib crate that can re-export symbols from the
statically linked rust crates (cbindgen generated, as well as manual
extern "C").

That means for the dynamic case (not cared for right now), we're going
to need to create either one cdylib per crate that has public symbols or
manually re-export the symbols.

For the static case, linking just against the "last crate" in the chain
(the gl renderer backend) is sufficient to pull in all needed symbols.

In addition for the static case we need to specify the linkage of some
external libraries. This can be extracted manually via

    cargo rustc -p gl -- --print=native-static-libs

for example. For now that's in the changed CMakeLists.txt, but the plan
going forward is to automate this extraction in an xtask, to paste that
into the cmake target.

Finally, both linkage scenarios require access to the headers. This is
for now solved by generating them simply in an include sub-directory of
the build folder ($root/target/${profile}/include).
2020-06-04 15:29:19 +02:00
Olivier Goffart
13c7e0dec8 Begin working on a Node API
Currently, the followinf command in the example/nodetest directory works:
    npm install ../../api/sixtyfps-node && node main.js
2020-06-03 17:33:05 +02:00
Olivier Goffart
619e21295d reformat 2020-05-28 17:15:11 +02:00
Olivier Goffart
dc276290e9 Add support for self assignment (+=, -=, ...) 2020-05-28 17:02:06 +02:00
Olivier Goffart
74898a1386 Make property conneciton binding in the C++
(somehow plus/minus is not working yet)
2020-05-28 14:52:43 +02:00
Olivier Goffart
95b671c97c Support for code blocks and signal call 2020-05-28 12:30:08 +02:00
Simon Hausmann
f2df9293a9 Fix the C++ build
Remove the Optional from the evaluation context passing for property
evaluation. Unfortunately there are nullptr uses left on the C++ side,
that need to be replaced with passing through.
2020-05-28 12:07:11 +02:00
Olivier Goffart
5580b5112f Fix number to string conversion in C++ 2020-05-27 16:18:08 +02:00
Olivier Goffart
41332a759f Make property reference works in C++ 2020-05-27 10:00:45 +02:00
Olivier Goffart
36fb526811 Do inlining in a pass before the lowering 2020-05-26 15:10:27 +02:00
Simon Hausmann
0932953ac8 Implement property declarations for the C++ backend 2020-05-25 19:13:52 +02:00
Olivier Goffart
d8601621c0 Use the tool to replace = with := 2020-05-25 10:44:22 +02:00
Olivier Goffart
c03c2e2e7e Attempt to do Plus / Minus 2020-05-21 13:24:45 +02:00
Olivier Goffart
54eb0f831b Fix the children allocation array
The offsets was not computed properly
2020-05-21 13:14:28 +02:00
Olivier Goffart
4575011293 More work on signal: the C++ part is working 2020-05-20 19:28:58 +02:00
Olivier Goffart
efe0ccfb3f Add support for signal in the parser
(currently not doing anything else than parsing)
2020-05-20 12:53:08 +02:00
Olivier Goffart
6b3765857a Add a TouchArea builtin item (currently does nothing) 2020-05-20 09:32:01 +02:00
Olivier Goffart
260f17a3e0 Support for inline components within a .60 file 2020-05-19 17:43:56 +02:00
Olivier Goffart
a4569ddca3 BangExpression allow for finding relative paths 2020-05-19 15:36:56 +02:00
Olivier Goffart
25bf149e13 Add a shared string that can be used in properties 2020-05-18 17:09:40 +02:00
Simon Hausmann
25fd60c820 Fix runtime panic in cpp example
Correct the path to the image.
2020-05-14 08:43:00 +02:00
Olivier Goffart
638c445cf9 Support for rendering sub-elements with proper offset 2020-05-12 15:38:50 +02:00
Olivier Goffart
89f6e3529c Revert one of the previous change
The goal was to ensure that the libraries are up-to-date
2020-05-12 08:29:53 +02:00
Olivier Goffart
dbada7977e Fix C++ build 2020-05-12 08:03:18 +02:00
Simon Hausmann
83eb00b080 Run the C++ generated component through the GL backend
... which in turn forward to the corelib, but with the GL renderer attached.
2020-05-11 15:05:33 +02:00
Olivier Goffart
6cf327166e Parser: add support for parentheses in expressions 2020-05-11 11:19:57 +02:00
Simon Hausmann
d24437055d Prospective build fix for GH actions build
Make sure to call cargo from within the source tree
2020-05-11 11:02:43 +02:00
Simon Hausmann
5a3ad60ad4 Ignore more generated files
... including the cmake build directory
2020-05-11 10:56:33 +02:00
Simon Hausmann
5953b10e1c Ensure the runtime library is up-to-date before linking the binary 2020-05-11 10:56:33 +02:00
Simon Hausmann
dd7d2c6dda Fix build on macOS
* Enable C++17 by default (we could do with less also... but the
  compiler does not default to C++11 at least)
* Replace the .so shared library extension with the cmake variable
  that handles different platforms
2020-05-07 15:18:10 +02:00
Olivier Goffart
bdaf14ae23 Parse numbers 2020-05-07 09:06:58 +02:00
Olivier Goffart
3a541ec1eb Handle children elements 2020-05-06 16:43:04 +02:00
Olivier Goffart
b2b57887e2 add sixtyfps-cpp draft 2020-05-06 12:52:31 +02:00