Commit Graph

11 Commits

Author SHA1 Message Date
Kunal Mehta b18c8e079e Have meson manage/install the kiwix-compile-resources.1 man page 2020-07-15 14:23:05 +02:00
Kelson b7c5e5f339 Remove trailing spaces 2019-12-08 11:52:16 +01:00
Matthieu Gautier 92c9a47a0d Move the templating system to mustache instead of ctpp2.
Mustache templating system is a bit simpler than ctpp2 and ctpp2 is no
more maintained (see #189).
We are moving to the kainjow's Mustache project
(https://github.com/kainjow/Mustache).

It simplify a lot our system has it is header only and we don't have to
precompile the template.

Fix #21
2019-01-09 18:28:48 +01:00
Matthieu Gautier d801ff36f6 [resource_compiler] Make the exception public.
This is useless to raise an exception if the exception in not published
in the header.
2017-10-10 13:55:43 +02:00
Kunal Mehta 5c118a87a1 Rename compile_resources.py to less generic name 2017-09-26 17:56:55 +02:00
Kelson d17e94fd9c Fix license header #73 2017-08-07 11:49:48 +02:00
Matthieu Gautier c5b291e1ed Do not crash if no source_dir is given. 2017-07-12 18:35:38 +02:00
Matthieu Gautier 64cc69f6ae Use ctpp2c to generate template from source instead of use generated one.
Fixes #50.
2017-07-12 15:45:44 +02:00
Matthieu Gautier a3d01b6303 Use correct include in generated resource file.
std::runtime_error is defined in <stdexcept> not <exception>.

Recent gcc version compiled the resource file without complain but old
version need a correct include.
2017-01-24 15:36:01 +01:00
Matthieu Gautier 97bdc17651 All static compilation with several generated resource code.
If there are several uses of the compile_resource script it will have
several definition of getResource function.

So, define a custum getResource function per resources "pack" and add
a define to have a nice API.

A developer must take care of not include two generated .h in the same
compilation unit as there will be a redefine error.
The best way to avoid this is to always include the generated .h in the
c(pp) file and never in a header.
If a compilation unit need to use two pack at the same time, we have to
undef 'getResource' and use the real getResource_* methods.
2016-12-23 14:27:58 +01:00
Matthieu Gautier cba71b4e75 Add a new script to compile resources.
- No more dependency to reswrap binary (everything is done in python)
- Resource strings can be directly accessed.
  As side effect, it add a check at compilation if the resource is
  declared and compiled in the binary.
- The resource content can be overwritten at runtime with a env variable.

There is also few clean in the static as some files shoul be in the tools
directory.

The compile_resource script is install to let other project use it.
2016-12-23 13:06:12 +01:00