From fb9a48cc5eb6ef1ff155ed1a6e77d21d0b6eeff6 Mon Sep 17 00:00:00 2001 From: Qijia Liu Date: Fri, 13 Oct 2023 16:12:15 -0700 Subject: [PATCH] drop boost regex lib for windows and macos (#735) --- .github/workflows/macos-build.yml | 1 - .github/workflows/release-ci.yml | 4 +- .github/workflows/windows-build.yml | 12 ---- CMakeLists.txt | 8 ++- build-clang.bat | 21 +------ build.bat | 89 +---------------------------- install-boost.sh | 17 ------ 7 files changed, 9 insertions(+), 143 deletions(-) diff --git a/.github/workflows/macos-build.yml b/.github/workflows/macos-build.yml index 570d1e9d75..5aae854ab1 100644 --- a/.github/workflows/macos-build.yml +++ b/.github/workflows/macos-build.yml @@ -44,7 +44,6 @@ jobs: with: path: | ${{ env.BOOST_ROOT }}.tar.bz2 - ${{ env.BOOST_ROOT }}/stage key: ${{ runner.os }}-boost-${{ env.boost_version }} - name: Extract Boost source tarball diff --git a/.github/workflows/release-ci.yml b/.github/workflows/release-ci.yml index c66a196708..53b8728b1e 100644 --- a/.github/workflows/release-ci.yml +++ b/.github/workflows/release-ci.yml @@ -13,12 +13,12 @@ jobs: uses: ./.github/workflows/macos-build.yml with: build_variant: '-universal' - rime_plugins: rime/librime-charcode hchunhui/librime-lua lotem/librime-octagram + rime_plugins: hchunhui/librime-lua lotem/librime-octagram windows: uses: ./.github/workflows/windows-build.yml with: - rime_plugins: rime/librime-charcode hchunhui/librime-lua lotem/librime-octagram + rime_plugins: hchunhui/librime-lua lotem/librime-octagram release: needs: [macos, windows] diff --git a/.github/workflows/windows-build.yml b/.github/workflows/windows-build.yml index 816b6501e4..460581d5a2 100644 --- a/.github/workflows/windows-build.yml +++ b/.github/workflows/windows-build.yml @@ -82,18 +82,6 @@ jobs: 7z x ${{ env.BOOST_ROOT }}.7z popd - - name: Cache Boost lib - id: cache-boost-lib - uses: actions/cache@v3 - with: - path: | - ${{ env.BOOST_ROOT }}\stage - key: ${{ runner.os }}-boost-${{ env.boost_version }}-${{ matrix.compiler }}-lib - - - name: Install Boost - if: steps.cache-boost-lib.outputs.cache-hit != 'true' - run: ${{ env.build_script }} boost - - name: Cache dependencies id: cache-deps uses: actions/cache@v3 diff --git a/CMakeLists.txt b/CMakeLists.txt index af87ccf6b4..3630168958 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -58,9 +58,11 @@ if(MSVC) set(Boost_USE_STATIC_RUNTIME ON) endif() -set(BOOST_COMPONENTS regex) - -find_package(Boost 1.74.0 REQUIRED COMPONENTS ${BOOST_COMPONENTS}) +if(LINUX) + find_package(Boost 1.74.0 REQUIRED COMPONENTS regex) +else() + find_package(Boost 1.77.0) +endif() if(Boost_FOUND) include_directories(${Boost_INCLUDE_DIRS}) link_directories(${Boost_LIBRARY_DIRS}) diff --git a/build-clang.bat b/build-clang.bat index df1b1d2e0c..44772c7a44 100644 --- a/build-clang.bat +++ b/build-clang.bat @@ -12,7 +12,6 @@ set arch=x86 if "%PROCESSOR_ARCHITECTURE%" == "ARM64" set arch=arm set clean=0 -set build_boost=0 set build_deps=0 set build_librime=0 set build_test=OFF @@ -20,7 +19,6 @@ set build_test=OFF :parse_cmdline_options if "%1" == "" goto end_parsing_cmdline_options if "%1" == "clean" set clean=1 -if "%1" == "boost" set build_boost=1 if "%1" == "deps" set build_deps=1 if "%1" == "librime" set build_librime=1 if "%1" == "test" ( @@ -32,10 +30,9 @@ goto parse_cmdline_options :end_parsing_cmdline_options if %clean% == 0 ( -if %build_boost% == 0 ( if %build_deps% == 0 ( set build_librime=1 -))) +)) if %clean% == 1 ( rmdir /s /q build @@ -47,22 +44,6 @@ if %clean% == 1 ( rmdir /s /q deps\yaml-cpp\build ) -if %build_boost% == 1 ( - pushd %BOOST_ROOT% || exit - if not exist b2.exe call .\bootstrap.bat || exit - b2 toolset=clang-win^ - architecture=%arch%^ - address-model=64^ - variant=release^ - link=static^ - runtime-link=static^ - stage^ - --with-locale^ - --with-filesystem^ - --with-regex || exit - popd -) - set common_cmake_flags=-B build^ -G Ninja^ -DCMAKE_C_COMPILER=clang^ diff --git a/build.bat b/build.bat index dec630757c..29c79fc6e9 100644 --- a/build.bat +++ b/build.bat @@ -30,11 +30,6 @@ set clean=0 set build_dir_base=build set build_dir_suffix= set build_config=Release -set build_boost=0 -set build_boost_x86=0 -set build_boost_x64=0 -set build_boost_arm64=0 -set boost_build_variant=release set build_deps=0 set build_librime=0 set build_shared=ON @@ -44,19 +39,6 @@ set enable_logging=ON :parse_cmdline_options if "%1" == "" goto end_parsing_cmdline_options if "%1" == "clean" set clean=1 -if "%1" == "boost" set build_boost=1 -if "%1" == "boost_x86" ( - set build_boost=1 - set build_boost_x86=1 -) -if "%1" == "boost_x64" ( - set build_boost=1 - set build_boost_x64=1 -) -if "%1" == "boost_arm64" ( - set build_boost=1 - set build_boost_arm64=1 -) if "%1" == "deps" set build_deps=1 rem `thirdparty` is deprecated in favor of `deps` if "%1" == "thirdparty" set build_deps=1 @@ -76,13 +58,10 @@ if "%1" == "test" ( if "%1" == "debug" ( set build_dir_base=debug set build_config=Debug - set boost_build_variant=debug ) if "%1" == "release" ( set build_dir_base=build set build_config=Release - set boost_build_variant=release - ) if "%1" == "logging" ( set enable_logging=ON @@ -96,10 +75,9 @@ goto parse_cmdline_options if %clean% == 0 ( if %build_librime% == 0 ( -if %build_boost% == 0 ( if %build_deps% == 0 ( set build_librime=1 -)))) +))) if %clean% == 1 ( md .temp @@ -115,71 +93,6 @@ if %clean% == 1 ( set build_dir=%build_dir_base%%build_dir_suffix% -rem set curl=%RIME_ROOT%\bin\curl.exe -rem set download="%curl%" --remote-name-all - -set boost_compiled_libs=--with-date_time^ - --with-locale^ - --with-regex^ - --with-thread - -rem the number actually means platform toolset, not %VisualStudioVersion% -rem eg. BJAM_TOOLSET=msvc-14.2 corresponds to PLATFORM_TOOLSET=v142 -if defined BJAM_TOOLSET ( - set bjam_options=toolset=%BJAM_TOOLSET% -) -set bjam_options=%bjam_options%^ - variant=%boost_build_variant%^ - link=static^ - threading=multi^ - runtime-link=static^ - cxxflags="/Zc:threadSafeInit- " - -set bjam_options_x86=%bjam_options%^ - define=BOOST_USE_WINAPI_VERSION=0x0501^ - architecture=x86^ - address-model=32 - -set bjam_options_x64=%bjam_options%^ - define=BOOST_USE_WINAPI_VERSION=0x0502^ - architecture=x86^ - address-model=64 - -set bjam_options_arm64=%bjam_options%^ - define=BOOST_USE_WINAPI_VERSION=0x0A00^ - architecture=arm^ - address-model=64 - -if %build_boost% == 1 ( -if %build_boost_x86% == 0 ( -if %build_boost_x64% == 0 ( -if %build_boost_arm64% == 0 ( - rem default architecture - set build_boost_x86=1 -)))) - -if %build_boost% == 1 ( - pushd %BOOST_ROOT% - if not exist b2.exe call .\bootstrap.bat - if errorlevel 1 goto error - - if %build_boost_x86% == 1 ( - b2 %bjam_options_x86% stage %boost_compiled_libs% - if errorlevel 1 goto error - ) - - if %build_boost_x64% == 1 ( - b2 %bjam_options_x64% stage %boost_compiled_libs% - if errorlevel 1 goto error - ) - - if %build_boost_arm64% == 1 ( - b2 %bjam_options_arm64% stage %boost_compiled_libs% - if errorlevel 1 goto error - ) - popd -) - if defined CMAKE_GENERATOR ( set common_cmake_flags=%common_cmake_flags% -G%CMAKE_GENERATOR% ) diff --git a/install-boost.sh b/install-boost.sh index 0a3fa3ca93..ef442a371d 100755 --- a/install-boost.sh +++ b/install-boost.sh @@ -23,18 +23,6 @@ download_boost_source() { [[ -f "${BOOST_ROOT}/bootstrap.sh" ]] } -boost_libs="${boost_libs=regex}" -boost_cxxflags='-arch arm64 -arch x86_64' - -build_boost_macos() { - cd "${BOOST_ROOT}" - ./bootstrap.sh --with-toolset=clang --with-libraries="${boost_libs}" - ./b2 -q -a link=static architecture=arm cxxflags="${boost_cxxflags}" stage - for lib in stage/lib/*.a; do - lipo $lib -info - done -} - if [[ $# -eq 0 || " $* " =~ ' --download ' ]]; then if [[ ! -f "${BOOST_ROOT}/bootstrap.sh" ]]; then download_boost_source @@ -42,8 +30,3 @@ if [[ $# -eq 0 || " $* " =~ ' --download ' ]]; then echo "found boost at ${BOOST_ROOT}" fi fi -if [[ $# -eq 0 || " $* " =~ ' --build ' ]]; then - if [[ "$OSTYPE" =~ 'darwin' ]]; then - build_boost_macos - fi -fi