From d3af19bafbafa654dbdb066d308a25307d45ea82 Mon Sep 17 00:00:00 2001 From: Congyu <52687642+Congyuwang@users.noreply.github.com> Date: Fri, 1 Mar 2024 19:56:55 +0800 Subject: [PATCH] Windows lto (#113) * enable lto for windows build * drop support for win32 --- .github/workflows/CI.yml | 8 +++++++- .github/workflows/PR.yml | 8 +++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 0f48c57..cf04287 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -58,7 +58,7 @@ jobs: strategy: fail-fast: false matrix: - target: [x64, x86] + target: [x64] py_version: [3.7, 3.8, 3.9, "3.10", "3.11", "3.12"] steps: - uses: actions/checkout@v2 @@ -83,6 +83,12 @@ jobs: args: --release --out dist env: LIBCLANG_PATH: ${{ runner.temp }}/llvm-17.0/lib + CC: ${{ runner.temp }}/llvm-17.0/bin/clang-cl + CXX: ${{ runner.temp }}/llvm-17.0/bin/clang-cl + AR: ${{ runner.temp }}/llvm-17.0/bin/llvm-lib + CFLAGS: "/clang:-flto=thin /clang:-O3 /clang:-fuse-ld=lld-link" + CXXFLAGS: "/clang:-flto=thin /clang:-O3 /clang:-fuse-ld=lld-link" + RUSTFLAGS: "-Clinker-plugin-lto -Clinker=lld-link" - name: Install built wheel and test run: | pip install rocksdict --no-index --find-links dist --force-reinstall || true diff --git a/.github/workflows/PR.yml b/.github/workflows/PR.yml index 639fbdf..a67bffc 100644 --- a/.github/workflows/PR.yml +++ b/.github/workflows/PR.yml @@ -58,7 +58,7 @@ jobs: strategy: fail-fast: false matrix: - target: [x64, x86] + target: [x64] py_version: [3.7, 3.8, 3.9, "3.10", "3.11", "3.12"] steps: - uses: actions/checkout@v2 @@ -83,6 +83,12 @@ jobs: args: --release --out dist env: LIBCLANG_PATH: ${{ runner.temp }}/llvm-17.0/lib + CC: ${{ runner.temp }}/llvm-17.0/bin/clang-cl + CXX: ${{ runner.temp }}/llvm-17.0/bin/clang-cl + AR: ${{ runner.temp }}/llvm-17.0/bin/llvm-lib + CFLAGS: "/clang:-flto=thin /clang:-O3 /clang:-fuse-ld=lld-link" + CXXFLAGS: "/clang:-flto=thin /clang:-O3 /clang:-fuse-ld=lld-link" + RUSTFLAGS: "-Clinker-plugin-lto -Clinker=lld-link" - name: Install built wheel and test run: | pip install rocksdict --no-index --find-links dist --force-reinstall || true