Commit 39760e19 by Nicolas Capens Committed by Nicolas Capens

Add CMake target for unittests.

Change-Id: I0984f43de3846428c30232192c7ba83342b1debd Reviewed-on: https://swiftshader-review.googlesource.com/19228Reviewed-by: 's avatarKrzysztof Kosiński <krzysio@google.com> Reviewed-by: 's avatarAlexis Hétu <sugoi@google.com> Tested-by: 's avatarNicolas Capens <nicolascapens@google.com>
parent f398044f
......@@ -1028,3 +1028,27 @@ if(BUILD_TESTS AND ${REACTOR_BACKEND} STREQUAL "Subzero")
target_link_libraries(SubzeroTest ReactorSubzero pthread dl)
endif()
endif()
if(BUILD_TESTS)
set(UNITTESTS_LIST
${CMAKE_SOURCE_DIR}/tests/unittests/main.cpp
${CMAKE_SOURCE_DIR}/tests/unittests/unittests.cpp
${CMAKE_SOURCE_DIR}/third_party/googletest/googletest/src/gtest-all.cc
)
set(UNITTESTS_INCLUDE_DIR
${CMAKE_SOURCE_DIR}/third_party/googletest/googletest/include/
${CMAKE_SOURCE_DIR}/third_party/googletest/googlemock/include/
${CMAKE_SOURCE_DIR}/third_party/googletest/googletest/
${CMAKE_SOURCE_DIR}/include/
)
add_executable(unittests ${UNITTESTS_LIST})
set_target_properties(unittests PROPERTIES
INCLUDE_DIRECTORIES "${UNITTESTS_INCLUDE_DIR}"
FOLDER "Tests"
COMPILE_DEFINITIONS "STANDALONE"
)
target_link_libraries(unittests libEGL libGLESv2 ${OS_LIBS})
endif()
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment