From 2576e6269f14a646909117085f758c4f85042721 Mon Sep 17 00:00:00 2001 From: Gregory Gauthier Date: Thu, 18 Dec 2025 12:09:29 +0000 Subject: [PATCH] add configs for IDE awareness --- .editorconfig | 9 +++++++++ CMakeLists.txt | 25 +++++++------------------ 2 files changed, 16 insertions(+), 18 deletions(-) create mode 100644 .editorconfig diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..044b29f --- /dev/null +++ b/.editorconfig @@ -0,0 +1,9 @@ +root = true + +[*.{c,h}] +indent_style = space +indent_size = 4 +end_of_line = lf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true \ No newline at end of file diff --git a/CMakeLists.txt b/CMakeLists.txt index 218ddd2..8654558 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,32 +1,21 @@ cmake_minimum_required(VERSION 3.10) project(cordle C) +# Pure C90 configuration set(CMAKE_C_STANDARD 90) set(CMAKE_C_STANDARD_REQUIRED ON) -set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c90 -pedantic") +set(CMAKE_C_EXTENSIONS OFF) -# Find ncurses library -find_package(Curses REQUIRED) +# Pedantic C90 compiler flags +set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c90 -pedantic -Wpedantic -Wall -Wextra") # Include directories include_directories(include) -include_directories(${CURSES_INCLUDE_DIR}) -# Source files -set(SOURCES +# Executable +add_executable(cordle src/main.c src/game.c - src/words.c src/ui.c + src/words.c ) - -# Create executable -add_executable(cordle ${SOURCES}) - -# Link ncurses -target_link_libraries(cordle ${CURSES_LIBRARIES}) - -# Set compiler flags for C90 compliance -if(CMAKE_C_COMPILER_ID MATCHES "GNU|Clang") - target_compile_options(cordle PRIVATE -Wpedantic -Wextra -pedantic) -endif()