'Generic Commit'
Some checks failed
dropshell-build / build (push) Has been cancelled

This commit is contained in:
Your Name
2025-06-02 08:03:02 +12:00
parent 2d62d7af7f
commit 16b2ce5b52
50 changed files with 50 additions and 60 deletions

View File

@ -0,0 +1,4 @@
Signature: 8a477f597d28d172789f06886806bc55
# This file is a cache directory tag created by ccache.
# For information about cache directory tags, see:
# http://www.brynosaurus.com/cachedir/

82
ipdemo/.ccache/0/a/stats Normal file
View File

@ -0,0 +1,82 @@
0
0
0
0
3
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
3
3
0
6
0
0
0
0
0
0
6
0
3
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0

Binary file not shown.

82
ipdemo/.ccache/0/c/stats Normal file
View File

@ -0,0 +1,82 @@
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0

82
ipdemo/.ccache/0/stats Normal file
View File

@ -0,0 +1,82 @@
0
0
0
0
0
0
0
0
0
0
0
1
16
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
16
0
0
0
0

82
ipdemo/.ccache/1/1/stats Normal file
View File

@ -0,0 +1,82 @@
0
0
0
0
0
0
0
0
0
0
3
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0

82
ipdemo/.ccache/1/2/stats Normal file
View File

@ -0,0 +1,82 @@
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0

82
ipdemo/.ccache/1/e/stats Normal file
View File

@ -0,0 +1,82 @@
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
1
0
2
0
0
0
0
0
0
2
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0

82
ipdemo/.ccache/2/5/stats Normal file
View File

@ -0,0 +1,82 @@
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0

View File

@ -0,0 +1,4 @@
Signature: 8a477f597d28d172789f06886806bc55
# This file is a cache directory tag created by ccache.
# For information about cache directory tags, see:
# http://www.brynosaurus.com/cachedir/

82
ipdemo/.ccache/2/d/stats Normal file
View File

@ -0,0 +1,82 @@
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
1
0
2
0
0
0
0
0
0
2
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0

Binary file not shown.

82
ipdemo/.ccache/2/stats Normal file
View File

@ -0,0 +1,82 @@
0
0
0
0
0
0
0
0
0
0
0
1
4
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
4
0
0

82
ipdemo/.ccache/3/4/stats Normal file
View File

@ -0,0 +1,82 @@
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0

82
ipdemo/.ccache/3/7/stats Normal file
View File

@ -0,0 +1,82 @@
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
1
0
2
0
0
0
0
0
0
2
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0

82
ipdemo/.ccache/3/e/stats Normal file
View File

@ -0,0 +1,82 @@
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0

Binary file not shown.

View File

@ -0,0 +1,4 @@
Signature: 8a477f597d28d172789f06886806bc55
# This file is a cache directory tag created by ccache.
# For information about cache directory tags, see:
# http://www.brynosaurus.com/cachedir/

Binary file not shown.

82
ipdemo/.ccache/4/stats Normal file
View File

@ -0,0 +1,82 @@
0
0
0
0
0
0
0
0
0
0
0
2
472
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
236
0
0
0
0
0
0
0
0
0
0
236
0
0
0
0
0

Binary file not shown.

View File

@ -0,0 +1,4 @@
Signature: 8a477f597d28d172789f06886806bc55
# This file is a cache directory tag created by ccache.
# For information about cache directory tags, see:
# http://www.brynosaurus.com/cachedir/

Binary file not shown.

82
ipdemo/.ccache/6/stats Normal file
View File

@ -0,0 +1,82 @@
0
0
0
0
0
0
0
0
0
0
0
2
8
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
4
0
0
0
0
0
0
0
0
0
0
4
0
0
0
0

View File

@ -0,0 +1,4 @@
Signature: 8a477f597d28d172789f06886806bc55
# This file is a cache directory tag created by ccache.
# For information about cache directory tags, see:
# http://www.brynosaurus.com/cachedir/

