.
This commit is contained in:
parent
caf8c36a0e
commit
122533151d
@ -1,5 +1,5 @@
|
|||||||
cmake_minimum_required(VERSION 3.10)
|
cmake_minimum_required(VERSION 3.10)
|
||||||
project(cppstaticbuild)
|
project(ipdemo)
|
||||||
|
|
||||||
set(CMAKE_CXX_STANDARD 23)
|
set(CMAKE_CXX_STANDARD 23)
|
||||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||||
@ -10,5 +10,5 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -static")
|
|||||||
|
|
||||||
include_directories(/usr/local/include)
|
include_directories(/usr/local/include)
|
||||||
|
|
||||||
add_executable(main main.cpp)
|
add_executable(ipdemo main.cpp)
|
||||||
target_link_libraries(main pthread assert cpptrace dwarf z zstd)
|
target_link_libraries(ipdemo pthread assert cpptrace dwarf z zstd)
|
||||||
|
@ -1,16 +1,29 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
rm -f build/main
|
|
||||||
|
|
||||||
docker run --rm -v $(pwd):/app -w /app \
|
# Create volume if it doesn't exist
|
||||||
-e CCACHE_DIR=/app/.ccache \
|
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 CC="ccache gcc" \
|
||||||
-e CXX="ccache g++" \
|
-e CXX="ccache g++" \
|
||||||
-e LD=mold \
|
-e LD=mold \
|
||||||
-e CMAKE_BUILD_PARALLEL_LEVEL=$(nproc) \
|
-e CMAKE_BUILD_PARALLEL_LEVEL=$(nproc) \
|
||||||
-e NINJA_STATUS="[%f/%t] " \
|
-e NINJA_STATUS="[%f/%t] " \
|
||||||
cpp-httplib-builder:latest \
|
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
|
if [ -f $OUTDIR/ipdemo ]; then
|
||||||
build/main
|
$OUTDIR/ipdemo
|
||||||
fi
|
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