From 6ff6a2f0f569d7f789570ba7d0c2c5bda4833c44 Mon Sep 17 00:00:00 2001 From: Dnomd343 Date: Sat, 28 Dec 2024 11:26:58 +0800 Subject: [PATCH] build: enhance rust packing logic --- src/core/CMakeLists.txt | 8 ++++---- src/core_ffi/rust_ffi/Cargo.toml | 16 ++++++++++++++++ src/core_ffi/rust_ffi/klotski/src/CMakeLists.txt | 6 +++++- .../rust_ffi/klotski/src/core_ffi/CMakeLists.txt | 1 - .../klotski/src/core_ffi/rust_ffi/CMakeLists.txt | 1 - 5 files changed, 25 insertions(+), 7 deletions(-) mode change 120000 => 100644 src/core_ffi/rust_ffi/klotski/src/CMakeLists.txt delete mode 120000 src/core_ffi/rust_ffi/klotski/src/core_ffi/CMakeLists.txt delete mode 120000 src/core_ffi/rust_ffi/klotski/src/core_ffi/rust_ffi/CMakeLists.txt diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt index d0776af..aea6299 100644 --- a/src/core/CMakeLists.txt +++ b/src/core/CMakeLists.txt @@ -62,10 +62,10 @@ string(TIMESTAMP VERSION_BUILD "%Y-%m-%d %H:%M:%S") set(COMPILER "${CMAKE_CXX_COMPILER_ID} ${CMAKE_CXX_COMPILER_VERSION}") -configure_file( - ${PROJECT_SOURCE_DIR}/utils/metadata.h.in - ${PROJECT_SOURCE_DIR}/utils/metadata.h -) +#configure_file( +# ${PROJECT_SOURCE_DIR}/utils/metadata.h.in +# ${PROJECT_SOURCE_DIR}/utils/metadata.h +#) set(KLSK_CORE_SRC ranges/internal/spawn.cc diff --git a/src/core_ffi/rust_ffi/Cargo.toml b/src/core_ffi/rust_ffi/Cargo.toml index 02e4736..b18c3f6 100644 --- a/src/core_ffi/rust_ffi/Cargo.toml +++ b/src/core_ffi/rust_ffi/Cargo.toml @@ -4,10 +4,26 @@ version = "0.0.2" edition = "2021" authors = ["Dnomd343 "] description = "Klotski multifunctional engine with high performance" +categories = ["algorithms", "science", "games", "external-ffi-bindings"] repository = "https://github.com/dnomd343/klotski" license = "BSD-3-Clause" readme = "README.md" +# TODO: add `homepage` and `documentation` + +exclude = [ + "/klotski/src/core/main.cc", + "/klotski/src/core/benchmark/", + #"/klotski/src/core/utils/metadata.h", # TODO: code generated in crate dir is not allowed in cargo. + + # TODO: this is not a robust solution, we may link them manually. + "!/klotski/third_party/parallel-hashmap/LICENSE", + "!/klotski/third_party/parallel-hashmap/cmake/*.cmake", + "!/klotski/third_party/parallel-hashmap/CMakeLists.txt", + "!/klotski/third_party/parallel-hashmap/parallel_hashmap/*.h", + "/klotski/third_party/parallel-hashmap/", +] + [profile.release] lto = "fat" panic = "abort" diff --git a/src/core_ffi/rust_ffi/klotski/src/CMakeLists.txt b/src/core_ffi/rust_ffi/klotski/src/CMakeLists.txt deleted file mode 120000 index 75f9ac9..0000000 --- a/src/core_ffi/rust_ffi/klotski/src/CMakeLists.txt +++ /dev/null @@ -1 +0,0 @@ -../../../../CMakeLists.txt \ No newline at end of file diff --git a/src/core_ffi/rust_ffi/klotski/src/CMakeLists.txt b/src/core_ffi/rust_ffi/klotski/src/CMakeLists.txt new file mode 100644 index 0000000..c23c3aa --- /dev/null +++ b/src/core_ffi/rust_ffi/klotski/src/CMakeLists.txt @@ -0,0 +1,5 @@ +cmake_minimum_required(VERSION 3.12) + +add_subdirectory(core) + +install(TARGETS klotski_core DESTINATION .) diff --git a/src/core_ffi/rust_ffi/klotski/src/core_ffi/CMakeLists.txt b/src/core_ffi/rust_ffi/klotski/src/core_ffi/CMakeLists.txt deleted file mode 120000 index 75f9ac9..0000000 --- a/src/core_ffi/rust_ffi/klotski/src/core_ffi/CMakeLists.txt +++ /dev/null @@ -1 +0,0 @@ -../../../../CMakeLists.txt \ No newline at end of file diff --git a/src/core_ffi/rust_ffi/klotski/src/core_ffi/rust_ffi/CMakeLists.txt b/src/core_ffi/rust_ffi/klotski/src/core_ffi/rust_ffi/CMakeLists.txt deleted file mode 120000 index 75f9ac9..0000000 --- a/src/core_ffi/rust_ffi/klotski/src/core_ffi/rust_ffi/CMakeLists.txt +++ /dev/null @@ -1 +0,0 @@ -../../../../CMakeLists.txt \ No newline at end of file