ruby binding 追加

- FFI gem (libptouch)、exe ptouch-print-png(PNG のみ)
- ステータス 32 バイトを Hash に展開(parse_status / status_hash)
- CMake: libptouch 共有ライブラリ(ptouch_shared)
- RuboCop、gemspec(homepage / source_code_uri)

Made-with: Cursor
This commit is contained in:
knb
2026-04-12 16:06:10 +09:00
parent d649b1b014
commit c5c7c2ba52
16 changed files with 889 additions and 0 deletions

View File

@@ -22,14 +22,24 @@ configure_file(
)
add_library(ptouch STATIC src/libptouch.c)
add_library(ptouch_shared SHARED src/libptouch.c)
set_target_properties(ptouch_shared PROPERTIES OUTPUT_NAME ptouch
SOVERSION ${PROJECT_VERSION_MAJOR})
target_include_directories(ptouch PUBLIC
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>"
"$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/include>"
"$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>"
)
target_include_directories(ptouch_shared PUBLIC
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>"
"$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/include>"
"$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>"
)
target_link_libraries(ptouch PRIVATE PkgConfig::LIBUSB PNG::PNG)
target_link_libraries(ptouch_shared PRIVATE PkgConfig::LIBUSB PNG::PNG)
if(NOT MSVC)
target_compile_options(ptouch PRIVATE -Wall -Wextra -Wpedantic)
target_compile_options(ptouch_shared PRIVATE -Wall -Wextra -Wpedantic)
endif()
add_executable(ptouch-print src/cli/main.c)
@@ -40,6 +50,8 @@ if(NOT MSVC)
endif()
install(TARGETS ptouch ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}")
install(TARGETS ptouch_shared LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}"
RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}")
install(TARGETS ptouch-print RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}")
install(FILES
"${CMAKE_CURRENT_SOURCE_DIR}/include/libptouch.h"