From 31cb0a9246c8fde7f661cc8db235bbb9b818325b Mon Sep 17 00:00:00 2001 From: Dnomd343 Date: Sun, 29 Jan 2023 00:03:41 +0800 Subject: [PATCH] build: rename `klotski` to `klotski_core` --- .gitignore | 2 +- CMakeLists.txt | 3 +++ src/CMakeLists.txt | 5 ++--- src/demo.py | 2 +- src/{klotski => klotski_core}/CMakeLists.txt | 13 +++++++++---- .../all_cases/CMakeLists.txt | 1 - .../all_cases/all_cases.cc | 0 src/{klotski => klotski_core}/all_cases/all_cases.h | 0 .../all_cases/basic_ranges.cc | 0 .../all_cases/basic_ranges.h | 0 .../analyse/CMakeLists.txt | 1 - src/{klotski => klotski_core}/analyse/analyse.cc | 0 src/{klotski => klotski_core}/analyse/analyse.h | 0 src/{klotski => klotski_core}/analyse/backtrack.cc | 0 .../analyse/backtrack_legacy.cc | 0 .../benchmark/CMakeLists.txt | 1 - .../benchmark/benchmark.cc | 0 src/{klotski => klotski_core}/benchmark/benchmark.h | 0 src/{klotski => klotski_core}/benchmark/chore.cc | 0 .../common_code/CMakeLists.txt | 1 - .../common_code/common_code.cc | 0 .../common_code/common_code.h | 0 .../common_code/convert.cc | 0 .../common_code/serialize.cc | 0 src/{klotski => klotski_core}/core/CMakeLists.txt | 0 src/{klotski => klotski_core}/core/core.cc | 0 src/{klotski => klotski_core}/core/core.h | 0 .../fast_cal/CMakeLists.txt | 1 - src/{klotski => klotski_core}/fast_cal/cal_core.cc | 0 src/{klotski => klotski_core}/fast_cal/fast_cal.cc | 0 src/{klotski => klotski_core}/fast_cal/fast_cal.h | 0 src/{klotski => klotski_core}/ffi/all_cases.cc | 0 src/{klotski => klotski_core}/ffi/codec.cc | 0 src/{klotski => klotski_core}/ffi/metadata.cc | 0 src/{klotski => klotski_core}/ffi/tmain.cc | 0 src/{klotski => klotski_core}/graph/CMakeLists.txt | 3 +++ src/{klotski => klotski_core}/graph/case.cc | 0 src/{klotski => klotski_core}/graph/graph.cc | 0 src/{klotski => klotski_core}/graph/graph.h | 0 src/{klotski => klotski_core}/graph/svg/svg.cc | 0 src/{klotski => klotski_core}/graph/svg/svg.h | 0 src/{klotski/ffi => klotski_core}/klotski.h | 0 .../raw_code/CMakeLists.txt | 1 - src/{klotski => klotski_core}/raw_code/convert.cc | 0 src/{klotski => klotski_core}/raw_code/raw_code.cc | 0 src/{klotski => klotski_core}/raw_code/raw_code.h | 0 .../short_code/CMakeLists.txt | 1 - src/{klotski => klotski_core}/short_code/convert.cc | 0 .../short_code/offset/all_cases_offset.h | 0 .../short_code/offset/basic_ranges_offset.h | 0 .../short_code/offset/range_prefix_offset.h | 0 .../short_code/serialize.cc | 0 .../short_code/serialize_chars.h | 0 .../short_code/short_code.cc | 0 .../short_code/short_code.h | 0 src/{klotski => klotski_core}/utils/CMakeLists.txt | 0 src/{klotski => klotski_core}/utils/common.cc | 0 src/{klotski => klotski_core}/utils/common.h | 0 src/{klotski => klotski_core}/utils/version.h.in | 8 ++++---- src/rust_ffi/build.rs | 4 ++-- src/rust_ffi/wrapper.h | 2 +- test/CMakeLists.txt | 5 +++-- 62 files changed, 29 insertions(+), 25 deletions(-) rename src/{klotski => klotski_core}/CMakeLists.txt (90%) rename src/{klotski => klotski_core}/all_cases/CMakeLists.txt (67%) rename src/{klotski => klotski_core}/all_cases/all_cases.cc (100%) rename src/{klotski => klotski_core}/all_cases/all_cases.h (100%) rename src/{klotski => klotski_core}/all_cases/basic_ranges.cc (100%) rename src/{klotski => klotski_core}/all_cases/basic_ranges.h (100%) rename src/{klotski => klotski_core}/analyse/CMakeLists.txt (66%) rename src/{klotski => klotski_core}/analyse/analyse.cc (100%) rename src/{klotski => klotski_core}/analyse/analyse.h (100%) rename src/{klotski => klotski_core}/analyse/backtrack.cc (100%) rename src/{klotski => klotski_core}/analyse/backtrack_legacy.cc (100%) rename src/{klotski => klotski_core}/benchmark/CMakeLists.txt (63%) rename src/{klotski => klotski_core}/benchmark/benchmark.cc (100%) rename src/{klotski => klotski_core}/benchmark/benchmark.h (100%) rename src/{klotski => klotski_core}/benchmark/chore.cc (100%) rename src/{klotski => klotski_core}/common_code/CMakeLists.txt (68%) rename src/{klotski => klotski_core}/common_code/common_code.cc (100%) rename src/{klotski => klotski_core}/common_code/common_code.h (100%) rename src/{klotski => klotski_core}/common_code/convert.cc (100%) rename src/{klotski => klotski_core}/common_code/serialize.cc (100%) rename src/{klotski => klotski_core}/core/CMakeLists.txt (100%) rename src/{klotski => klotski_core}/core/core.cc (100%) rename src/{klotski => klotski_core}/core/core.h (100%) rename src/{klotski => klotski_core}/fast_cal/CMakeLists.txt (66%) rename src/{klotski => klotski_core}/fast_cal/cal_core.cc (100%) rename src/{klotski => klotski_core}/fast_cal/fast_cal.cc (100%) rename src/{klotski => klotski_core}/fast_cal/fast_cal.h (100%) rename src/{klotski => klotski_core}/ffi/all_cases.cc (100%) rename src/{klotski => klotski_core}/ffi/codec.cc (100%) rename src/{klotski => klotski_core}/ffi/metadata.cc (100%) rename src/{klotski => klotski_core}/ffi/tmain.cc (100%) rename src/{klotski => klotski_core}/graph/CMakeLists.txt (73%) rename src/{klotski => klotski_core}/graph/case.cc (100%) rename src/{klotski => klotski_core}/graph/graph.cc (100%) rename src/{klotski => klotski_core}/graph/graph.h (100%) rename src/{klotski => klotski_core}/graph/svg/svg.cc (100%) rename src/{klotski => klotski_core}/graph/svg/svg.h (100%) rename src/{klotski/ffi => klotski_core}/klotski.h (100%) rename src/{klotski => klotski_core}/raw_code/CMakeLists.txt (65%) rename src/{klotski => klotski_core}/raw_code/convert.cc (100%) rename src/{klotski => klotski_core}/raw_code/raw_code.cc (100%) rename src/{klotski => klotski_core}/raw_code/raw_code.h (100%) rename src/{klotski => klotski_core}/short_code/CMakeLists.txt (69%) rename src/{klotski => klotski_core}/short_code/convert.cc (100%) rename src/{klotski => klotski_core}/short_code/offset/all_cases_offset.h (100%) rename src/{klotski => klotski_core}/short_code/offset/basic_ranges_offset.h (100%) rename src/{klotski => klotski_core}/short_code/offset/range_prefix_offset.h (100%) rename src/{klotski => klotski_core}/short_code/serialize.cc (100%) rename src/{klotski => klotski_core}/short_code/serialize_chars.h (100%) rename src/{klotski => klotski_core}/short_code/short_code.cc (100%) rename src/{klotski => klotski_core}/short_code/short_code.h (100%) rename src/{klotski => klotski_core}/utils/CMakeLists.txt (100%) rename src/{klotski => klotski_core}/utils/common.cc (100%) rename src/{klotski => klotski_core}/utils/common.h (100%) rename src/{klotski => klotski_core}/utils/version.h.in (50%) diff --git a/.gitignore b/.gitignore index 79c60c6..72068ef 100644 --- a/.gitignore +++ b/.gitignore @@ -5,4 +5,4 @@ /src/cli/target/ /src/rust_ffi/target/ -/src/klotski/utils/version.h +/src/klotski_core/utils/version.h diff --git a/CMakeLists.txt b/CMakeLists.txt index a304e03..890f9db 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -9,6 +9,9 @@ endif() set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra") +set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/bin) +set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/bin) + # TODO: only in libklotski.so add_compile_options(-fPIC) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 1803e53..fe9fc64 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -2,9 +2,8 @@ cmake_minimum_required(VERSION 3.0) project(klotski-cli LANGUAGES C) -include_directories(klotski/ffi) - -add_subdirectory(klotski) +add_subdirectory(klotski_core) +include_directories(klotski_core) add_executable(cli main.c) target_link_libraries(cli PRIVATE klotski) diff --git a/src/demo.py b/src/demo.py index bc02294..bb877df 100755 --- a/src/demo.py +++ b/src/demo.py @@ -2,6 +2,6 @@ import ctypes -lib = ctypes.CDLL('../cmake-build-release/src/klotski/libklotski.so') +lib = ctypes.CDLL('../cmake-build-release/src/klotski_core/libklotski.so') lib.tmain() diff --git a/src/klotski/CMakeLists.txt b/src/klotski_core/CMakeLists.txt similarity index 90% rename from src/klotski/CMakeLists.txt rename to src/klotski_core/CMakeLists.txt index a7a2401..44a755c 100644 --- a/src/klotski/CMakeLists.txt +++ b/src/klotski_core/CMakeLists.txt @@ -23,6 +23,10 @@ git_commit_id(GIT_COMMIT_ID) string(TIMESTAMP BUILD_TIME "%Y-%m-%d %H:%M:%S") +set(VERSION_MAJOR ${klotski-core_VERSION_MAJOR}) +set(VERSION_MINOR ${klotski-core_VERSION_MINOR}) +set(VERSION_PATCH ${klotski-core_VERSION_PATCH}) + set(SYSTEM_INFO "${CMAKE_SYSTEM_NAME} ${CMAKE_SYSTEM_PROCESSOR}") set(COMPILER_INFO "${CMAKE_CXX_COMPILER_ID} ${CMAKE_CXX_COMPILER_VERSION}") @@ -63,6 +67,7 @@ add_subdirectory(benchmark) ################################################################################ +include_directories(.) set(FFI_SRC codec.cc all_cases.cc tmain.cc metadata.cc) list(TRANSFORM FFI_SRC PREPEND "ffi/") add_library(klotski-ffi OBJECT ${FFI_SRC}) @@ -84,11 +89,11 @@ list(APPEND OBJS $) ################################################################################ -option(STATIC_LIB "build static library" ON) -if (STATIC_LIB) - add_library(klotski STATIC ${OBJS}) -else() +option(BUILD_DYN "build shared klotski core library" OFF) +if (BUILD_DYN) add_library(klotski SHARED ${OBJS}) +else() + add_library(klotski STATIC ${OBJS}) endif() ################################################################################ diff --git a/src/klotski/all_cases/CMakeLists.txt b/src/klotski_core/all_cases/CMakeLists.txt similarity index 67% rename from src/klotski/all_cases/CMakeLists.txt rename to src/klotski_core/all_cases/CMakeLists.txt index 275a4e0..a23a431 100644 --- a/src/klotski/all_cases/CMakeLists.txt +++ b/src/klotski_core/all_cases/CMakeLists.txt @@ -1,4 +1,3 @@ cmake_minimum_required(VERSION 3.0) add_library(all_cases OBJECT all_cases.cc basic_ranges.cc) -#target_link_libraries(all_cases PUBLIC utils) diff --git a/src/klotski/all_cases/all_cases.cc b/src/klotski_core/all_cases/all_cases.cc similarity index 100% rename from src/klotski/all_cases/all_cases.cc rename to src/klotski_core/all_cases/all_cases.cc diff --git a/src/klotski/all_cases/all_cases.h b/src/klotski_core/all_cases/all_cases.h similarity index 100% rename from src/klotski/all_cases/all_cases.h rename to src/klotski_core/all_cases/all_cases.h diff --git a/src/klotski/all_cases/basic_ranges.cc b/src/klotski_core/all_cases/basic_ranges.cc similarity index 100% rename from src/klotski/all_cases/basic_ranges.cc rename to src/klotski_core/all_cases/basic_ranges.cc diff --git a/src/klotski/all_cases/basic_ranges.h b/src/klotski_core/all_cases/basic_ranges.h similarity index 100% rename from src/klotski/all_cases/basic_ranges.h rename to src/klotski_core/all_cases/basic_ranges.h diff --git a/src/klotski/analyse/CMakeLists.txt b/src/klotski_core/analyse/CMakeLists.txt similarity index 66% rename from src/klotski/analyse/CMakeLists.txt rename to src/klotski_core/analyse/CMakeLists.txt index 6fd693c..caf9623 100644 --- a/src/klotski/analyse/CMakeLists.txt +++ b/src/klotski_core/analyse/CMakeLists.txt @@ -1,4 +1,3 @@ cmake_minimum_required(VERSION 3.0) add_library(analyse OBJECT analyse.cc backtrack.cc) -#target_link_libraries(analyse PUBLIC core) diff --git a/src/klotski/analyse/analyse.cc b/src/klotski_core/analyse/analyse.cc similarity index 100% rename from src/klotski/analyse/analyse.cc rename to src/klotski_core/analyse/analyse.cc diff --git a/src/klotski/analyse/analyse.h b/src/klotski_core/analyse/analyse.h similarity index 100% rename from src/klotski/analyse/analyse.h rename to src/klotski_core/analyse/analyse.h diff --git a/src/klotski/analyse/backtrack.cc b/src/klotski_core/analyse/backtrack.cc similarity index 100% rename from src/klotski/analyse/backtrack.cc rename to src/klotski_core/analyse/backtrack.cc diff --git a/src/klotski/analyse/backtrack_legacy.cc b/src/klotski_core/analyse/backtrack_legacy.cc similarity index 100% rename from src/klotski/analyse/backtrack_legacy.cc rename to src/klotski_core/analyse/backtrack_legacy.cc diff --git a/src/klotski/benchmark/CMakeLists.txt b/src/klotski_core/benchmark/CMakeLists.txt similarity index 63% rename from src/klotski/benchmark/CMakeLists.txt rename to src/klotski_core/benchmark/CMakeLists.txt index 77b5045..36a35ad 100644 --- a/src/klotski/benchmark/CMakeLists.txt +++ b/src/klotski_core/benchmark/CMakeLists.txt @@ -1,4 +1,3 @@ cmake_minimum_required(VERSION 3.0) add_library(benchmark OBJECT chore.cc benchmark.cc) -#target_link_libraries(benchmark PUBLIC all_cases) diff --git a/src/klotski/benchmark/benchmark.cc b/src/klotski_core/benchmark/benchmark.cc similarity index 100% rename from src/klotski/benchmark/benchmark.cc rename to src/klotski_core/benchmark/benchmark.cc diff --git a/src/klotski/benchmark/benchmark.h b/src/klotski_core/benchmark/benchmark.h similarity index 100% rename from src/klotski/benchmark/benchmark.h rename to src/klotski_core/benchmark/benchmark.h diff --git a/src/klotski/benchmark/chore.cc b/src/klotski_core/benchmark/chore.cc similarity index 100% rename from src/klotski/benchmark/chore.cc rename to src/klotski_core/benchmark/chore.cc diff --git a/src/klotski/common_code/CMakeLists.txt b/src/klotski_core/common_code/CMakeLists.txt similarity index 68% rename from src/klotski/common_code/CMakeLists.txt rename to src/klotski_core/common_code/CMakeLists.txt index 8fd9876..e11d20c 100644 --- a/src/klotski/common_code/CMakeLists.txt +++ b/src/klotski_core/common_code/CMakeLists.txt @@ -1,4 +1,3 @@ cmake_minimum_required(VERSION 3.0) add_library(common_code OBJECT convert.cc serialize.cc common_code.cc) -#target_link_libraries(common_code PUBLIC utils) diff --git a/src/klotski/common_code/common_code.cc b/src/klotski_core/common_code/common_code.cc similarity index 100% rename from src/klotski/common_code/common_code.cc rename to src/klotski_core/common_code/common_code.cc diff --git a/src/klotski/common_code/common_code.h b/src/klotski_core/common_code/common_code.h similarity index 100% rename from src/klotski/common_code/common_code.h rename to src/klotski_core/common_code/common_code.h diff --git a/src/klotski/common_code/convert.cc b/src/klotski_core/common_code/convert.cc similarity index 100% rename from src/klotski/common_code/convert.cc rename to src/klotski_core/common_code/convert.cc diff --git a/src/klotski/common_code/serialize.cc b/src/klotski_core/common_code/serialize.cc similarity index 100% rename from src/klotski/common_code/serialize.cc rename to src/klotski_core/common_code/serialize.cc diff --git a/src/klotski/core/CMakeLists.txt b/src/klotski_core/core/CMakeLists.txt similarity index 100% rename from src/klotski/core/CMakeLists.txt rename to src/klotski_core/core/CMakeLists.txt diff --git a/src/klotski/core/core.cc b/src/klotski_core/core/core.cc similarity index 100% rename from src/klotski/core/core.cc rename to src/klotski_core/core/core.cc diff --git a/src/klotski/core/core.h b/src/klotski_core/core/core.h similarity index 100% rename from src/klotski/core/core.h rename to src/klotski_core/core/core.h diff --git a/src/klotski/fast_cal/CMakeLists.txt b/src/klotski_core/fast_cal/CMakeLists.txt similarity index 66% rename from src/klotski/fast_cal/CMakeLists.txt rename to src/klotski_core/fast_cal/CMakeLists.txt index 5f154ef..bb6a7f7 100644 --- a/src/klotski/fast_cal/CMakeLists.txt +++ b/src/klotski_core/fast_cal/CMakeLists.txt @@ -1,4 +1,3 @@ cmake_minimum_required(VERSION 3.0) add_library(fast_cal OBJECT cal_core.cc fast_cal.cc) -#target_link_libraries(fast_cal PUBLIC core) diff --git a/src/klotski/fast_cal/cal_core.cc b/src/klotski_core/fast_cal/cal_core.cc similarity index 100% rename from src/klotski/fast_cal/cal_core.cc rename to src/klotski_core/fast_cal/cal_core.cc diff --git a/src/klotski/fast_cal/fast_cal.cc b/src/klotski_core/fast_cal/fast_cal.cc similarity index 100% rename from src/klotski/fast_cal/fast_cal.cc rename to src/klotski_core/fast_cal/fast_cal.cc diff --git a/src/klotski/fast_cal/fast_cal.h b/src/klotski_core/fast_cal/fast_cal.h similarity index 100% rename from src/klotski/fast_cal/fast_cal.h rename to src/klotski_core/fast_cal/fast_cal.h diff --git a/src/klotski/ffi/all_cases.cc b/src/klotski_core/ffi/all_cases.cc similarity index 100% rename from src/klotski/ffi/all_cases.cc rename to src/klotski_core/ffi/all_cases.cc diff --git a/src/klotski/ffi/codec.cc b/src/klotski_core/ffi/codec.cc similarity index 100% rename from src/klotski/ffi/codec.cc rename to src/klotski_core/ffi/codec.cc diff --git a/src/klotski/ffi/metadata.cc b/src/klotski_core/ffi/metadata.cc similarity index 100% rename from src/klotski/ffi/metadata.cc rename to src/klotski_core/ffi/metadata.cc diff --git a/src/klotski/ffi/tmain.cc b/src/klotski_core/ffi/tmain.cc similarity index 100% rename from src/klotski/ffi/tmain.cc rename to src/klotski_core/ffi/tmain.cc diff --git a/src/klotski/graph/CMakeLists.txt b/src/klotski_core/graph/CMakeLists.txt similarity index 73% rename from src/klotski/graph/CMakeLists.txt rename to src/klotski_core/graph/CMakeLists.txt index a12af74..bc2f5db 100644 --- a/src/klotski/graph/CMakeLists.txt +++ b/src/klotski_core/graph/CMakeLists.txt @@ -8,3 +8,6 @@ add_subdirectory(svg) # TODO: STATIC flag add_library(graph case.cc graph.cc) target_link_libraries(graph PUBLIC analyse svg) + +# TODO: using OBJECT instead of STATIC +# TODO: remove `target_link_libraries` diff --git a/src/klotski/graph/case.cc b/src/klotski_core/graph/case.cc similarity index 100% rename from src/klotski/graph/case.cc rename to src/klotski_core/graph/case.cc diff --git a/src/klotski/graph/graph.cc b/src/klotski_core/graph/graph.cc similarity index 100% rename from src/klotski/graph/graph.cc rename to src/klotski_core/graph/graph.cc diff --git a/src/klotski/graph/graph.h b/src/klotski_core/graph/graph.h similarity index 100% rename from src/klotski/graph/graph.h rename to src/klotski_core/graph/graph.h diff --git a/src/klotski/graph/svg/svg.cc b/src/klotski_core/graph/svg/svg.cc similarity index 100% rename from src/klotski/graph/svg/svg.cc rename to src/klotski_core/graph/svg/svg.cc diff --git a/src/klotski/graph/svg/svg.h b/src/klotski_core/graph/svg/svg.h similarity index 100% rename from src/klotski/graph/svg/svg.h rename to src/klotski_core/graph/svg/svg.h diff --git a/src/klotski/ffi/klotski.h b/src/klotski_core/klotski.h similarity index 100% rename from src/klotski/ffi/klotski.h rename to src/klotski_core/klotski.h diff --git a/src/klotski/raw_code/CMakeLists.txt b/src/klotski_core/raw_code/CMakeLists.txt similarity index 65% rename from src/klotski/raw_code/CMakeLists.txt rename to src/klotski_core/raw_code/CMakeLists.txt index fac385f..b59d305 100644 --- a/src/klotski/raw_code/CMakeLists.txt +++ b/src/klotski_core/raw_code/CMakeLists.txt @@ -1,4 +1,3 @@ cmake_minimum_required(VERSION 3.0) add_library(raw_code OBJECT convert.cc raw_code.cc) -#target_link_libraries(raw_code PUBLIC utils) diff --git a/src/klotski/raw_code/convert.cc b/src/klotski_core/raw_code/convert.cc similarity index 100% rename from src/klotski/raw_code/convert.cc rename to src/klotski_core/raw_code/convert.cc diff --git a/src/klotski/raw_code/raw_code.cc b/src/klotski_core/raw_code/raw_code.cc similarity index 100% rename from src/klotski/raw_code/raw_code.cc rename to src/klotski_core/raw_code/raw_code.cc diff --git a/src/klotski/raw_code/raw_code.h b/src/klotski_core/raw_code/raw_code.h similarity index 100% rename from src/klotski/raw_code/raw_code.h rename to src/klotski_core/raw_code/raw_code.h diff --git a/src/klotski/short_code/CMakeLists.txt b/src/klotski_core/short_code/CMakeLists.txt similarity index 69% rename from src/klotski/short_code/CMakeLists.txt rename to src/klotski_core/short_code/CMakeLists.txt index 42eb33f..f8f8af6 100644 --- a/src/klotski/short_code/CMakeLists.txt +++ b/src/klotski_core/short_code/CMakeLists.txt @@ -3,4 +3,3 @@ cmake_minimum_required(VERSION 3.0) include_directories(offset) add_library(short_code OBJECT convert.cc serialize.cc short_code.cc) -#target_link_libraries(short_code PUBLIC utils all_cases) diff --git a/src/klotski/short_code/convert.cc b/src/klotski_core/short_code/convert.cc similarity index 100% rename from src/klotski/short_code/convert.cc rename to src/klotski_core/short_code/convert.cc diff --git a/src/klotski/short_code/offset/all_cases_offset.h b/src/klotski_core/short_code/offset/all_cases_offset.h similarity index 100% rename from src/klotski/short_code/offset/all_cases_offset.h rename to src/klotski_core/short_code/offset/all_cases_offset.h diff --git a/src/klotski/short_code/offset/basic_ranges_offset.h b/src/klotski_core/short_code/offset/basic_ranges_offset.h similarity index 100% rename from src/klotski/short_code/offset/basic_ranges_offset.h rename to src/klotski_core/short_code/offset/basic_ranges_offset.h diff --git a/src/klotski/short_code/offset/range_prefix_offset.h b/src/klotski_core/short_code/offset/range_prefix_offset.h similarity index 100% rename from src/klotski/short_code/offset/range_prefix_offset.h rename to src/klotski_core/short_code/offset/range_prefix_offset.h diff --git a/src/klotski/short_code/serialize.cc b/src/klotski_core/short_code/serialize.cc similarity index 100% rename from src/klotski/short_code/serialize.cc rename to src/klotski_core/short_code/serialize.cc diff --git a/src/klotski/short_code/serialize_chars.h b/src/klotski_core/short_code/serialize_chars.h similarity index 100% rename from src/klotski/short_code/serialize_chars.h rename to src/klotski_core/short_code/serialize_chars.h diff --git a/src/klotski/short_code/short_code.cc b/src/klotski_core/short_code/short_code.cc similarity index 100% rename from src/klotski/short_code/short_code.cc rename to src/klotski_core/short_code/short_code.cc diff --git a/src/klotski/short_code/short_code.h b/src/klotski_core/short_code/short_code.h similarity index 100% rename from src/klotski/short_code/short_code.h rename to src/klotski_core/short_code/short_code.h diff --git a/src/klotski/utils/CMakeLists.txt b/src/klotski_core/utils/CMakeLists.txt similarity index 100% rename from src/klotski/utils/CMakeLists.txt rename to src/klotski_core/utils/CMakeLists.txt diff --git a/src/klotski/utils/common.cc b/src/klotski_core/utils/common.cc similarity index 100% rename from src/klotski/utils/common.cc rename to src/klotski_core/utils/common.cc diff --git a/src/klotski/utils/common.h b/src/klotski_core/utils/common.h similarity index 100% rename from src/klotski/utils/common.h rename to src/klotski_core/utils/common.h diff --git a/src/klotski/utils/version.h.in b/src/klotski_core/utils/version.h.in similarity index 50% rename from src/klotski/utils/version.h.in rename to src/klotski_core/utils/version.h.in index 9b45e13..b2c0587 100644 --- a/src/klotski/utils/version.h.in +++ b/src/klotski_core/utils/version.h.in @@ -1,9 +1,9 @@ #pragma once -#define VERSION_MAJOR (@klotski-core_VERSION_MAJOR@) -#define VERSION_MINOR (@klotski-core_VERSION_MINOR@) -#define VERSION_PATCH (@klotski-core_VERSION_PATCH@) -#define VERSION_STR "v@klotski-core_VERSION_MAJOR@.@klotski-core_VERSION_MINOR@.@klotski-core_VERSION_PATCH@" +#define VERSION_MAJOR (@VERSION_MAJOR@) +#define VERSION_MINOR (@VERSION_MINOR@) +#define VERSION_PATCH (@VERSION_PATCH@) +#define VERSION_STR "v@VERSION_MAJOR@.@VERSION_MINOR@.@VERSION_PATCH@" #define AUTHOR "dnomd343" #define SYSTEM "@SYSTEM_INFO@" diff --git a/src/rust_ffi/build.rs b/src/rust_ffi/build.rs index 21f45ab..a1e1803 100644 --- a/src/rust_ffi/build.rs +++ b/src/rust_ffi/build.rs @@ -3,11 +3,11 @@ extern crate bindgen; use std::env; use std::path::PathBuf; -const RELEASE_DIR: &str = "../../cmake-build-release/src/klotski"; +const LIB_CORE_DIR: &str = "../../bin"; fn main() { // basic compile options - println!("cargo:rustc-link-search={}", RELEASE_DIR); + println!("cargo:rustc-link-search={}", LIB_CORE_DIR); println!("cargo:rustc-link-lib=static=klotski"); println!("cargo:rerun-if-changed=wrapper.h"); println!("cargo:rustc-link-lib=stdc++"); diff --git a/src/rust_ffi/wrapper.h b/src/rust_ffi/wrapper.h index 74ac8f7..5b97c58 100644 --- a/src/rust_ffi/wrapper.h +++ b/src/rust_ffi/wrapper.h @@ -1,3 +1,3 @@ #pragma once -#include "../klotski/ffi/klotski.h" +#include "../klotski_core/klotski.h" diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 0e3e265..9e20151 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -6,12 +6,13 @@ enable_testing() ################################################################ +unset(CMAKE_ARCHIVE_OUTPUT_DIRECTORY) include_directories(../third_party/md5) add_library(md5 STATIC ../third_party/md5/md5.cpp) ################################################################ -include_directories(../src/klotski/utils) +include_directories(../src/klotski_core/utils) add_executable(test_utils utils.cc) target_link_libraries(test_utils PUBLIC gtest gtest_main) target_link_libraries(test_utils PUBLIC klotski) @@ -19,7 +20,7 @@ add_test(NAME utils COMMAND test_utils) ################################################################ -include_directories(../src/klotski/all_cases) +include_directories(../src/klotski_core/all_cases) add_executable(test_all_cases all_cases.cc) target_link_libraries(test_all_cases PUBLIC gtest gtest_main) target_link_libraries(test_all_cases PUBLIC klotski md5)