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