From d92769d86c6272130c813ad426abe35d89875b96 Mon Sep 17 00:00:00 2001 From: Your Name Date: Sat, 14 Jun 2025 16:07:17 +1200 Subject: [PATCH] 'Generic Commit' --- CMakeLists.txt | 17 +++++++++++++++++ Dockerfile.dropshell-build | 14 ++++++++------ publish.sh | 3 ++- 3 files changed, 27 insertions(+), 7 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 0b61b86..1209c5e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -53,6 +53,23 @@ target_include_directories(${PROJECT_NAME} PRIVATE # Find packages set(CMAKE_PREFIX_PATH /usr/local) find_package(OpenSSL REQUIRED) + +# Create OpenSSL targets if they don't exist (for cross-compilation) +if(NOT TARGET OpenSSL::SSL) + add_library(OpenSSL::SSL STATIC IMPORTED) + set_target_properties(OpenSSL::SSL PROPERTIES + IMPORTED_LOCATION "/usr/local/lib64/libssl.a" + INTERFACE_INCLUDE_DIRECTORIES "/usr/local/include" + ) +endif() +if(NOT TARGET OpenSSL::Crypto) + add_library(OpenSSL::Crypto STATIC IMPORTED) + set_target_properties(OpenSSL::Crypto PROPERTIES + IMPORTED_LOCATION "/usr/local/lib64/libcrypto.a" + INTERFACE_INCLUDE_DIRECTORIES "/usr/local/include" + ) +endif() + find_package(Drogon CONFIG REQUIRED) find_package(nlohmann_json REQUIRED) diff --git a/Dockerfile.dropshell-build b/Dockerfile.dropshell-build index fe5fbf4..8f858bd 100644 --- a/Dockerfile.dropshell-build +++ b/Dockerfile.dropshell-build @@ -9,8 +9,7 @@ WORKDIR /app COPY . . # Configure and build with ccache -RUN --mount=type=cache,target=/build \ - mkdir -p /build && \ +RUN mkdir -p /build && \ cmake -G Ninja -S /app -B /build \ -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} \ -DCMAKE_CXX_COMPILER_LAUNCHER=ccache \ @@ -25,16 +24,19 @@ RUN --mount=type=cache,target=/build \ -DPROJECT_NAME="${PROJECT}" \ -DCMAKE_STRIP=OFF \ -DIGNORE_DYNAMIC_LOADING=ON \ + -DOPENSSL_ROOT_DIR=/usr/local \ + -DOPENSSL_LIBRARIES="/usr/local/lib64/libssl.a;/usr/local/lib64/libcrypto.a" \ + -DOPENSSL_INCLUDE_DIR=/usr/local/include \ ${CMAKE_TOOLCHAIN_FILE:+-DCMAKE_TOOLCHAIN_FILE=$CMAKE_TOOLCHAIN_FILE} -# Explicitly build dependencies first (cached separately) -RUN --mount=type=cache,target=/build cmake --build /build --target run_prebuild_script +# Explicitly build dependencies first +RUN cmake --build /build --target run_prebuild_script -RUN --mount=type=cache,target=/build cmake --build /build +RUN cmake --build /build # Copy the built executable to a regular directory for the final stage -RUN --mount=type=cache,target=/build mkdir -p /output && \ +RUN mkdir -p /output && \ find /build -type f -executable -name "*${PROJECT}*" -exec cp {} /output/${PROJECT} \; || \ find /build -type f -executable -exec cp {} /output/${PROJECT} \; diff --git a/publish.sh b/publish.sh index 3140365..8edbe62 100755 --- a/publish.sh +++ b/publish.sh @@ -53,5 +53,6 @@ mkdir -p "${SCRIPT_DIR}/output" build "linux/amd64" build "linux/arm64" -build "windows/amd64" +# Temporarily disabled - Windows cross-compilation needs different approach +# build "windows/amd64"