You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CMakeLists.txt
+78-70
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,5 @@
1
1
cmake_minimum_required(VERSION 3.0.1)
2
-
project(Jinja2Cpp VERSION 1.0.0)
2
+
project(Jinja2Cpp VERSION 1.1.0)
3
3
4
4
if (${CMAKE_VERSION}VERSION_GREATER"3.12")
5
5
cmake_policy(SET CMP0074 OLD)
@@ -11,7 +11,15 @@ else()
11
11
set(JINJA2CPP_IS_MAIN_PROJECT FALSE)
12
12
endif()
13
13
14
-
set (JINJA2CPP_DEPS_MODE "internal"CACHESTRING"Jinja2Cpp dependency management mode (internal | external | external-boost | conan-build). See documentation for details. 'interal' is default.")
set (JINJA2CPP_DEPS_MODE "external"CACHESTRING"Jinja2Cpp dependency management mode (internal | external | external-boost | conan-build). See documentation for details. 'interal' is default.")
19
+
option(JINJA2CPP_BUILD_TESTS "Build Jinja2Cpp unit tests"${JINJA2CPP_IS_MAIN_PROJECT})
20
+
option(JINJA2CPP_STRICT_WARNINGS "Enable additional warnings and treat them as errors"ON)
21
+
option(JINJA2CPP_BUILD_SHARED "Build shared linkage version of Jinja2Cpp"OFF)
22
+
15
23
if (NOT JINJA2CPP_DEPS_MODE)
16
24
set (JINJA2CPP_DEPS_MODE "internal")
17
25
endif ()
@@ -27,27 +35,26 @@ endif ()
27
35
28
36
if (JINJA2CPP_CXX_STANDARD LESS 14)
29
37
message(FATAL_ERROR "Jinja2Cpp is required C++14 or greater standard set. Currently selected standard: ${JINJA2CPP_CXX_STANDARD}")
30
-
else()
38
+
else()
31
39
message(STATUS"Jinja2Cpp C++ standard: ${JINJA2CPP_CXX_STANDARD}")
@@ -110,7 +108,7 @@ Currently, Jinja2C++ supports the limited number of Jinja2 features. By the way,
110
108
- 'with' statement
111
109
- 'do' extension statement
112
110
- recursive loops
113
-
- space control
111
+
- space control and 'raw'/'endraw' blocks
114
112
115
113
Full information about Jinja2 specification support and compatibility table can be found here: [https://jinja2cpp.dev/docs/j2_compatibility.html](https://jinja2cpp.dev/docs/j2_compatibility.html).
116
114
@@ -127,25 +125,33 @@ Compilation of Jinja2C++ tested on the following compilers (with C++14 and C++17
127
125
128
126
**Note:** Support of gcc version >= 9.x or clang version >= 8.0 depends on the version of the Boost library provided.
Examples of build scripts and different build configurations can be found here: [https://github.com/jinja2cpp/examples-build](https://github.com/jinja2cpp/examples-build)
140
147
141
148
In simplest case to compile Jinja2C++ you need:
142
149
143
150
1. Install CMake build system (at least version 3.0)
144
-
2. Clone jinja2cpp repository and update submodules:
@@ -170,8 +176,7 @@ In simplest case to compile Jinja2C++ you need:
170
176
> cmake --build . --target install
171
177
```
172
178
173
-
In this case, Jinja2C++ will be built with internally-shipped dependencies and install them respectively. But Jinja2C++ supports build with externally-provided deps. Different Jinja2C++ usage scenarios can be found in this repository: https://github.com/jinja2cpp/examples-build
174
-
179
+
In this case, Jinja2C++ will be built with internally-shipped dependencies and install them respectively. But Jinja2C++ supports build with externally-provided deps.
175
180
### Usage with conan.io dependency manager
176
181
Jinja2C++ can be used as conan.io package. In this case, you should do the following steps:
177
182
@@ -227,7 +232,7 @@ You can define (via -D command-line CMake option) the following build flags:
227
232
228
233
229
234
### Build with C++17 standard enabled
230
-
In case of C++17 standard enabled for your project you should define `variant_CONFIG_SELECT_VARIANT=variant_VARIANT_NONSTD nssv_CONFIG_SELECT_STRING_VIEW=nssv_STRING_VIEW_NONSTD optional_CONFIG_SELECT_OPTIONAL=optional_OPTIONAL_NONSTD` macros in the build settings.
235
+
Jinja2C++ try to use standard versions of `std::variant`, `std::string_view` and `std::optional` if possible.
231
236
232
237
## Acknowledgments
233
238
Thanks to **@manu343726** for CMake scripts improvement, bug hunting, and fixing and conan.io packaging.
@@ -238,12 +243,34 @@ Thanks to **@vitaut** for the amazing text formatting library.
238
243
239
244
Thanks to **@martinus** for the fast hash maps implementation.
240
245
241
-
Thanks to **@palchukovsky** for the great contribution into the codebase.
242
246
243
-
Thanks to **@rmorozov** for sanitized builds setup.
247
+
## Changelog
244
248
249
+
### Version 1.1.0
250
+
#### Changes and improvements
251
+
-`batch` filter added
252
+
-`slice` filter added
253
+
-`format` filter added
254
+
-`tojson` filter added
255
+
-`striptags` filter added
256
+
-`center` filter added
257
+
-`xmlattr` filter added
258
+
-`raw`/`endraw` tags added
259
+
- repeat string operator added (e. g. `'a' * 5` will produce `'aaaaa'`)
260
+
- support for templates metadata (`meta`/`endmeta` tags) added
261
+
-`-fPIC` flag added to Linux build configuration
245
262
246
-
## Changelog
263
+
#### Fixed bugs
264
+
- Fix behavior of lstripblock/trimblocks global settings. Now it fully corresponds to the origina jinja2
265
+
- Fix bug with rendering parent `block` content if child doesn't override this block
266
+
- Fix compilation issues with user-defined callables with number of arguments more than 2
267
+
- Fix access to global Jinja2 functions from included/extended templates
268
+
- Fix point of evaluation of macro params
269
+
- Fix looping over the strings
270
+
- Cleanup warnings
271
+
272
+
#### Breaking changes
273
+
- From now with C++17 standard enabled Jinja2C++ uses standard versions of types `variant`, `string_view` and `optional`
247
274
248
275
### Version 1.0.0
249
276
#### Changes and improvements
@@ -281,7 +308,7 @@ Thanks to **@rmorozov** for sanitized builds setup.
281
308
-`include`, `import` and `from` statements implemented. Now it's possible to include other templates and use macros from other templates.
282
309
-`with` statement implemented
283
310
-`do` statement implemented
284
-
- Sample build projects for various Jinja2C++ usage variants created: https://github.com/jinja2cpp/examples-build
311
+
- Sample build projects for various Jinja2C++ usage variants created: https://github.com/jinja2cpp/examples-build](https://github.com/jinja2cpp/examples-build)
285
312
- Documentation site created for Jinja2C++: https://jinja2cpp.dev/
0 commit comments