Skip to content

Commit a34b824

Browse files
authored
Release 1.1 preparation (#190)
1 parent e89ed39 commit a34b824

6 files changed

+130
-96
lines changed

CMakeLists.txt

+78-70
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
cmake_minimum_required(VERSION 3.0.1)
2-
project(Jinja2Cpp VERSION 1.0.0)
2+
project(Jinja2Cpp VERSION 1.1.0)
33

44
if (${CMAKE_VERSION} VERSION_GREATER "3.12")
55
cmake_policy(SET CMP0074 OLD)
@@ -11,7 +11,15 @@ else()
1111
set(JINJA2CPP_IS_MAIN_PROJECT FALSE)
1212
endif()
1313

14-
set (JINJA2CPP_DEPS_MODE "internal" CACHE STRING "Jinja2Cpp dependency management mode (internal | external | external-boost | conan-build). See documentation for details. 'interal' is default.")
14+
# Options
15+
set(JINJA2CPP_SANITIZERS address+undefined memory)
16+
set(JINJA2CPP_WITH_SANITIZERS none CACHE STRING "Build with sanitizer")
17+
set_property(CACHE JINJA2CPP_WITH_SANITIZERS PROPERTY STRINGS ${JINJA2CPP_SANITIZERS})
18+
set (JINJA2CPP_DEPS_MODE "external" CACHE STRING "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+
1523
if (NOT JINJA2CPP_DEPS_MODE)
1624
set (JINJA2CPP_DEPS_MODE "internal")
1725
endif ()
@@ -27,27 +35,26 @@ endif ()
2735

2836
if (JINJA2CPP_CXX_STANDARD LESS 14)
2937
message(FATAL_ERROR "Jinja2Cpp is required C++14 or greater standard set. Currently selected standard: ${JINJA2CPP_CXX_STANDARD}")
30-
else()
38+
else ()
3139
message(STATUS "Jinja2Cpp C++ standard: ${JINJA2CPP_CXX_STANDARD}")
3240
endif ()
3341

3442
include(CMakePackageConfigHelpers)
3543
include(GNUInstallDirs)
3644

3745
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
46+
set(CLANG_CXX_FLAGS)
47+
set(GCC_CXX_FLAGS)
48+
set(MSVC_CXX_FLAGS)
3849

3950
if (JINJA2CPP_WITH_COVERAGE)
40-
message (STATUS "This is DEBUG build with enabled Code Coverage")
41-
set (CMAKE_BUILD_TYPE Debug)
42-
set (JINJA2CPP_COVERAGE_TARGET "jinja2cpp_build_coverage")
51+
message(STATUS "This is DEBUG build with enabled Code Coverage")
52+
set(CMAKE_BUILD_TYPE Debug)
53+
set(JINJA2CPP_COVERAGE_TARGET "jinja2cpp_build_coverage")
4354
include(coverage)
4455
add_coverage_target("${JINJA2CPP_COVERAGE_TARGET}")
4556
endif ()
4657

47-
set(JINJA2CPP_SANITIZERS address+undefined memory)
48-
set(JINJA2CPP_WITH_SANITIZERS none CACHE STRING "Build with sanitizer")
49-
set_property(CACHE JINJA2CPP_WITH_SANITIZERS PROPERTY STRINGS ${JINJA2CPP_SANITIZERS})
50-
5158
if(NOT ${JINJA2CPP_WITH_SANITIZERS} STREQUAL "none")
5259
message (STATUS "Build with sanitizers enabled: ${JINJA2CPP_WITH_SANITIZERS}")
5360
set(_chosen_san)
@@ -61,51 +68,46 @@ if(NOT ${JINJA2CPP_WITH_SANITIZERS} STREQUAL "none")
6168
add_sanitizer_target(${JINJA2CPP_SANITIZE_TARGET})
6269
endif()
6370

64-
if (${CMAKE_CXX_COMPILER_ID} MATCHES "Clang" OR ${CMAKE_CXX_COMPILER_ID} MATCHES "GNU")
65-
if (NOT UNIX)
66-
if (${CMAKE_CXX_COMPILER_ID} MATCHES "GNU")
67-
set(CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS} "-Wa,-mbig-obj -O1")
68-
else ()
69-
add_definitions(/D_CRT_SECURE_NO_WARNINGS)
70-
endif ()
71-
else ()
72-
set(CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS} "-fPIC")
73-
endif ()
71+
if (UNIX)
72+
set(GCC_CXX_FLAGS ${GCC_CXX_FLAGS} -fPIC)
73+
set(CLANG_CXX_FLAGS ${CLANG_CXX_FLAGS} -fPIC)
7474
else ()
75-
set (COMMON_MSVC_OPTS "/wd4503 /bigobj")
76-
add_definitions(/DBOOST_ALL_NO_LIB)
77-
75+
set(GCC_CXX_FLAGS ${GCC_CXX_FLAGS} "-Wa,-mbig-obj" -O1)
76+
if (${CMAKE_CXX_COMPILER_ID} MATCHES "GNU")
77+
add_definitions(-D_CRT_SECURE_NO_WARNINGS)
78+
endif ()
79+
add_definitions(-DBOOST_ALL_NO_LIB)
80+
set(MSVC_CXX_FLAGS ${MSVC_CXX_FLAGS} /wd4503 /bigobj)
7881
# MSVC
82+
7983
if (CMAKE_BUILD_TYPE MATCHES "Debug" AND JINJA2CPP_MSVC_RUNTIME_TYPE)
80-
set (JINJA2CPP_MSVC_RUNTIME_TYPE "${JINJA2CPP_MSVC_RUNTIME_TYPE}d")
84+
set(JINJA2CPP_MSVC_RUNTIME_TYPE "${JINJA2CPP_MSVC_RUNTIME_TYPE}d")
8185
endif ()
82-
if (JINJA2CPP_DEPS_MODE MATCHES "conan-build" OR CMAKE_BUILD_TYPE STREQUAL "")
83-
if (NOT JINJA2CPP_MSVC_RUNTIME_TYPE STREQUAL "")
84-
set (MSVC_RUNTIME_DEBUG ${JINJA2CPP_MSVC_RUNTIME_TYPE})
85-
set (MSVC_RUNTIME_RELEASE ${JINJA2CPP_MSVC_RUNTIME_TYPE})
86+
if (CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
87+
if (JINJA2CPP_DEPS_MODE MATCHES "conan-build" OR CMAKE_BUILD_TYPE STREQUAL "")
88+
if (NOT JINJA2CPP_MSVC_RUNTIME_TYPE STREQUAL "")
89+
set(MSVC_RUNTIME_DEBUG ${JINJA2CPP_MSVC_RUNTIME_TYPE})
90+
set(MSVC_RUNTIME_RELEASE ${JINJA2CPP_MSVC_RUNTIME_TYPE})
91+
endif ()
92+
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} ${MSVC_RUNTIME_DEBUG}")
93+
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} ${MSVC_RUNTIME_RELEASE}")
94+
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} ${MSVC_RUNTIME_RELEASE}")
95+
set(CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO "/PROFILE")
96+
set(Boost_USE_DEBUG_RUNTIME OFF)
97+
elseif (CMAKE_BUILD_TYPE MATCHES "Debug")
98+
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} ${JINJA2CPP_MSVC_RUNTIME_TYPE}")
99+
set(Boost_USE_DEBUG_RUNTIME ON)
100+
else ()
101+
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} ${JINJA2CPP_MSVC_RUNTIME_TYPE}")
102+
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} ${JINJA2CPP_MSVC_RUNTIME_TYPE}")
103+
set(CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO "/PROFILE")
104+
set(Boost_USE_DEBUG_RUNTIME OFF)
86105
endif ()
87-
set (CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} ${MSVC_RUNTIME_DEBUG} ${COMMON_MSVC_OPTS}")
88-
set (CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} ${MSVC_RUNTIME_RELEASE} ${COMMON_MSVC_OPTS}")
89-
set (CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} ${MSVC_RUNTIME_RELEASE} ${COMMON_MSVC_OPTS}")
90-
set (CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO "/PROFILE")
91-
set (Boost_USE_DEBUG_RUNTIME OFF)
92-
elseif (CMAKE_BUILD_TYPE MATCHES "Debug")
93-
set (CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} ${JINJA2CPP_MSVC_RUNTIME_TYPE} ${COMMON_MSVC_OPTS}")
94-
set (Boost_USE_DEBUG_RUNTIME ON)
95-
else ()
96-
set (CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} ${JINJA2CPP_MSVC_RUNTIME_TYPE} ${COMMON_MSVC_OPTS}")
97-
set (CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} ${JINJA2CPP_MSVC_RUNTIME_TYPE} ${COMMON_MSVC_OPTS}")
98-
set (CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO "/PROFILE")
99-
set (Boost_USE_DEBUG_RUNTIME OFF)
106+
message(STATUS "Selected MSVC runtime type for Jinja2C++ library: '${JINJA2CPP_MSVC_RUNTIME_TYPE}'")
100107
endif ()
101-
message (STATUS "Selected MSVC runtime type for Jinja2C++ library: '${JINJA2CPP_MSVC_RUNTIME_TYPE}'")
102108
endif()
103109

