Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions HW4/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
cmake_minimum_required(VERSION 3.25)
project(homework4 C)

if(CMAKE_C_COMPILER_ID MATCHES "GNU|Clang")
message(STATUS "Using GCC/Clang warnings")
add_compile_options(-Wall -Wextra -Wpedantic)
elseif(MSVC)
message(STATUS "Using MSVC warnings")
add_compile_options(/W4)
else()
message(STATUS "Unknown compiler - using default warnings")
endif()

add_subdirectory(modules)
add_subdirectory(ParenthesesBalance)
add_subdirectory(ShuntingYard)

5 changes: 5 additions & 0 deletions HW4/ParenthesesBalance/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
add_executable(parenthesesBalance src/main.c)

target_link_libraries(parenthesesBalance stack)
target_include_directories(parenthesesBalance PRIVATE ${CMAKE_SOURCE_DIR}/modules)

5 changes: 5 additions & 0 deletions HW4/ShuntingYard/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
add_executable(shuntingYard src/main.c)

target_link_libraries(shuntingYard stack queue)
target_include_directories(shuntingYard PRIVATE ${CMAKE_SOURCE_DIR}/modules)

6 changes: 6 additions & 0 deletions HW4/modules/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
add_library(stack STATIC stack/stack.c stack/stack.h)
target_include_directories(stack PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/stack)

add_library(queue STATIC queue/queue.c queue/queue.h)
target_include_directories(queue PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/queue)