Fix ICU build on Windows

This commit is contained in:
Kovid Goyal 2021-06-16 17:02:07 +05:30
parent ae25a1f425
commit d8595e5bf5
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
2 changed files with 4 additions and 3 deletions

View File

@ -48,6 +48,7 @@ class Extension(object):
self.error = d['error'] = kwargs.get('error', None)
self.libraries = d['libraries'] = kwargs.get('libraries', [])
self.cflags = d['cflags'] = kwargs.get('cflags', [])
self.uses_icu = 'icuuc' in self.libraries
if iswindows:
self.cflags.append('/DCALIBRE_MODINIT_FUNC=PyMODINIT_FUNC')
if self.needs_cxx and kwargs.get('needs_c++14'):
@ -399,7 +400,7 @@ class Build(Command):
cmd = [linker]
if iswindows:
pre_ld_flags = []
if ext.name in ('icu', 'matcher'):
if ext.uses_icu:
# windows has its own ICU libs that dont work
pre_ld_flags = elib
cmd += pre_ld_flags + self.env.ldflags + ext.ldflags + elib + xlib + \

View File

@ -197,7 +197,7 @@ tok_create(void *sqlite3, const char **azArg, int nArg, Fts5Tokenizer **ppOut) {
rc = p->constructor_error;
delete p;
}
} catch (std::bad_alloc &ex) {
} catch (std::bad_alloc) {
return SQLITE_NOMEM;
} catch (...) {
return SQLITE_ERROR;
@ -210,7 +210,7 @@ tok_tokenize(Fts5Tokenizer *tokenizer_ptr, void *callback_ctx, int flags, const
Tokenizer *p = reinterpret_cast<Tokenizer*>(tokenizer_ptr);
try {
return p->tokenize(callback_ctx, flags, text, text_sz, callback);
} catch (std::bad_alloc &ex) {
} catch (std::bad_alloc) {
return SQLITE_NOMEM;
} catch (...) {
return SQLITE_ERROR;