[cpp] Simplify directory structure, add DebugPrinter program

- spine-cpp/spine-cpp was moved into spine-cpp directory, so spine-cpp/spine-cpp/src -> spine-cpp/src, spine-cpp/spine-cpp/include -> spine-cpp/include
- Added scaffold for DebugPrinter to be used by runtime comparison tests
- Added build.sh
This commit is contained in:
Mario Zechner 2025-07-11 11:00:44 +02:00
parent f9fad00936
commit cc4f11fded
199 changed files with 321 additions and 98 deletions

View File

@ -4,11 +4,11 @@ project(spine-cpp)
include(${CMAKE_CURRENT_LIST_DIR}/../flags.cmake)
include_directories(include)
file(GLOB INCLUDES "spine-cpp/include/**/*.h")
file(GLOB SOURCES "spine-cpp/src/**/*.cpp")
file(GLOB INCLUDES "include/**/*.h")
file(GLOB SOURCES "src/**/*.cpp")
add_library(spine-cpp STATIC ${SOURCES} ${INCLUDES})
target_include_directories(spine-cpp PUBLIC spine-cpp/include)
target_include_directories(spine-cpp PUBLIC include)
# Install target
install(TARGETS spine-cpp EXPORT spine-cpp_TARGETS DESTINATION dist/lib)
@ -18,4 +18,9 @@ install(FILES ${INCLUDES} DESTINATION dist/include)
export(
EXPORT spine-cpp_TARGETS
FILE ${CMAKE_CURRENT_BINARY_DIR}/spine-cppTargets.cmake
NAMESPACE "Spine::")
NAMESPACE "Spine::")
# Optional tests
if(CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
add_subdirectory(tests)
endif()

16
spine-cpp/build.sh Executable file
View File

@ -0,0 +1,16 @@
#!/bin/bash
set -e
cd "$(dirname "$0")"
for arg in "${@:-clean build}"; do
case $arg in
clean) rm -rf build ;;
build)
mkdir -p build && cd build
[ -f CMakeCache.txt ] || cmake .. -DCMAKE_BUILD_TYPE=Debug
make -j$(sysctl -n hw.ncpu 2>/dev/null || nproc 2>/dev/null || echo 4)
cd ..
;;
esac
done

View File

@ -54,7 +54,7 @@ namespace spine {
void apply(SlotPose* slot, Attachment* attachment);
String getPath(const String &basePath, int index);
String &getPath(const String &basePath, int index);
/// Returns a unique ID for this attachment.
int getId() { return _id; }
@ -83,6 +83,7 @@ namespace spine {
int _start;
int _digits;
int _setupIndex;
String _tmpPath;
static int nextID();
};

Some files were not shown because too many files have changed in this diff Show More