-
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
[boost] Optionally use ICU #1274
Changes from 6 commits
16983b2
350e87b
9b40af4
fc9c7dd
f460ff5
2b15d9a
67086e2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -55,7 +55,8 @@ class BoostConan(ConanFile): | |
"segmented_stacks": [True, False], | ||
"debug_level": [i for i in range(1, 14)], | ||
"pch": [True, False], | ||
"extra_b2_flags": "ANY" # custom b2 flags | ||
"extra_b2_flags": "ANY", # custom b2 flags | ||
"icu": [True, False], | ||
} | ||
options.update({"without_%s" % libname: [True, False] for libname in lib_list}) | ||
|
||
|
@@ -81,6 +82,7 @@ class BoostConan(ConanFile): | |
"debug_level": 2, | ||
'pch': True, | ||
'extra_b2_flags': 'None', | ||
"icu": False, | ||
} | ||
|
||
for libname in lib_list: | ||
|
@@ -133,6 +135,8 @@ def requirements(self): | |
self.requires("xz_utils/5.2.4") | ||
if self.options.zstd: | ||
self.requires("zstd/1.4.3") | ||
if self.options.icu: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. probably we have to check for There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ICU applies to There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yes, seems to be check should be like: There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I've added a check. 'locale' doesn't compile without a i18n backend, but 'regex' does 🤷 |
||
self.requires("icu/64.2") | ||
|
||
def package_id(self): | ||
if self.options.header_only: | ||
|
@@ -539,6 +543,12 @@ def _build_flags(self): | |
flags.append("-sNO_LZMA=%s" % ("0" if self.options.lzma else "1")) | ||
flags.append("-sNO_ZSTD=%s" % ("0" if self.options.zstd else "1")) | ||
|
||
if self.options.icu: | ||
flags.append("-sICU_PATH={}".format(self.deps_cpp_info["icu"].rootpath)) | ||
flags.append("boost.locale.iconv=off boost.locale.icu=on") | ||
else: | ||
flags.append("--disable-icu") | ||
|
||
def add_defines(option, library): | ||
if option: | ||
for define in self.deps_cpp_info[library].defines: | ||
|
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.
are ICU and iconv mutually exclusive options?
if yes, maybe it's better to design option like
locale_backend: ["ICU", "iconv", None]
this might be helpful: https://github.com/bincrafters/conan-boost_base/blob/testing/2.0.0/conanfile.py
/cc @grafikrobot
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 think that
iconv
is more like a fallback, you can choose to useicu
, but if it is not available, the package will useiconv
. It also follows the same option pattern aszlib
,zstd
,... if you activate it then more requires will be added.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.
they are different. zlib, zstd, bzip2 backends can be used together, while iconv and ICU seems to be mutually exclusive.