.
This commit is contained in:
parent
caf8c36a0e
commit
122533151d
@ -1,5 +1,5 @@
|
||||
cmake_minimum_required(VERSION 3.10)
|
||||
project(cppstaticbuild)
|
||||
project(ipdemo)
|
||||
|
||||
set(CMAKE_CXX_STANDARD 23)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
@ -10,5 +10,5 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -static")
|
||||
|
||||
include_directories(/usr/local/include)
|
||||
|
||||
add_executable(main main.cpp)
|
||||
target_link_libraries(main pthread assert cpptrace dwarf z zstd)
|
||||
add_executable(ipdemo main.cpp)
|
||||
target_link_libraries(ipdemo pthread assert cpptrace dwarf z zstd)
|
||||
|
@ -1,16 +1,29 @@
|
||||
#!/bin/bash
|
||||
rm -f build/main
|
||||
|
||||
docker run --rm -v $(pwd):/app -w /app \
|
||||
-e CCACHE_DIR=/app/.ccache \
|
||||
# Create volume if it doesn't exist
|
||||
docker volume create cppbuild-cache
|
||||
|
||||
OUTDIR="output"
|
||||
|
||||
docker run --rm \
|
||||
-v cppbuild-cache:/app/build \
|
||||
-v $(pwd):/app/src \
|
||||
-w /app/src \
|
||||
-e CCACHE_DIR=/app/build/.ccache \
|
||||
-e CC="ccache gcc" \
|
||||
-e CXX="ccache g++" \
|
||||
-e LD=mold \
|
||||
-e CMAKE_BUILD_PARALLEL_LEVEL=$(nproc) \
|
||||
-e NINJA_STATUS="[%f/%t] " \
|
||||
cpp-httplib-builder:latest \
|
||||
-c "mkdir -p build && cd build && cmake -G Ninja .. && ninja -j$(nproc)"
|
||||
-c "mkdir -p /app/build && \
|
||||
cd /app/build && \
|
||||
cmake -G Ninja /app/src && \
|
||||
ninja -j$(nproc) && \
|
||||
mkdir /app/src/$OUTDIR && \
|
||||
cp /app/build/ipdemo /app/src/$OUTDIR/ipdemo && \
|
||||
chown -R $(id -u):$(id -g) /app/src/$OUTDIR"
|
||||
|
||||
if [ -f build/main ]; then
|
||||
build/main
|
||||
if [ -f $OUTDIR/ipdemo ]; then
|
||||
$OUTDIR/ipdemo
|
||||
fi
|
||||
|
BIN
test/output/ipdemo
Executable file
BIN
test/output/ipdemo
Executable file
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user