This repository has been archived on 2026-04-17. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
bhlib-old/tests/CMakeLists.txt

25 lines
675 B
CMake
Raw Permalink Normal View History

2024-04-13 14:52:29 +03:00
set(CMAKE_C_STANDARD 90)
set(CMAKE_C_STANDARD_REQUIRED ON)
set(CMAKE_C_EXTENSIONS OFF)
# Enable testing
include(CTest)
enable_testing()
# Search files
file(GLOB TEST_FILES "src/*.c")
foreach(TEST_FILENAME ${TEST_FILES})
get_filename_component(TEST_NAME ${TEST_FILENAME} NAME_WE)
add_executable("${TEST_NAME}" ${TEST_FILENAME})
target_link_libraries("${TEST_NAME}" bhlib bhunit)
add_test(NAME "${TEST_NAME}" COMMAND "${TEST_NAME}")
2024-06-16 12:23:21 +03:00
# Enable warnings and pedantics
if(MSVC)
target_compile_options("${TEST_NAME}" PRIVATE /W4)
else()
target_compile_options("${TEST_NAME}" PRIVATE -Wall -Wextra -Wpedantic)
endif()
2024-04-13 14:52:29 +03:00
endforeach()