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()