add configs for IDE awareness
This commit is contained in:
parent
fe09863601
commit
2576e6269f
9
.editorconfig
Normal file
9
.editorconfig
Normal file
@ -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
|
||||||
@ -1,32 +1,21 @@
|
|||||||
cmake_minimum_required(VERSION 3.10)
|
cmake_minimum_required(VERSION 3.10)
|
||||||
project(cordle C)
|
project(cordle C)
|
||||||
|
|
||||||
|
# Pure C90 configuration
|
||||||
set(CMAKE_C_STANDARD 90)
|
set(CMAKE_C_STANDARD 90)
|
||||||
set(CMAKE_C_STANDARD_REQUIRED ON)
|
set(CMAKE_C_STANDARD_REQUIRED ON)
|
||||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c90 -pedantic")
|
set(CMAKE_C_EXTENSIONS OFF)
|
||||||
|
|
||||||
# Find ncurses library
|
# Pedantic C90 compiler flags
|
||||||
find_package(Curses REQUIRED)
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c90 -pedantic -Wpedantic -Wall -Wextra")
|
||||||
|
|
||||||
# Include directories
|
# Include directories
|
||||||
include_directories(include)
|
include_directories(include)
|
||||||
include_directories(${CURSES_INCLUDE_DIR})
|
|
||||||
|
|
||||||
# Source files
|
# Executable
|
||||||
set(SOURCES
|
add_executable(cordle
|
||||||
src/main.c
|
src/main.c
|
||||||
src/game.c
|
src/game.c
|
||||||
src/words.c
|
|
||||||
src/ui.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()
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user