-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
jinja2cpp: add new version 1.3.2 #21305
Conversation
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
||
if (NOT DEFINED JINJA2_PRIVATE_LIBS_INT) | ||
set(JINJA2CPP_PRIVATE_LIBS ${JINJA2CPP_PRIVATE_LIBS} | ||
- Boost::variant Boost::filesystem Boost::algorithm Boost::lexical_cast Boost::json |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@toge , would you mind telling me why we removing boost::regex, boost::json?
boost::regex seems to significantly speed ups template loading?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rmorozov
Oh, it's my mistake.
Thank you for your review!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have added special option to choose which regex to use - default one is boost regex, but if it is not suitable feel free to override and use std regex as it was earlier
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
recipes/jinja2cpp/all/conanfile.py
Outdated
@@ -76,6 +76,12 @@ def validate(self): | |||
raise ConanInvalidConfiguration( | |||
f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support." | |||
) | |||
if Version(self.version) >= "1.3.1" and self.settings.compiler == "apple-clang": |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have a special switch for this case
https://github.com/jinja2cpp/Jinja2Cpp/blob/master/CMakeLists.txt#L18
for apple-clang there can be -DJINJA2CPP_WITH_JSON_BINDINGS=rapid, which doesn't require boost::json
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rmorozov
Thanks a lot!
I will fix this issue.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rmorozov
I tried to compile jinja2cpp/1.3.1 with apple-clang with INJA2CPP_WITH_JSON_BINDINGS=rapid.
But I get the same compile error due to Boost::json.
This is because CMakeLists.txt in jinja2cpp/1.3.1 tries to link Boost::json despite the value of INJA2CPP_WITH_JSON_BINDINGS.
I will try to make jinja2cpp/1.3.1 not compatible with apple-clang in this PR, because I think it is necessary to fix CMakeLists.txt or conan's boost recipe.
This comment has been minimized.
This comment has been minimized.
@RubenRBS |
diff --git a/src/helpers.h b/src/helpers.h | ||
index 3af280f..b1c31fe 100644 | ||
--- a/src/helpers.h | ||
+++ b/src/helpers.h | ||
@@ -32,12 +32,21 @@ struct MultiStringLiteral | ||
#endif | ||
} | ||
|
||
+#if defined(_MSC_VER) && (_MSC_VER <= 1900) | ||
+ template<typename CharT> | ||
+ auto GetValueStr() const | ||
+ { | ||
+ auto memPtr = SelectMemberPtr<CharT, &MultiStringLiteral::charValue, &MultiStringLiteral::wcharValue>::GetPtr(); | ||
+ return std::basic_string<CharT>(this->*memPtr); | ||
+ } | ||
+#else | ||
template<typename CharT> | ||
constexpr auto GetValueStr() const | ||
{ | ||
constexpr auto memPtr = SelectMemberPtr<CharT, &MultiStringLiteral::charValue, &MultiStringLiteral::wcharValue>::GetPtr(); | ||
return std::basic_string<CharT>(this->*memPtr); | ||
} | ||
+#endif | ||
|
||
template<typename CharT, const char* MultiStringLiteral::*, const wchar_t* MultiStringLiteral::*> | ||
struct SelectMemberPtr; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be a separate patch. Submitted upstream as well, if possible.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for the delay @toge, I'll get to this review early next monday, this PR fell thru the cracks and I just now found it again :)
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello and thank you for bumping this recipe.
Boost regex is not mandatory in 1.3.2, but used by default due its speed:
I would suggest adding a logic in generate to follow that support:
def generate(self):
tc = CMakeToolchain(self)
if Version(self.version) >= "1.3.2":
tc.cache_variables["JINJA2CPP_USE_REGEX"] = "std" if self.dependencies["boost"].options.without_regex else "boost"
@uilianries Your suggested code doesn't work well.
It may be a bug. I added |
Conan v1 pipeline ✔️All green in build 7 (
Conan v2 pipeline ✔️
All green in build 7 ( |
@toge thank you for pinging. I'll take a look tomorrow 😁 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thank you @toge!
Specify library name and version: jinja2cpp/1.3.2
jinja2cpp/1.3.2 requires Boost::json.
But Boost::json is not avaiable in apple-clang.
https://github.com/conan-io/conan-center-index/pull/5246/files#r616257192
In this PR, I will drop apple-clang support for jinja2cpp/1.3.2.
I'm trying to relax apple-clang condition for boost.