Configured start of project

trie-skips
Jef Roosens 2022-11-15 16:05:47 +01:00
commit d7f95f0fbf
Signed by: Jef Roosens
GPG Key ID: B75D4F293C7052DB
6 changed files with 65 additions and 0 deletions

2
.gitignore vendored 100644
View File

@ -0,0 +1,2 @@
build/
compile_commands.json

3
.gitmodules vendored 100644
View File

@ -0,0 +1,3 @@
[submodule "crow"]
path = crow
url = https://github.com/CrowCpp/Crow

10
CMakeLists.txt 100644
View File

@ -0,0 +1,10 @@
cmake_minimum_required(VERSION 3.24)
project(lander C CXX)
set(CMAKE_C_STANDARD 17)
add_subdirectory(crow)
include_directories(crow/include)
add_executable(lander src/main.cpp)
target_link_libraries(lander PUBLIC Crow)

37
Makefile 100644
View File

@ -0,0 +1,37 @@
# =====CONFIG=====
BUILD_DIR := ./build
SRC_DIR := ./src
TEST_DIR := test
CORES != nproc
SRCS := $(shell find '$(SRC_DIR)' -iname '*.c')
# =====RECIPES=====
all: build
.PHONY: cmake
cmake: $(BUILD_DIR)/Debug/Makefile
$(BUILD_DIR)/Debug/Makefile: CMakeLists.txt
@ cmake -B'$(BUILD_DIR)/Debug' -DCMAKE_EXPORT_COMPILE_COMMANDS=1 .
@ ln -sf '$(BUILD_DIR)/Debug/compile_commands.json' compile_commands.json
.PHONY: build
build: cmake
@ make -C '$(BUILD_DIR)/Debug'
.PHONY: run
run: build
@ ./build/Debug/lander
.PHONY: clean
clean:
@ rm -rf '$(BUILD_DIR)' compile_commands.json
.PHONY: lint
lint:
@ clang-format --Werror -n $(SRCS)
.PHONY: format
format:
@ clang-format -i $(SRCS)

1
crow 160000

@ -0,0 +1 @@
Subproject commit edf12f699ec3bf6f751cf73cb97f32919e48ca6e

12
src/main.cpp 100644
View File

@ -0,0 +1,12 @@
#include "crow.h"
int main()
{
crow::SimpleApp app;
CROW_ROUTE(app, "/")([](){
return "Hello world";
});
app.port(18080).multithreaded().run();
}