In order to better promote TBOOX open source project development, we decided to adopt a more relaxed, more developer-friendly Apache License 2.0
The tbox and xmake projects have updated to new license.
If you want to known more, please refer to:Apache License 2.0
We recently added a new feature for xmake:
you need not write any make-like file (xmake.lua, makefile.am, cmakelist.txt, etc.) and also build it directly.
It will scan all source files and generate xmake.lua automatically for building project.
And xmake will detect ‘main’ function in source file in order to distinguish between static libraries and executable programs.
(Currently, only projects with single-level directory are supported)
Although this approach has some limitations, but it is sufficient to complie and run some temporary codes for testing.
For example, we downloaded a zlib-1.2.10 source and want to compile it.
We only need to enter the zlib source directory and run the following command:
$ cd zlib-1.2.10
$ xmake
It’s done, the output results:
__tb_thread_local__
keyword macro--micro=y|n
option to compiling micro library (~64K) for the embed systemtb_addrinfo_addr
and tb_addrinfo_name
interfacestbox provides a lightweight implementation of stackless coroutines
and it’s interfaces are very simple too, for example:
tb_lo_coroutine_enter(coroutine)
{
while (1)
{
tb_lo_coroutine_yield();
}
}
The switch performance of this stackless coroutines is faster than the implementation of tbox’s stackfull coroutines.
And the memory storage space of each coroutine is also reduced to only a few bytes, but it also has many limitations:
1. With a stackless coroutine, only the top-level routine may be suspended.
Any routine called by that top-level routine may not itself suspend.
This prohibits providing suspend/resume operations in routines within a general-purpose library.
2. Because stackless coroutines do not save the stack context across a blocking call, local variables are not preserved when the protothread blocks.
This means that local variables should be used with utmost care - if in doubt, do not use local variables inside a stackless coroutine!
Recently, xmake’s description syntax has been enhanced to support two different grammar styles at the same time.
set-add
stylekey-val
styleset-add
styleThis is xmake’s classic style, for example:
target("test")
set_kind("static")
add_defines("DEBUG")
add_files("src/*.c", "test/*.cpp")
key-val
styleThis is added style recently, for example:
target
{
name = "test",
defines = "DEBUG",
files = {"src/*.c", "test/*.cpp"}
}