commit | 76b079089f0449ccc3b600a0820754954facac1d | [log] [tgz] |
---|---|---|
author | Radek Krejci <rkrejci@cesnet.cz> | Fri Oct 09 09:11:25 2015 +0200 |
committer | Radek Krejci <rkrejci@cesnet.cz> | Fri Oct 09 09:19:54 2015 +0200 |
tree | af54cd3ba1e008579f74809325c4cea9130dabe0 | |
parent | 8e1ecd9f6ec6c05d356030df426e26aa7e8861a0 [diff] |
printer CHANGE generalize printers To simplify future adding of different outputs (file descriptor, memory, etc), printers have to be generic in printing. It is done by replacing standard printf() functions in libyang printers by another libyang function which decides how to print to the specific output.
libyang is YANG data modelling language parser and toolkit written (and providing API) in C.
$ mkdir build; cd build $ cmake .. $ make # make install
There are two build modes:
The Debug
mode is currently used as the default one. to switch to the Release
mode, enter at the command line:
$ cmake -D CMAKE_BUILD_TYPE:String="Release" .
Set CC variable:
$ CC=/usr/bin/clang cmake ..
libyang includes several tests built with cmocka. The tests can be found in tests
subdirectory and they are designed for checking library functionality after code changes.
The tests are by default built in the Debug
build mode by running
$ make
In case of the Release
mode, the tests are not built by default (it requires additional dependency), but it can be enabled via cmake option:
$ cmake -DENABLE_BUILD_TESTS=ON ..
Tests can be run by the make's test
target:
$ make test
Note that, with CMake, if you want to change the compiler or its options after you already ran CMake, you need to clear its cache first. For your convenience, this action is available as cclean
target of the Makefile:
$ make cclean $ CC=gcc CFLAGS='-fstack-protector-strong -Wa,--noexecstack' cmake ..