Skip to content

Commit

Permalink
default to CMAKE_BUILD_TYPE Release for optimized releases and better…
Browse files Browse the repository at this point in the history
… many_linux compatibility
  • Loading branch information
Titus-von-Koeller committed Mar 7, 2024
1 parent 7268831 commit 72c5d97
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit 72c5d97

Please sign in to comment.