forked from pikasTech/PikaPython
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
27 lines (20 loc) · 746 Bytes
/
Copy pathCMakeLists.txt
File metadata and controls
27 lines (20 loc) · 746 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# include(CheckIPOSupported)
# check_ipo_supported(RESULT supported OUTPUT error)
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})
# if(supported)
# message(STATUS "IPO / LTO enabled")
# set_property(TARGET ${BINARY} PROPERTY INTERPROCEDURAL_OPTIMIZATION TRUE)
# else()
# message(STATUS "IPO / LTO not supported: <${error}>")
# endif()
# 链接src生成的lib库和gtest库
target_link_libraries(${BINARY} PUBLIC
-Wl,--whole-archive
${CMAKE_PROJECT_NAME}-core
${CMAKE_PROJECT_NAME}-lvgl
-Wl,--no-whole-archive
gtest)