.
Some checks failed
dropshell-build / build (push) Failing after 6s

This commit is contained in:
j842
2025-06-10 11:12:28 +12:00
parent 1fce6fc0b4
commit 222ed229ef
15 changed files with 121 additions and 6 deletions

View File

@ -0,0 +1,25 @@
cmake_minimum_required(VERSION 3.16)
project(test_libs)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
# Force static linking
set(CMAKE_EXE_LINKER_FLAGS "-static -static-libgcc -static-libstdc++")
set(CMAKE_FIND_LIBRARY_SUFFIXES ".a")
# Find packages
find_package(fmt REQUIRED)
find_package(spdlog REQUIRED)
find_package(SQLite3 REQUIRED)
find_package(Threads REQUIRED)
add_executable(test_libs test_libs.cpp)
target_link_libraries(test_libs
fmt::fmt
spdlog::spdlog
SQLite3::SQLite3
Threads::Threads
rt
)

View File

@ -0,0 +1,41 @@
#include <iostream>
#include <thread>
#include <spdlog/spdlog.h>
#include <fmt/format.h>
#include <sqlite3.h>
#include <ctime>
int main() {
// Test fmt
std::string formatted = fmt::format("Testing fmt: {} + {} = {}", 1, 2, 3);
std::cout << formatted << std::endl;
// Test spdlog
spdlog::info("Testing spdlog: Hello from spdlog!");
spdlog::warn("This is a warning message");
// Test sqlite3
sqlite3* db;
int rc = sqlite3_open(":memory:", &db);
if (rc == SQLITE_OK) {
spdlog::info("SQLite3 opened successfully, version: {}", sqlite3_libversion());
sqlite3_close(db);
} else {
spdlog::error("Failed to open SQLite3");
}
// Test pthread
std::thread t([]() {
spdlog::info("Hello from thread!");
});
t.join();
// Test rt (real-time) - using clock_gettime
struct timespec ts;
if (clock_gettime(CLOCK_REALTIME, &ts) == 0) {
spdlog::info("Real-time clock: {}.{} seconds", ts.tv_sec, ts.tv_nsec);
}
spdlog::info("All libraries linked successfully!");
return 0;
}