From 0678a2f0bcc70a13e8dd920941936ff13f5aa1c2 Mon Sep 17 00:00:00 2001 From: Mikhail Kot Date: Sat, 25 Jul 2026 19:11:41 +0100 Subject: [PATCH] enable lto --- CMakeLists.txt | 5 +++++ vortex-extension/Cargo.toml | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 587fe0e..c68026a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -66,11 +66,16 @@ if(EXISTS "/.dockerenv") endif() endif() +if(CMAKE_BUILD_TYPE STREQUAL "Release") + set(VORTEX_CARGO_PROFILE PROFILE release-lto) +endif() + corrosion_import_crate( MANIFEST_PATH vortex-extension/Cargo.toml CRATES vortex-extension CRATE_TYPES ${VORTEX_LIB_TYPE} FLAGS --crate-type=${VORTEX_LIB_TYPE} + ${VORTEX_CARGO_PROFILE} ) # Forward the DuckDB version passed via CMake as an env var. diff --git a/vortex-extension/Cargo.toml b/vortex-extension/Cargo.toml index fcac04d..3399b7d 100644 --- a/vortex-extension/Cargo.toml +++ b/vortex-extension/Cargo.toml @@ -15,3 +15,8 @@ vortex-duckdb = { git = "https://github.com/vortex-data/vortex.git", rev = "7654 # This improved build times significantly [profile.dev.package.vortex-fastlanes] debug = false + +[profile.release-lto] +inherits = "release" +lto = "fat" +codegen-units = 1