crafting-interpreters/1/HelloWorldC/CMakeLists.txt

20 lines
361 B
Text
Raw Permalink Normal View History

2020-10-13 05:46:11 +02:00
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>)