File: CMakeLists.txt

package info (click to toggle)
hsail-tools 0~20170314-3
  • links: PTS
  • area: main
  • in suites: buster
  • size: 8,440 kB
  • ctags: 4,374
  • sloc: cpp: 17,706; perl: 5,123; sh: 81; makefile: 12
file content (73 lines) | stat: -rw-r--r-- 2,250 bytes parent folder | download | duplicates (2)
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
add_executable(HSAILasm HSAILAsm.cpp)

target_link_libraries(HSAILasm hsail)

if(AMD_EXTENSIONS)
  target_link_libraries(HSAILasm hsail-amd)
endif()

find_library(CURSES_LIB curses)

if(BUILD_LIBBRIGDWARF)
  include_directories(${LIBELF_INCLUDE_DIRS})

  target_link_libraries(HSAILasm ${LIBELF_LIBRARIES})
  target_link_libraries(HSAILasm ${LIBDWARF_LIBRARIES})
endif()

if(CURSES_LIB)
  target_link_libraries(HSAILasm ${CURSES_LIB})
endif()
if(UNIX)
  target_link_libraries(HSAILasm tinfo pthread)
endif()

install(TARGETS HSAILasm
  RUNTIME DESTINATION bin COMPONENT libhsail
)

set(HSAILASM $<TARGET_FILE:HSAILasm>)
set(test "${PROJECT_SOURCE_DIR}/tests/1.0/simple.hsail")

add_test(NAME HSAILAsm-help
         COMMAND ${HSAILASM} -help
         WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})

add_test(NAME HSAILAsm-version
         COMMAND ${HSAILASM} -version
         WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})

add_test(NAME HSAILAsm-assemble
         COMMAND ${HSAILASM} -assemble ${test} -o test.brig
         WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})

add_test(NAME HSAILAsm-disassemble
         COMMAND ${HSAILASM} -disassemble test.brig
         WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})

add_test(NAME HSAILAsm-decode
         COMMAND ${HSAILASM} -decode test.brig -o test.yaml
         WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})

set_tests_properties(HSAILAsm-disassemble HSAILAsm-decode PROPERTIES DEPENDS HSAILAsm-assemble)

if(BUILD_LIBBRIGDWARF)
add_test(NAME HSAILAsm-assemble-g
         COMMAND ${HSAILASM} -assemble -g ${test} -o test-g.brig
         WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})

add_test(NAME HSAILAsm-disassemble-g
         COMMAND ${HSAILASM} -disassemble test-g.brig
         WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})

add_test(NAME HSAILAsm-assemble-g-odebug
         COMMAND ${HSAILASM} -assemble -g ${test} -odebug test-g.dbg -o test-g.brig
         WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})

add_test(NAME HSAILAsm-assemble-g-include-source
         COMMAND ${HSAILASM} -assemble -g -include-source ${test} -o test-g.brig
         WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})

set_tests_properties(HSAILAsm-disassemble-g PROPERTIES DEPENDS HSAILAsm-assemble-g)

endif()