diff options
| author | Tyge Løvset <[email protected]> | 2023-02-05 22:24:30 +0100 |
|---|---|---|
| committer | Tyge Løvset <[email protected]> | 2023-02-05 22:24:30 +0100 |
| commit | bd0d759bf4e88a6f7001c619202e2448369e9a8a (patch) | |
| tree | 54a67ec7b005b8ed7233344a2ba7c283cefa087b | |
| parent | e6dfaf1720f6833784d17d5364e1dd76324dff6a (diff) | |
| download | STC-modified-bd0d759bf4e88a6f7001c619202e2448369e9a8a.tar.gz STC-modified-bd0d759bf4e88a6f7001c619202e2448369e9a8a.zip | |
Added misc/tests to CMakeLists.txt, and some cleanup.
| -rw-r--r-- | CMakeLists.txt | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 9369a070..a4659ff6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -4,11 +4,12 @@ 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}) +if (UNIX) + #find_package(Threads) + find_package(FLEX) + flex_target(checkauto src/checkauto.l ${CMAKE_CURRENT_BINARY_DIR}/lex.yy.c) + add_executable(checkauto ${FLEX_checkauto_OUTPUTS}) +endif() include(CTest) if(BUILD_TESTING) @@ -16,13 +17,19 @@ if(BUILD_TESTING) foreach(file IN LISTS misc/examples) get_filename_component(name "${file}" NAME_WE) add_executable(${name} ${file}) - target_compile_options(${name} PRIVATE "-pthread") + #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() + + file(GLOB test_files misc/tests/*_test.c) + add_executable(stctest ${test_files} misc/tests/main.c) + target_link_libraries(stctest PRIVATE stc m) + add_test(NAME stctest COMMAND stctest) + # foreach(name IN ITEMS cdeq clist cmap csmap cvec) # add_executable(${name} misc/benchmarks/plotbench/${name}_benchmark.cpp) # target_link_libraries(${name} PRIVATE stc m) |
