'Generic Commit'
Some checks failed
dropshell-build / build (push) Failing after 1m5s

This commit is contained in:
Your Name 2025-06-03 01:10:16 +12:00
parent a882153e56
commit f26383b66d
4 changed files with 47 additions and 10 deletions

View File

@ -16,13 +16,16 @@ RUN apk add --no-cache \
linux-headers \
mold \
zlib-static \
ccache
ccache \
libunwind-dev \
libdwarf-dev
# Set working directory
WORKDIR /build
# Copy source files
COPY . .
COPY CMakeLists.txt cmake_prebuild.sh ./
#COPY cmake ./cmake
COPY src/version.hpp.in ./src/version.hpp.in
# Configure and build with ccache
RUN mkdir -p build_static && \
@ -37,6 +40,13 @@ RUN mkdir -p build_static && \
-DPROJECT_NAME="${PROJECT}" \
${CMAKE_TOOLCHAIN_FILE:+-DCMAKE_TOOLCHAIN_FILE=$CMAKE_TOOLCHAIN_FILE}
# Explicitly build dependencies first (cached separately)
RUN cmake --build build_static --target run_prebuild_script
# Copy source files
COPY src ./build_static/src
RUN cmake --build build_static
# Final stage that only contains the binary

View File

@ -5,9 +5,28 @@ set -euo pipefail
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
PROJECT="ipdemo" # Define your project name here
function update_sources() {
CMAKE_FILE="${SCRIPT_DIR}/${PROJECT}/CMakeLists.txt"
# Generate the list of source files with relative paths
SOURCE_FILES=$(cd "${SCRIPT_DIR}/${PROJECT}" && find "src" -name '*.cpp' | sort | sed 's/^/ /')
# Use awk to replace the SOURCES block in CMakeLists.txt
awk -v sources="$SOURCE_FILES" '
BEGIN {in_sources=0}
/^set\(SOURCES/ {print; print sources; in_sources=1; next}
in_sources && /^\)/ {in_sources=0; print; next}
!in_sources {print}
' "$CMAKE_FILE" > "${CMAKE_FILE}.tmp" && mv "${CMAKE_FILE}.tmp" "$CMAKE_FILE"
echo "Updated SOURCES in ${CMAKE_FILE}"
}
update_sources
mkdir -p "${SCRIPT_DIR}/output"
export CMAKE_BUILD_TYPE="Release"
export CMAKE_BUILD_TYPE="Debug"
rm -rf "${SCRIPT_DIR}/output"
mkdir -p "${SCRIPT_DIR}/output"

View File

@ -45,11 +45,6 @@ configure_file(
# 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..."
@ -57,6 +52,13 @@ add_custom_target(run_prebuild_script ALL
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
)
set(SOURCES
src/main.cpp
)
# Mark sources as GENERATED to defer existence check until build time
set_source_files_properties(${SOURCES} PROPERTIES GENERATED TRUE)
# Add executable
add_executable(${PROJECT_EXE_NAME} ${SOURCES})
add_dependencies(${PROJECT_EXE_NAME} run_prebuild_script)

View File

@ -6,6 +6,10 @@
#include "httplib.hpp"
#include "version.hpp"
void crashy() {
ASSERT(false,"SUCCESS!");
}
int main() {
std::cout << "ipdemo version: " << ipdemo::VERSION << std::endl;
std::cout << std::endl;
@ -23,6 +27,8 @@ int main() {
std::cout << j.dump(4) << std::endl;
std::cout << "Done" << std::endl;
crashy();
return 0;
}