Binary file not shown.

82
ipdemo/.ccache/9/stats Normal file
View File

@ -0,0 +1,82 @@
0
0
0
0
0
0
0
0
0
0
0
1
16
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
16
0
0
0
0
0
0

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,4 @@
Signature: 8a477f597d28d172789f06886806bc55
# This file is a cache directory tag created by ccache.
# For information about cache directory tags, see:
# http://www.brynosaurus.com/cachedir/

82
ipdemo/.ccache/a/stats Normal file
View File

@ -0,0 +1,82 @@
0
0
0
0
0
0
0
0
0
0
0
2
20
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
4
0
0
0
0
0
0
16
0
0
0
0
0
0
0

Binary file not shown.

View File

@ -0,0 +1,4 @@
Signature: 8a477f597d28d172789f06886806bc55
# This file is a cache directory tag created by ccache.
# For information about cache directory tags, see:
# http://www.brynosaurus.com/cachedir/

82
ipdemo/.ccache/b/stats Normal file
View File

@ -0,0 +1,82 @@
0
0
0
0
0
0
0
0
0
0
0
1
236
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
236
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0

Binary file not shown.

View File

@ -0,0 +1,4 @@
Signature: 8a477f597d28d172789f06886806bc55
# This file is a cache directory tag created by ccache.
# For information about cache directory tags, see:
# http://www.brynosaurus.com/cachedir/

82
ipdemo/.ccache/c/stats Normal file
View File

@ -0,0 +1,82 @@
0
0
0
0
0
0
0
0
0
0
0
1
16
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
16
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0

Binary file not shown.

View File

@ -0,0 +1,4 @@
Signature: 8a477f597d28d172789f06886806bc55
# This file is a cache directory tag created by ccache.
# For information about cache directory tags, see:
# http://www.brynosaurus.com/cachedir/

82
ipdemo/.ccache/f/stats Normal file
View File

@ -0,0 +1,82 @@
0
0
0
0
0
0
0
0
0
0
0
1
236
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
236
0
0
0
0
0
0
0
0
0
0
0
0

View File

Binary file not shown.

102
ipdemo/CMakeLists.txt Normal file
View File

