2021-02-01 22:06:37 +00:00
|
|
|
cmake_minimum_required(VERSION 3.17)
|
|
|
|
project(flint C)
|
2021-12-10 20:41:36 +00:00
|
|
|
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
|
2021-02-01 22:06:37 +00:00
|
|
|
|
|
|
|
set(CMAKE_C_STANDARD 99)
|
|
|
|
include_directories(include)
|
|
|
|
|
|
|
|
set(SOURCES
|
2023-07-12 18:32:21 +00:00
|
|
|
src/linkedlist.c
|
|
|
|
src/set.c
|
|
|
|
src/stack.c
|
|
|
|
src/binarytree.c
|
|
|
|
src/input.c
|
|
|
|
src/math.c
|
2023-10-25 14:56:41 +00:00
|
|
|
src/vector.c
|
2023-11-29 22:01:41 +00:00
|
|
|
src/utility.c
|
2021-02-01 22:06:37 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
add_library(flint ${SOURCES})
|
2022-12-02 16:04:51 +00:00
|
|
|
if ((${CMAKE_SYSTEM_NAME} STREQUAL "Linux"))
|
2022-03-30 23:36:00 +00:00
|
|
|
target_link_libraries(flint bsd)
|
|
|
|
endif()
|
2021-02-01 22:06:37 +00:00
|
|
|
|
|
|
|
if(${CMAKE_PROJECT_NAME} STREQUAL flint)
|
|
|
|
add_executable(tests tests/tests.c)
|
|
|
|
target_include_directories(tests PRIVATE include)
|
|
|
|
|
2023-10-25 16:21:59 +00:00
|
|
|
if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
|
2023-07-12 18:45:30 +00:00
|
|
|
target_link_libraries(tests flint bsd)
|
2023-10-25 16:21:59 +00:00
|
|
|
else()
|
|
|
|
target_link_libraries(tests flint)
|
2023-07-12 18:45:30 +00:00
|
|
|
endif()
|
|
|
|
endif()
|