move build system to cmake

This commit is contained in:
Nicholas Orlowsky 2024-05-10 06:09:40 -05:00
parent c31db4d2a8
commit 734e37de37
Signed by: nickorlow
GPG key ID: 838827D8C4611687
4 changed files with 21 additions and 53 deletions

View file

@ -1,8 +1,10 @@
FROM alpine as build-env FROM alpine as build-env
RUN apk add --no-cache build-base python3 RUN apk add --no-cache build-base python3 cmake
COPY ./src/ . COPY ./src/ .
RUN make build-release RUN rm -rf CMakeCache.txt CMakeFiles
RUN cmake -DCMAKE_BUILD_TYPE=Release .
RUN make anthracite-bin
FROM alpine FROM alpine
RUN apk add --no-cache build-base RUN apk add --no-cache build-base

View file

@ -1,34 +0,0 @@
.PHONY: format lint build build-release build-docker run debug
build-supplemental:
cd ./build && ./version.sh && python3 ./error_gen.py
build: build-supplemental
g++ main.cpp --std=c++20 -g -o ./anthracite
build-release: build-supplemental
g++ main.cpp --std=c++20 -O3 -o ./anthracite
build-docker:
docker build . -t anthracite
run: build
./anthracite 8080
run-test: build
./anthracite 8080 ./test_www
debug: build
gdb --args ./anthracite 8080
debug-test: build
gdb --args ./anthracite 8080 ./test_www
format:
clang-format *.cpp -i
lint:
clang-tidy *.cpp
lint-fix:
clang-tidy *.cpp -fix -fix-errors

View file

@ -6,9 +6,9 @@
#include <netinet/in.h> #include <netinet/in.h>
#include <sstream> #include <sstream>
#include <sys/socket.h> #include <sys/socket.h>
#include <sys/time.h>
#include <unistd.h> #include <unistd.h>
#include <unordered_map> #include <unordered_map>
#include <sys/time.h>
constexpr int MAX_QUEUE_LENGTH = 100; constexpr int MAX_QUEUE_LENGTH = 100;