pikapython/test/CMakeLists.txt

12 lines
395 B
CMake
Raw Normal View History

2021-10-01 00:21:50 +08:00
set(BINARY ${CMAKE_PROJECT_NAME}_test)
file(GLOB_RECURSE TEST_SOURCES LIST_DIRECTORIES false *.h *.cpp *.c)
set(SOURCES ${TEST_SOURCES})
add_executable(${BINARY} ${TEST_SOURCES})
add_test(NAME ${BINARY} COMMAND ${BINARY})
2021-10-12 22:03:55 +08:00
2021-10-01 00:21:50 +08:00
# 链接src生成的lib库和gtest库
target_link_libraries(${BINARY} PUBLIC
2021-10-12 22:03:55 +08:00
-Wl,--whole-archive ${CMAKE_PROJECT_NAME}-core -Wl,--no-whole-archive
2021-10-01 00:21:50 +08:00
gtest)