cordle/CMakeLists.txt

33 lines
696 B
CMake
Raw Normal View History

2025-10-06 13:58:25 +00:00
cmake_minimum_required(VERSION 3.10)
2025-10-06 13:01:05 +00:00
project(cordle C)
set(CMAKE_C_STANDARD 90)
2025-10-06 13:58:25 +00:00
set(CMAKE_C_STANDARD_REQUIRED ON)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c90 -pedantic")
2025-10-06 13:01:05 +00:00
2025-10-06 13:58:25 +00:00
# Find ncurses library
2025-10-06 13:01:05 +00:00
find_package(Curses REQUIRED)
2025-10-06 13:58:25 +00:00
# Include directories
include_directories(include)
include_directories(${CURSES_INCLUDE_DIR})
2025-10-06 13:01:05 +00:00
2025-10-06 13:58:25 +00:00
# Source files
set(SOURCES
src/main.c
src/game.c
src/words.c
src/ui.c
)
# Create executable
add_executable(cordle ${SOURCES})
# Link ncurses
2025-10-06 13:01:05 +00:00
target_link_libraries(cordle ${CURSES_LIBRARIES})
2025-10-06 13:58:25 +00:00
# Set compiler flags for C90 compliance
if(CMAKE_C_COMPILER_ID MATCHES "GNU|Clang")
target_compile_options(cordle PRIVATE -Wpedantic -Wextra -pedantic)
2025-10-06 13:58:25 +00:00
endif()