crafting-interpreters/1/HelloWorldC/CMakeLists.txt
2020-10-12 20:46:11 -07:00

19 lines
361 B
CMake

cmake_minimum_required(VERSION 3.18)
enable_testing()
project(HelloWorld C)
add_executable(HelloWorld main.c)
find_library(CMocka cmocka)
target_link_libraries(HelloWorld cmocka)
add_test(
NAME HelloWorldTest
COMMAND HelloWorld)
add_test(
NAME HelloWorldMemoryTest
COMMAND valgrind --error-exitcode=1 --leak-check=full $<TARGET_FILE:HelloWorld>)