Commit 1659484b by Nicolas Capens

Add Subzero unit tests to CMake build.

Bug b/37478805 Change-Id: Idb44b05cea24eed8a46d267c3de9fc769ac58977 Reviewed-on: https://swiftshader-review.googlesource.com/9489Reviewed-by: 's avatarNicolas Capens <capn@google.com> Tested-by: 's avatarNicolas Capens <capn@google.com>
parent 47dc8676
...@@ -17,6 +17,7 @@ option(BUILD_GLES_CM "Build the OpenGL ES 1.1 library" 1) ...@@ -17,6 +17,7 @@ option(BUILD_GLES_CM "Build the OpenGL ES 1.1 library" 1)
option(USE_GROUP_SOURCES "Group the source files in a folder tree for Visual Studio" 1) option(USE_GROUP_SOURCES "Group the source files in a folder tree for Visual Studio" 1)
option(BUILD_SAMPLES "Build sample programs" 1) option(BUILD_SAMPLES "Build sample programs" 1)
option(BUILD_TESTS "Build test programs" 1)
set(REACTOR_BACKEND "LLVM" CACHE STRING "JIT compiler back-end used by Reactor") set(REACTOR_BACKEND "LLVM" CACHE STRING "JIT compiler back-end used by Reactor")
set_property(CACHE REACTOR_BACKEND PROPERTY STRINGS LLVM Subzero) set_property(CACHE REACTOR_BACKEND PROPERTY STRINGS LLVM Subzero)
...@@ -978,3 +979,26 @@ if(BUILD_SAMPLES) ...@@ -978,3 +979,26 @@ if(BUILD_SAMPLES)
) )
endif() endif()
endif() endif()
if(BUILD_TESTS AND ${REACTOR_BACKEND} STREQUAL "Subzero")
set(SUBZERO_TEST_LIST
${SOURCE_DIR}/Reactor/Main.cpp
${CMAKE_SOURCE_DIR}/third_party/googletest/googletest/src/gtest-all.cc
)
set(SUBZERO_TEST_INCLUDE_DIR
${CMAKE_SOURCE_DIR}/third_party/googletest/googletest/include
${CMAKE_SOURCE_DIR}/third_party/googletest/googletest/
)
add_executable(SubzeroTest ${SUBZERO_TEST_LIST})
set_target_properties(SubzeroTest PROPERTIES
INCLUDE_DIRECTORIES "${SUBZERO_TEST_INCLUDE_DIR}"
FOLDER "Tests"
)
if(WIN32)
target_link_libraries(SubzeroTest ReactorSubzero)
else()
target_link_libraries(SubzeroTest ReactorSubzero pthread dl)
endif()
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