调整 Makefile 和 CMake 配置

This commit is contained in:
2025-09-30 20:51:57 +08:00
parent 9315505085
commit 4500a5adfd
2 changed files with 3 additions and 1 deletions

View File

@@ -28,13 +28,14 @@ wm: $(TARGET_NAME)
DISPLAY=:3 $(TARGET) DISPLAY=:3 $(TARGET)
debug: $(TARGET_NAME) debug: $(TARGET_NAME)
DISPLAY=:3 valgrind $(TARGET) DISPLAY=:3 valgrind --leak-check=full $(TARGET)
prepare: prepare:
@cmake -S $(SRC_DIR) -B $(BUILD_DIR) @cmake -S $(SRC_DIR) -B $(BUILD_DIR)
@cp $(BUILD_DIR)/compile_commands.json $(MAKEFILE_DIR) @cp $(BUILD_DIR)/compile_commands.json $(MAKEFILE_DIR)
build: prepare build: prepare
${RM} -f $(TARGET)
@cmake --build $(BUILD_DIR) @cmake --build $(BUILD_DIR)
@cp $(BUILD_DIR)/$(TARGET_NAME) $(TARGET) @cp $(BUILD_DIR)/$(TARGET_NAME) $(TARGET)

View File

@@ -12,6 +12,7 @@ set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
# compile flags # compile flags
add_compile_options(-g) add_compile_options(-g)
add_compile_options(-Wall) add_compile_options(-Wall)
# add_link_options(-fsanitize=address)
project(${APP_NAME} project(${APP_NAME}
VERSION 0.0.1 VERSION 0.0.1