From a882153e56dc4b7a84e722ed7dac55dfdde10dd3 Mon Sep 17 00:00:00 2001 From: Your Name Date: Tue, 3 Jun 2025 00:45:34 +1200 Subject: [PATCH] 'Generic Commit' --- Dockerfile.dropshell-build | 11 +++++++---- ipdemo/CMakeLists.txt | 1 + ipdemo/src/autogen/version.hpp | 2 +- ipdemo/src/main.cpp | 2 ++ ipdemo/src/version.hpp.in | 2 +- test.sh | 2 -- 6 files changed, 12 insertions(+), 8 deletions(-) diff --git a/Dockerfile.dropshell-build b/Dockerfile.dropshell-build index c90b346..c576ad0 100644 --- a/Dockerfile.dropshell-build +++ b/Dockerfile.dropshell-build @@ -2,7 +2,7 @@ FROM --platform=$BUILDPLATFORM alpine:latest AS builder ARG PROJECT -# Install build dependencies +# Install ccache along with other dependencies RUN apk add --no-cache \ build-base \ cmake \ @@ -15,7 +15,8 @@ RUN apk add --no-cache \ ninja \ linux-headers \ mold \ - zlib-static + zlib-static \ + ccache # Set working directory WORKDIR /build @@ -23,10 +24,12 @@ WORKDIR /build # Copy source files COPY . . -# Configure and build +# Configure and build with ccache RUN mkdir -p build_static && \ cmake -G Ninja -B build_static -DCMAKE_BUILD_TYPE=Release \ - -DCMAKE_EXE_LINKER_FLAGS="-static" \ + -DCMAKE_CXX_COMPILER_LAUNCHER=ccache \ + -DCMAKE_C_COMPILER_LAUNCHER=ccache \ + -DCMAKE_EXE_LINKER_FLAGS="-fuse-ld=mold -static" \ -DCMAKE_FIND_LIBRARY_SUFFIXES=".a" \ -DZLIB_BUILD_SHARED=OFF \ -DZLIB_BUILD_STATIC=ON \ diff --git a/ipdemo/CMakeLists.txt b/ipdemo/CMakeLists.txt index 3dd6fe7..93b3891 100644 --- a/ipdemo/CMakeLists.txt +++ b/ipdemo/CMakeLists.txt @@ -66,6 +66,7 @@ add_dependencies(${PROJECT_EXE_NAME} run_prebuild_script) target_include_directories(${PROJECT_EXE_NAME} PRIVATE $ ${CMAKE_CURRENT_SOURCE_DIR}/src + ${CMAKE_CURRENT_SOURCE_DIR}/src/autogen ) diff --git a/ipdemo/src/autogen/version.hpp b/ipdemo/src/autogen/version.hpp index 2a9cf89..391f953 100644 --- a/ipdemo/src/autogen/version.hpp +++ b/ipdemo/src/autogen/version.hpp @@ -10,7 +10,7 @@ DO NOT EDIT VERSION.HPP! #include -namespace dropshell { +namespace ipdemo { // Version information const std::string VERSION = "@PROJECT_VERSION@"; diff --git a/ipdemo/src/main.cpp b/ipdemo/src/main.cpp index e32ddf1..ca79d63 100644 --- a/ipdemo/src/main.cpp +++ b/ipdemo/src/main.cpp @@ -7,6 +7,8 @@ #include "version.hpp" int main() { + std::cout << "ipdemo version: " << ipdemo::VERSION << std::endl; + std::cout << std::endl; std::cout << "Retrieving IP address..." << std::endl; httplib::Client cli("http://ipinfo.io"); diff --git a/ipdemo/src/version.hpp.in b/ipdemo/src/version.hpp.in index 2a9cf89..391f953 100644 --- a/ipdemo/src/version.hpp.in +++ b/ipdemo/src/version.hpp.in @@ -10,7 +10,7 @@ DO NOT EDIT VERSION.HPP! #include -namespace dropshell { +namespace ipdemo { // Version information const std::string VERSION = "@PROJECT_VERSION@"; diff --git a/test.sh b/test.sh index c41a1e8..637bdf9 100755 --- a/test.sh +++ b/test.sh @@ -6,8 +6,6 @@ SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )" echo "Testing" -"${SCRIPT_DIR}/build.sh" - [ -f "${SCRIPT_DIR}/output/ipdemo" ] || { echo "ipdemo binary not found"; exit 1; } "${SCRIPT_DIR}/output/ipdemo"