初始化版本

This commit is contained in:
冯佳
2025-12-18 21:24:08 +08:00
parent 7e8a6d1ce3
commit 9773cb5a0a
15 changed files with 4355 additions and 0 deletions

52
CMakeLists.txt Normal file
View File

@ -0,0 +1,52 @@
cmake_minimum_required(VERSION 3.10)
# Project name
project(menu_component C)
# Set C standard
set(CMAKE_C_STANDARD 99)
set(CMAKE_C_STANDARD_REQUIRED ON)
# Force using MinGW Makefiles if on Windows
if(WIN32)
if(NOT DEFINED CMAKE_GENERATOR)
set(CMAKE_GENERATOR "MinGW Makefiles" CACHE INTERNAL "")
endif()
# Set default compiler if not specified
if(NOT DEFINED CMAKE_C_COMPILER)
find_program(MINGW_GCC gcc)
if(MINGW_GCC)
set(CMAKE_C_COMPILER ${MINGW_GCC} CACHE INTERNAL "")
endif()
endif()
endif()
# Compiler flags
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -Werror -Os")
# Include directories
include_directories(
api
internal
src/core
src/param
src/lang
src/utils
port
)
# Source files
set(SOURCES
src/core/menu_core.c
src/param/menu_param.c
src/lang/menu_lang.c
src/utils/menu_utils.c
port/menu_port.c
examples/menu_example.c
)
# Add example executable
add_executable(menu_example ${SOURCES})
# Debug build configuration
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -g")