From 72c5d97920a1fe935210657b158c9b1a89906400 Mon Sep 17 00:00:00 2001 From: Titus von Koeller <9048635+Titus-von-Koeller@users.noreply.github.com> Date: Thu, 7 Mar 2024 16:09:56 +0000 Subject: [PATCH] default to CMAKE_BUILD_TYPE Release for optimized releases and better many_linux compatibility --- CMakeLists.txt | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index d6384cb3c..e922d2bff 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -15,6 +15,14 @@ cmake_minimum_required(VERSION 3.22.1) project(bitsandbytes LANGUAGES CXX) +# If run without specifying a build type, default to using the Release configuration: +# optimizing the generated binaries for performance and also adds the `-DNDEBUG` flag, +# which turns off a bunch of asserts which seem to link to new symbols in libstdc++, +# worsening our many_linux compliance.. +if(NOT CMAKE_BUILD_TYPE) + set(CMAKE_BUILD_TYPE Release) +endif() + if (CMAKE_COMPILER_IS_GNUCXX) add_compile_definitions(_GLIBCXX_USE_CXX11_ABI=1) endif()