feat: 对接Python,暴露接口

This commit is contained in:
2026-03-30 22:48:36 +08:00
parent 24467c04c0
commit d678bfc326
22 changed files with 1311 additions and 51 deletions

View File

@@ -2,6 +2,7 @@ CC ?= gcc
CFLAGS ?= -std=c11 -Wall -Wextra -O2 -pthread -D_GNU_SOURCE
CPPFLAGS ?= -Iinclude -Ithird_party/cjson -Ithird_party/kcp
LDFLAGS ?= -pthread
PYTHON ?= python3
BIN_DIR := bin
SRC_DIR := src
@@ -64,4 +65,10 @@ $(BIN_DIR)/kcpping: $(CMD_DIR)/kcpping.c $(COMMON_SRCS) | $(BIN_DIR)
clean:
rm -rf $(BIN_DIR)
.PHONY: all clean
python-ext:
cd python && $(PYTHON) setup.py build_ext --inplace
python-install:
cd python && $(PYTHON) -m pip install -e .
.PHONY: all clean python-ext python-install