summaryrefslogtreecommitdiffhomepage
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorTyge Løvset <[email protected]>2022-01-11 20:51:50 +0100
committerTyge Løvset <[email protected]>2022-01-11 20:51:50 +0100
commitd85a4e9e396688b6b5b29c0ffb07de7ce9013b74 (patch)
tree47b60c3014cedd703b1db850c9a7a111e00b3b7c /CMakeLists.txt
parentaf1b2068b39deebfbf723532a2eddc49da61894a (diff)
downloadSTC-modified-d85a4e9e396688b6b5b29c0ffb07de7ce9013b74.tar.gz
STC-modified-d85a4e9e396688b6b5b29c0ffb07de7ce9013b74.zip
Added tinycthread: include/threads.h, src/threads.c. Ex: sptr_threads.c - emulates standard C11 threads library for compilers not supporting C11 threads.h.
Fixed and cleanup of CMake build.
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt11
1 files changed, 11 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 928ddd87..1a38453f 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,14 +1,25 @@
cmake_minimum_required(VERSION 3.1)
+
project(stc)
add_library(stc INTERFACE)
target_include_directories(stc INTERFACE include)
+find_package(FLEX)
+find_package(Threads)
+
+flex_target(checkauto src/checkauto.l ${CMAKE_CURRENT_BINARY_DIR}/lex.yy.c)
+add_executable(checkauto ${FLEX_checkauto_OUTPUTS})
+
include(CTest)
if(BUILD_TESTING)
file(GLOB examples examples/*.c)
foreach(file IN LISTS examples)
get_filename_component(name "${file}" NAME_WE)
add_executable(${name} ${file})
+ target_compile_options(${name} PRIVATE "-pthread")
+ if(CMAKE_THREAD_LIBS_INIT)
+ target_link_libraries(${name} PRIVATE "${CMAKE_THREAD_LIBS_INIT}")
+ endif()
target_link_libraries(${name} PRIVATE stc m)
add_test(NAME ${name} COMMAND ${name})
endforeach()