104110

105-
option(JINJA2CPP_BUILD_TESTS "Build Jinja2Cpp unit tests" ${JINJA2CPP_IS_MAIN_PROJECT})
106-
option(JINJA2CPP_STRICT_WARNINGS "Enable additional warnings and treat them as errors" ON)
107-
option(JINJA2CPP_BUILD_SHARED "Build shared linkage version of Jinja2Cpp" OFF)
108-
109111
if (JINJA2CPP_BUILD_SHARED)
110112
set(LIB_LINK_TYPE SHARED)
111113
else()
@@ -132,18 +134,18 @@ set(JINJA2CPP_EXTRA_LIBS "" CACHE STRING "You can pass some libs that could used
132134
set(JINJA2CPP_PUBLIC_LIBS "${JINJA2CPP_EXTRA_LIBS}")
133135
separate_arguments(JINJA2CPP_PUBLIC_LIBS)
134136
if (JINJA2CPP_WITH_COVERAGE)
135-
target_compile_options(
136-
${JINJA2CPP_COVERAGE_TARGET}
137-
INTERFACE
138-
-g -O0
137+
target_compile_options(
138+
${JINJA2CPP_COVERAGE_TARGET}
139+
INTERFACE
140+
-g -O0
139141
)
140142
list(APPEND JINJA2CPP_PUBLIC_LIBS ${JINJA2CPP_COVERAGE_TARGET})
141143
endif()
142144
if (NOT JINJA2CPP_WITH_SANITIZERS STREQUAL "none")
143-
target_compile_options(
144-
${JINJA2CPP_SANITIZE_TARGET}
145-
INTERFACE
146-
-g -O2
145+
target_compile_options(
146+
${JINJA2CPP_SANITIZE_TARGET}
147+
INTERFACE
148+
-g -O2
147149
)
148150
list(APPEND JINJA2CPP_PUBLIC_LIBS ${JINJA2CPP_SANITIZE_TARGET})
149151
endif()
@@ -166,15 +168,21 @@ target_include_directories(${LIB_TARGET_NAME}
166168
)
167169

168170
if (JINJA2CPP_STRICT_WARNINGS)
169-
if (NOT MSVC)
170-
if (UNIX)
171-
target_compile_options(${LIB_TARGET_NAME} PRIVATE -Wall -Werror -Wno-unused-command-line-argument)
172-
endif ()
173-
else ()
174-
target_compile_options(${LIB_TARGET_NAME} PRIVATE /W4)
171+
if (UNIX)
172+
set(GCC_CXX_FLAGS ${GCC_CXX_FLAGS} -Wall -Werror)
173+
set(CLANG_CXX_FLAGS ${CLANG_CXX_FLAGS} -Wall -Werror -Wno-unused-command-line-argument)
174+
set(MSVC_CXX_FLAGS ${MSVC_CXX_FLAGS} /W4)
175175
endif ()
176176
endif ()
177177

178+
if (${CMAKE_CXX_COMPILER_ID} MATCHES "GNU")
179+
target_compile_options(${LIB_TARGET_NAME} PRIVATE ${GCC_CXX_FLAGS})
180+
elseif (${CMAKE_CXX_COMPILER_ID} MATCHES "Clang")
181+
target_compile_options(${LIB_TARGET_NAME} PRIVATE ${CLANG_CXX_FLAGS})
182+
elseif (${CMAKE_CXX_COMPILER_ID} MATCHES "MSVC")
183+
target_compile_options(${LIB_TARGET_NAME} PRIVATE ${MSVC_CXX_FLAGS})
184+
endif ()
185+
178186
target_compile_definitions(${LIB_TARGET_NAME} PUBLIC BOOST_SYSTEM_NO_DEPRECATED BOOST_ERROR_CODE_HEADER_ONLY)
179187

180188
set_target_properties(${LIB_TARGET_NAME} PROPERTIES
@@ -199,22 +207,22 @@ if (JINJA2CPP_BUILD_TESTS)
199207
target_link_libraries(jinja2cpp_tests gtest gtest_main nlohmann_json ${LIB_TARGET_NAME} ${EXTRA_TEST_LIBS} ${JINJA2CPP_PRIVATE_LIBS})
200208

201209
set_target_properties(jinja2cpp_tests PROPERTIES
202-
CXX_STANDARD ${JINJA2CPP_CXX_STANDARD}
203-
CXX_STANDARD_REQUIRED ON)
210+
CXX_STANDARD ${JINJA2CPP_CXX_STANDARD}
211+
CXX_STANDARD_REQUIRED ON)
204212

205-
if (MSVC)
206-
target_compile_options(jinja2cpp_tests PRIVATE /bigobj)
207-
endif ()
213+
if (MSVC)
214+
target_compile_options(jinja2cpp_tests PRIVATE /bigobj)
215+
endif ()
208216

209217
add_custom_command(
210-
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/test_data/simple_template1.j2tpl
211-
COMMAND ${CMAKE_COMMAND} ARGS -E copy_directory ${CMAKE_CURRENT_SOURCE_DIR}/test/test_data ${CMAKE_CURRENT_BINARY_DIR}/test_data
212-
MAIN_DEPENDENCY ${CMAKE_CURRENT_SOURCE_DIR}/test/test_data/simple_template1.j2tpl
213-
COMMENT "Copy test data to the destination dir"
218+
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/test_data/simple_template1.j2tpl
219+
COMMAND ${CMAKE_COMMAND} ARGS -E copy_directory ${CMAKE_CURRENT_SOURCE_DIR}/test/test_data ${CMAKE_CURRENT_BINARY_DIR}/test_data
220+
MAIN_DEPENDENCY ${CMAKE_CURRENT_SOURCE_DIR}/test/test_data/simple_template1.j2tpl
221+
COMMENT "Copy test data to the destination dir"
214222
)
215223

216224
add_custom_target(CopyTestData ALL
217-
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/test_data/simple_template1.j2tpl
225+
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/test_data/simple_template1.j2tpl
218226
)
219227

220228
add_dependencies(jinja2cpp_tests CopyTestData)

README.md

+41-14
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44

55
[![Language](https://img.shields.io/badge/language-C++-blue.svg)](https://isocpp.org/)
66
[![Standard](https://img.shields.io/badge/c%2B%2B-14-blue.svg)](https://en.wikipedia.org/wiki/C%2B%2B#Standardization)
7-
[![Build Status](https://travis-ci.org/jinja2cpp/Jinja2Cpp.svg?branch=master)](https://travis-ci.org/jinja2cpp/Jinja2Cpp)
8-
[![Build status](https://ci.appveyor.com/api/projects/status/vu59lw4r67n8jdxl/branch/master?svg=true)](https://ci.appveyor.com/project/flexferrum/jinja2cpp-n5hjm/branch/master)
97
[![Coverage Status](https://codecov.io/gh/jinja2cpp/Jinja2Cpp/branch/master/graph/badge.svg)](https://codecov.io/gh/jinja2cpp/Jinja2Cpp)
108
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/ff01fa4410ac417f8192dce78e919ece)](https://www.codacy.com/app/flexferrum/Jinja2Cpp_2?utm_source=github.com&utm_medium=referral&utm_content=jinja2cpp/Jinja2Cpp&utm_campaign=Badge_Grade)
119
[![Github Releases](https://img.shields.io/github/release/jinja2cpp/Jinja2Cpp/all.svg)](https://github.com/jinja2cpp/Jinja2Cpp/releases)
@@ -110,7 +108,7 @@ Currently, Jinja2C++ supports the limited number of Jinja2 features. By the way,
110108
- 'with' statement
111109
- 'do' extension statement
112110
- recursive loops
113-
- space control
111+
- space control and 'raw'/'endraw' blocks
114112

115113
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).
116114

@@ -127,25 +125,33 @@ Compilation of Jinja2C++ tested on the following compilers (with C++14 and C++17
127125

128126
**Note:** Support of gcc version >= 9.x or clang version >= 8.0 depends on the version of the Boost library provided.
129127

128+
### Build status
129+
130+
| Compiler | Status |
131+
|---------|---------:|
132+
| **MSVC** 2015 (x86, x64), **MinGW** 7 (x64), **MinGW** 8 (x64) | [![Build status](https://ci.appveyor.com/api/projects/status/vu59lw4r67n8jdxl/branch/master?svg=true)](https://ci.appveyor.com/project/flexferrum/jinja2cpp-n5hjm/branch/master) |
133+
| **X-Code** 9, 10, 11 | [![Build Status](https://travis-ci.org/jinja2cpp/Jinja2Cpp.svg?branch=master)](https://travis-ci.org/jinja2cpp/Jinja2Cpp) |
134+
| **MSVC** 2017 (x86, x64), **MSVC** 2019 (x86, x64), C++14/C++17 | [![](https://github.com/jinja2cpp/Jinja2Cpp/workflows/CI-windows-build/badge.svg)](https://github.com/jinja2cpp/Jinja2Cpp/actions?query=workflow%3ACI-windows-build) |
135+
| **g++** 5, 6, 7, 8, 9, **clang** 5, 6, 7, 8 C++14/C++17 | [![](https://github.com/jinja2cpp/Jinja2Cpp/workflows/CI-linux-build/badge.svg)](https://github.com/jinja2cpp/Jinja2Cpp/actions?query=workflow%3ACI-linux-build) |
136+
130137
## Build and install
131138
Jinja2C++ has several external dependencies:
132139
- `boost` library (at least version 1.65)
133140
- `nonstd::expected-lite` [https://github.com/martinmoene/expected-lite](https://github.com/martinmoene/expected-lite)
134141
- `nonstd::variant-lite` [https://github.com/martinmoene/variant-lite](https://github.com/martinmoene/variant-lite)
135-
- `nonstd::value-ptr-lite` [https://github.com/martinmoene/value-ptr-lite](https://github.com/martinmoene/value-ptr-lite)
136142
- `nonstd::optional-lite` [https://github.com/martinmoene/optional-lite](https://github.com/martinmoene/optional-lite)
137143
- `nonstd::string-view-lite` [https://github.com/martinmoene/string-view-lite](https://github.com/martinmoene/string-view-lite)
138144
- `fmtlib::fmt` [https://github.com/fmtlib/fmt](https://github.com/fmtlib/fmt)
139-
- `robin-hood-hashing` [https://github.com/martinus/robin-hood-hashing](https://github.com/martinus/robin-hood-hashing)
145+
146+
Examples of build scripts and different build configurations can be found here: [https://github.com/jinja2cpp/examples-build](https://github.com/jinja2cpp/examples-build)
140147

141148
In simplest case to compile Jinja2C++ you need:
142149

143150
1. Install CMake build system (at least version 3.0)
144-
2. Clone jinja2cpp repository and update submodules:
151+
2. Clone jinja2cpp repository:
145152

146153
```
147154
> git clone https://github.com/flexferrum/Jinja2Cpp.git
148-
> git submodule -q update --init
149155
```
150156

151157
3. Create build directory:
@@ -170,8 +176,7 @@ In simplest case to compile Jinja2C++ you need:
170176
> cmake --build . --target install
171177
```
172178

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.
175180
### Usage with conan.io dependency manager
176181
Jinja2C++ can be used as conan.io package. In this case, you should do the following steps:
177182

@@ -227,7 +232,7 @@ You can define (via -D command-line CMake option) the following build flags:
227232

228233

229234
### 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.
231236

232237
## Acknowledgments
233238
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.
238243

239244
Thanks to **@martinus** for the fast hash maps implementation.
240245

241-
Thanks to **@palchukovsky** for the great contribution into the codebase.
242246

243-
Thanks to **@rmorozov** for sanitized builds setup.
247+
## Changelog
244248

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
245262

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`
247274

248275
### Version 1.0.0
249276
#### Changes and improvements
@@ -281,7 +308,7 @@ Thanks to **@rmorozov** for sanitized builds setup.
281308
- `include`, `import` and `from` statements implemented. Now it's possible to include other templates and use macros from other templates.
282309
- `with` statement implemented
283310
- `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)
285312
- Documentation site created for Jinja2C++: https://jinja2cpp.dev/
286313

287314
#### Minor changes

cmake/public/jinja2cpp-config.cmake.in

-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ endif()
5454
add_library(jinja2cpp STATIC IMPORTED)
5555

5656
set_target_properties(jinja2cpp PROPERTIES
57-
INTERFACE_COMPILE_DEFINITIONS "variant_CONFIG_SELECT_VARIANT=variant_VARIANT_NONSTD"
5857
INTERFACE_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/include"
5958
)
6059

jinja2cpp.pc.in

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ exec_prefix=@CMAKE_INSTALL_PREFIX@
33
libdir=${exec_prefix}/@CMAKE_INSTALL_LIBDIR@
44
includedir=${prefix}/@CMAKE_INSTALL_INCLUDEDIR@
55

6-
Name: @PROJECT_NAME@
6+
Name: @PROJECT_NAME@
77
Description: @PROJECT_DESCRIPTION@
88
Version: @PROJECT_VERSION@
99

1010
Requires:
1111
Libs: -L${libdir} -ljinja2cpp
12-
Cflags: -I${includedir} -Dvariant_CONFIG_SELECT_VARIANT=variant_VARIANT_NONSTD
12+
Cflags: -I${includedir}

0 commit comments

Comments
 (0)