@ -23,6 +23,8 @@ add_compile_options(-Wall -Wextra -g)
# TODO: enabled by LTO option
if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
add_compile_options(-flto=full)
elseif (CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang")
else ()
#add_compile_options(-flto) # TODO: only for g++
endif ()
@ -8,6 +8,12 @@ repository = "https://github.com/dnomd343/klotski"
license = "BSD-3-Clause"
readme = "README.md"
[profile.release]
lto = "fat"
panic = "abort"
# TODO: also for `profile.test` and `profile.bench`
[dependencies]
cxx = "1.0"
@ -26,6 +26,7 @@ fn main() {
.file("adapter/short_code.cc")
.include("klotski/src/core")
.flag("-std=c++23")
.flag_if_supported("-flto=full") // only for clang
.flag("-fno-rtti")
.flag("-fno-exceptions")
.compile("klotski");