@ -0,0 +1,102 @@
# Get the current date in yyyy.mmdd.hhmm format
execute_process(
COMMAND date "+%Y.%m%d.%H%M"
OUTPUT_VARIABLE PROJECT_VERSION
OUTPUT_STRIP_TRAILING_WHITESPACE
)
cmake_minimum_required(VERSION 3.10)
get_filename_component(PROJECT_EXE_NAME "${CMAKE_CURRENT_SOURCE_DIR}" NAME)
project(${PROJECT_EXE_NAME} VERSION ${PROJECT_VERSION} LANGUAGES CXX)
# Force static linking globally
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static")
set(CMAKE_FIND_LIBRARY_SUFFIXES ".a")
set(BUILD_SHARED_LIBS OFF CACHE BOOL "Build shared libraries" FORCE)
set(CMAKE_POSITION_INDEPENDENT_CODE OFF)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -static")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -static")
set(ZLIB_USE_STATIC_LIBS "ON")
set(CMAKE_CXX_STANDARD 23)
set(CMAKE_C_STANDARD 23)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
# Set default build type to Release if not specified
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE "Release" CACHE STRING "Choose the type of build (Debug or Release)" FORCE)
endif()
# Configure build-specific compiler flags
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -g")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O3 -DNDEBUG")
# Configure version.hpp file
configure_file(
"${CMAKE_CURRENT_SOURCE_DIR}/src/version.hpp.in"
"${CMAKE_CURRENT_BINARY_DIR}/src/autogen/version.hpp"
@ONLY
)
# Set CMAKE_MODULE_PATH to include our custom find modules
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
# Auto-detect source files
file(GLOB_RECURSE SOURCES "src/*.cpp")
file(GLOB_RECURSE HEADERS "src/*.hpp")
file(GLOB_RECURSE HEADERS "src/*.h")
# Add custom target to run cmake_prebuild.sh at the start of the build process
add_custom_target(run_prebuild_script ALL
COMMAND ${CMAKE_COMMAND} -E echo "Running cmake_prebuild.sh..."
COMMAND ${CMAKE_COMMAND} -E env bash ${CMAKE_CURRENT_SOURCE_DIR}/cmake_prebuild.sh
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
)
# Add executable
add_executable(${PROJECT_EXE_NAME} ${SOURCES})
add_dependencies(${PROJECT_EXE_NAME} run_prebuild_script)
# Set include directories
# build dir goes first so that we can use the generated version.hpp
target_include_directories(${PROJECT_EXE_NAME} PRIVATE
$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/src/autogen>
${CMAKE_CURRENT_SOURCE_DIR}/src
)
# Configure libassert
include(FetchContent)
FetchContent_Declare(
libassert
GIT_REPOSITORY https://github.com/jeremy-rifkin/libassert.git
GIT_TAG v2.1.5
)
FetchContent_MakeAvailable(libassert)
# Add cpptrace
FetchContent_Declare(
cpptrace
GIT_REPOSITORY https://github.com/jeremy-rifkin/cpptrace.git
GIT_TAG v0.8.3
)
FetchContent_MakeAvailable(cpptrace)
# Add nlohmann/json
FetchContent_Declare(
nlohmann_json
GIT_REPOSITORY https://github.com/nlohmann/json.git
GIT_TAG v3.11.3
)
FetchContent_MakeAvailable(nlohmann_json)
# Link libraries
target_link_libraries(${PROJECT_EXE_NAME} PRIVATE
libassert::assert
cpptrace::cpptrace
nlohmann_json::nlohmann_json
)
# Set static linking flags
set_target_properties(${PROJECT_EXE_NAME} PROPERTIES
LINK_FLAGS "-static"
)

3
ipdemo/cmake_prebuild.sh Executable file
View File

@ -0,0 +1,3 @@
#!/bin/bash
echo "cmake_prebuild.sh complete."

View File

@ -0,0 +1,21 @@
#pragma once
/*
version.hpp is automatically generated by the build system, from version.hpp.in.
DO NOT EDIT VERSION.HPP!
*/
#include <string>
namespace dropshell {
// Version information
const std::string VERSION = "@PROJECT_VERSION@";
const std::string RELEASE_DATE = "@RELEASE_DATE@";
const std::string AUTHOR = "j842";
const std::string LICENSE = "MIT";
} // namespace dropshell

10509
ipdemo/src/httplib.hpp Normal file

File diff suppressed because it is too large Load Diff

26
ipdemo/src/main.cpp Normal file
View File

@ -0,0 +1,26 @@
#include <iostream>
#include <nlohmann/json.hpp>
#include <libassert/assert.hpp>
#include "httplib.hpp"
#include "version.hpp"
int main() {
std::cout << "Retrieving IP address..." << std::endl;
httplib::Client cli("http://ipinfo.io");
auto res = cli.Get("/ip");
ASSERT(res->status == 200, "Failed to get IP");
nlohmann::json j;
j["ip"] = res->body;
j["status"] = res->status;
std::cout << j.dump(4) << std::endl;
std::cout << "Done" << std::endl;
return 0;
}

21
ipdemo/src/version.hpp.in Normal file
View File

@ -0,0 +1,21 @@
#pragma once
/*
version.hpp is automatically generated by the build system, from version.hpp.in.
DO NOT EDIT VERSION.HPP!
*/
#include <string>
namespace dropshell {
// Version information
const std::string VERSION = "@PROJECT_VERSION@";
const std::string RELEASE_DATE = "@RELEASE_DATE@";
const std::string AUTHOR = "j842";
const std::string LICENSE = "MIT";
} // namespace dropshell