From 55e89cd54f8bda6218b2f8de76d7911c36169eb9 Mon Sep 17 00:00:00 2001 From: Kasper Date: Tue, 6 May 2025 21:03:01 +0300 Subject: [PATCH] remove old heload --- CMakeLists.txt | 5 ++--- heload/CMakeLists.txt | 34 ---------------------------------- heload/include/heload/heload.h | 7 ------- heload/src/heload.c | 15 --------------- hiisi/main.cpp | 17 +++++++---------- live-reloader.sh | 11 ----------- 6 files changed, 9 insertions(+), 80 deletions(-) delete mode 100644 heload/CMakeLists.txt delete mode 100644 heload/include/heload/heload.h delete mode 100644 heload/src/heload.c delete mode 100755 live-reloader.sh diff --git a/CMakeLists.txt b/CMakeLists.txt index 9b1f67c..d21f6a2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -6,12 +6,11 @@ set(CMAKE_EXPORT_COMPILE_COMMANDS ON) set(CMAKE_CXX_STANDARD 17) add_subdirectory(3rd/SDL EXCLUDE_FROM_ALL) -add_subdirectory(heload) add_subdirectory(hiisi) -target_link_options(SDL3-shared PRIVATE -Wl,-z,nodelete) +# target_link_options(SDL3-shared PRIVATE -Wl,-z,nodelete) add_executable(hiisi-run hiisi/main.cpp) -target_link_libraries(hiisi-run heload) +target_link_libraries(hiisi-run hiload) diff --git a/heload/CMakeLists.txt b/heload/CMakeLists.txt deleted file mode 100644 index b039eb0..0000000 --- a/heload/CMakeLists.txt +++ /dev/null @@ -1,34 +0,0 @@ -cmake_minimum_required(VERSION 3.21) -project(Heload) - -# I just like to have this with my tooling -set(CMAKE_EXPORT_COMPILE_COMMANDS ON) -set(CMAKE_C_STANDARD 99) - -add_library(heload SHARED - src/heload.c -) - -# Specify the public headers location -target_include_directories(heload PUBLIC - $ # During build - $ # When installed -) - -install(TARGETS heload - EXPORT heloadTargets - ARCHIVE DESTINATION lib - LIBRARY DESTINATION lib - RUNTIME DESTINATION bin -) - -# Install header files -install(DIRECTORY include/ DESTINATION include) - -# Export the library for find_package() -install(EXPORT heloadTargets - FILE heloadConfig.cmake - DESTINATION lib/cmake/heload -) - -export(TARGETS heload FILE heloadConfig.cmake) diff --git a/heload/include/heload/heload.h b/heload/include/heload/heload.h deleted file mode 100644 index 3b65fac..0000000 --- a/heload/include/heload/heload.h +++ /dev/null @@ -1,7 +0,0 @@ -#ifndef HELOAD_H_ -#define HELOAD_H_ - -void print_module_info(const char *module_name); - - -#endif // HELOAD_H_ diff --git a/heload/src/heload.c b/heload/src/heload.c deleted file mode 100644 index 957d358..0000000 --- a/heload/src/heload.c +++ /dev/null @@ -1,15 +0,0 @@ -#include "heload/heload.h" - -#include -#include -#include -#include - - -void print_module_info(const char *module_name) { - void *module = dlopen(module_name, RTLD_NOW); - - struct Lmid_t *lmid; - dlinfo(module, RTLD_DI_LMID, lmid); - -} diff --git a/hiisi/main.cpp b/hiisi/main.cpp index 313740f..dc6dcc3 100644 --- a/hiisi/main.cpp +++ b/hiisi/main.cpp @@ -1,19 +1,16 @@ #include "hiisi.h" -#include "heload/heload.h" #include -#include -#include +#include #include #include #include -#include +#include +#include std::atomic reload_requested(false); -void reload_signal_handler(int) { - reload_requested = true; -} +void reload_signal_handler(int) { reload_requested = true; } Engine load_hiisi() { const char *name = "build/hiisi/libhiisi-engine.so"; @@ -47,7 +44,7 @@ Engine load_hiisi() { /* Allocate the buffer for use with RTLD_DI_SERINFO. */ - sip = (Dl_serinfo*)malloc(serinfo.dls_size); + sip = (Dl_serinfo *)malloc(serinfo.dls_size); if (sip == NULL) { perror("malloc"); exit(EXIT_FAILURE); @@ -69,8 +66,8 @@ Engine load_hiisi() { } for (size_t j = 0; j < serinfo.dls_cnt; j++) - printf("dls_serpath[%zu].dls_name = %s\n", - j, sip->dls_serpath[j].dls_name); + printf("dls_serpath[%zu].dls_name = %s\n", j, + sip->dls_serpath[j].dls_name); Engine engine; engine.module = mod; diff --git a/live-reloader.sh b/live-reloader.sh deleted file mode 100755 index f5cfc39..0000000 --- a/live-reloader.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/usr/bin/env bash - -echo "Watching changes in hiisi..." -inotifywait --monitor -e modify build/hiisi/ | - while read -r _ action file; do - sleep 0.1 - echo "$(date +%H:%M:%S): Hiisi changed!" - echo "$action on $file" - HIISI_PID=$(pgrep -x hiisi-run) - kill -USR1 "${HIISI_PID}" && echo "Signal sent!" || echo "Signal send failed!" - done