From 586d18aac0bc5670c181bb183d9da36daa18ec92 Mon Sep 17 00:00:00 2001 From: Matthew Wonlaw Date: Fri, 25 Oct 2024 11:59:40 -0400 Subject: [PATCH] enable icu --- .github/workflows/build.yml | 8 +++--- deps/common.gypi | 52 ++++++++++++++++++++++++++++++++++++- deps/defines.gypi | 1 + deps/download.sh | 1 + docs/compilation.md | 1 + 5 files changed, 59 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 1f9c1f01..90952875 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -44,15 +44,17 @@ jobs: with: node-version: ${{ matrix.node }} - if: ${{ startsWith(matrix.os, 'windows') }} - run: pip.exe install setuptools + run: | + pip.exe install setuptools + vcpkg install icu:x64-windows - if: ${{ startsWith(matrix.os, 'macos') }} - run: brew install python-setuptools + run: brew install python-setuptools icu4c - if: ${{ !startsWith(matrix.os, 'windows') && !startsWith(matrix.os, 'macos') }} run: python3 -m pip install setuptools - if: ${{ startsWith(matrix.os, 'ubuntu') }} run: | sudo apt update - sudo apt install gcc-10 g++-10 -y + sudo apt install gcc-10 g++-10 libicu-dev -y sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-10 100 --slave /usr/bin/g++ g++ /usr/bin/g++-10 --slave /usr/bin/gcov gcov /usr/bin/gcov-10 - run: npm install --ignore-scripts - run: npm run build-debug diff --git a/deps/common.gypi b/deps/common.gypi index 613adc35..83e3dc2e 100644 --- a/deps/common.gypi +++ b/deps/common.gypi @@ -4,7 +4,11 @@ # === { - 'variables': { 'sqlite3%': '' }, + 'variables': { + 'sqlite3%': '', + 'lib_prefix': '', + 'lib_suffix': '', + }, 'target_defaults': { 'default_configuration': 'Release', 'msvs_settings': { @@ -15,7 +19,23 @@ 'conditions': [ ['OS == "win"', { 'defines': ['WIN32'], + }, { + 'libraries': [ + '-licui18n', + '-licuuc', + '-licudata', + ], }], + ['OS == "mac"', { + 'include_dirs': [ + '/usr/local/opt/icu4c/include', + '/opt/homebrew/opt/icu4c/include' + ], + 'library_dirs': [ + '/usr/local/opt/icu4c/lib', + '/opt/homebrew/opt/icu4c/lib' + ], + }] ], 'configurations': { 'Debug': { @@ -41,6 +61,19 @@ 'msvs_settings': { 'VCLinkerTool': { 'GenerateDebugInformation': 'true', + 'AdditionalDependencies': [ + 'icuin.lib', + 'icuuc.lib', + 'icudt.lib', + ], + 'AdditionalLibraryDirectories': [ + '$(VCPKG_ROOT)/installed/x64-windows/lib', + ], + }, + 'VCCLCompilerTool': { + 'AdditionalIncludeDirectories': [ + '$(VCPKG_ROOT)/installed/x64-windows/include', + ], }, }, }, @@ -62,6 +95,23 @@ 'DEAD_CODE_STRIPPING': 'YES', 'GCC_INLINES_ARE_PRIVATE_EXTERN': 'YES', }, + 'msvs_settings': { + 'VCLinkerTool': { + 'AdditionalDependencies': [ + 'icuin.lib', + 'icuuc.lib', + 'icudt.lib', + ], + 'AdditionalLibraryDirectories': [ + '$(VCPKG_ROOT)/installed/x64-windows/lib', + ], + }, + 'VCCLCompilerTool': { + 'AdditionalIncludeDirectories': [ + '$(VCPKG_ROOT)/installed/x64-windows/include', + ], + }, + }, }, }, }, diff --git a/deps/defines.gypi b/deps/defines.gypi index 58bbe36a..4b695129 100644 --- a/deps/defines.gypi +++ b/deps/defines.gypi @@ -38,5 +38,6 @@ 'SQLITE_TRACE_SIZE_LIMIT=32', 'SQLITE_USE_URI=0', 'SQLITE_OMIT_LOAD_EXTENSION', + 'SQLITE_ENABLE_ICU', ], } diff --git a/deps/download.sh b/deps/download.sh index 184c522d..423439b4 100755 --- a/deps/download.sh +++ b/deps/download.sh @@ -58,6 +58,7 @@ SQLITE_THREADSAFE=2 SQLITE_TRACE_SIZE_LIMIT=32 SQLITE_USE_URI=0 SQLITE_OMIT_LOAD_EXTENSION +SQLITE_ENABLE_ICU " # ========== START SCRIPT ========== # diff --git a/docs/compilation.md b/docs/compilation.md index 360ae0d3..fc5a7afa 100644 --- a/docs/compilation.md +++ b/docs/compilation.md @@ -82,4 +82,5 @@ SQLITE_THREADSAFE=2 SQLITE_TRACE_SIZE_LIMIT=32 SQLITE_USE_URI=0 SQLITE_OMIT_LOAD_EXTENSION +SQLITE_ENABLE_ICU ```