Replace vpermpd with vpermilpd
[platform/upstream/openblas.git] / utest / CMakeLists.txt
1 include_directories(${PROJECT_SOURCE_DIR})
2 include_directories(${PROJECT_BINARY_DIR})
3
4 if (MSVC AND "${CMAKE_C_COMPILER_ID}" MATCHES Clang)
5   set(OpenBLAS_utest_src utest_main2.c)
6 else ()
7   set(OpenBLAS_utest_src
8     utest_main.c
9     test_amax.c
10     test_rotmg.c
11     test_rot.c
12     test_axpy.c
13     test_dsdot.c
14     test_swap.c
15   )
16 endif ()
17
18 # crashing on travis cl with an error code suggesting resource not found
19 if (NOT MSVC)
20 set(OpenBLAS_utest_src
21   ${OpenBLAS_utest_src}
22   test_dotu.c
23   )
24 endif ()
25
26 # known to hang with the native Windows and Android threads
27 # FIXME needs checking if this works on any of the other platforms
28 if (NOT USE_OPENMP)
29 if (OS_CYGWIN_NT OR OS_LINUX)
30 set(OpenBLAS_utest_src
31   ${OpenBLAS_utest_src}
32   test_fork.c
33   )
34 endif()
35 endif()
36
37 if (NOT NO_LAPACK)
38 set(OpenBLAS_utest_src
39   ${OpenBLAS_utest_src}
40   test_potrs.c
41   test_kernel_regress.c
42   )
43 endif()
44
45 set(OpenBLAS_utest_bin openblas_utest)
46 add_executable(${OpenBLAS_utest_bin} ${OpenBLAS_utest_src})
47
48 target_link_libraries(${OpenBLAS_utest_bin} ${OpenBLAS_LIBNAME})
49
50 if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
51 target_link_libraries(${OpenBLAS_utest_bin} m)
52 endif()
53
54 if (${CMAKE_SYSTEM_NAME} STREQUAL "WindowsStore")
55 set_target_properties( ${OpenBLAS_utest_bin} PROPERTIES COMPILE_DEFINITIONS "_CRT_SECURE_NO_WARNINGS")
56 endif()
57
58 #Set output for utest
59 set_target_properties( ${OpenBLAS_utest_bin} PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
60 foreach (OUTPUTCONFIG ${CMAKE_CONFIGURATION_TYPES})
61   string( TOUPPER ${OUTPUTCONFIG} OUTPUTCONFIG )
62   set_target_properties( ${OpenBLAS_utest_bin} PROPERTIES RUNTIME_OUTPUT_DIRECTORY_${OUTPUTCONFIG} ${CMAKE_CURRENT_BINARY_DIR})
63 endforeach()
64
65 if (MSVC AND BUILD_SHARED_LIBS)
66 add_custom_command(TARGET ${OpenBLAS_utest_bin}
67           POST_BUILD
68           COMMAND ${CMAKE_COMMAND} -E copy ${PROJECT_BINARY_DIR}/lib/${CMAKE_CFG_INTDIR}/${OpenBLAS_LIBNAME}.dll ${CMAKE_CURRENT_BINARY_DIR}/.
69 )
70 endif()
71
72 add_test(${OpenBLAS_utest_bin} ${CMAKE_CURRENT_BINARY_DIR}/${OpenBLAS_utest_bin})