Browse Source

build: update rust profile

master
Dnomd343 19 hours from now
parent
commit
e14253c74d
  1. 2
      CMakeLists.txt
  2. 6
      src/core_ffi/rust_ffi/Cargo.toml
  3. 1
      src/core_ffi/rust_ffi/build.rs

2
CMakeLists.txt

@ -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")
add_compile_options(-flto=full)
else ()
#add_compile_options(-flto) # TODO: only for g++
endif ()

6
src/core_ffi/rust_ffi/Cargo.toml

@ -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"

1
src/core_ffi/rust_ffi/build.rs

@ -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");

Loading…
Cancel
Save