forked from bytecodealliance/wasm-micro-runtime
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
116 lines (103 loc) · 2.57 KB
/
CMakeLists.txt
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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
# Copyright (C) 2019 Intel Corporation. All rights reserved.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
cmake_minimum_required (VERSION 3.14)
project(wasm_workloads)
#######################################
add_subdirectory(bwa)
add_subdirectory(meshoptimizer)
add_subdirectory(wasm-av1)
#######################################
include(ExternalProject)
################ iwasm ################
ExternalProject_Add(iwasm
PREFIX
iwasm-build
BUILD_ALWAYS
YES
SOURCE_DIR
${CMAKE_CURRENT_SOURCE_DIR}/../../product-mini/platforms/linux
CONFIGURE_COMMAND
${CMAKE_COMMAND} -S ${CMAKE_CURRENT_SOURCE_DIR}/../../product-mini/platforms/linux -B build -DWAMR_BUILD_LIBC_EMCC=1
BUILD_COMMAND
${CMAKE_COMMAND} --build build --parallel 4
INSTALL_COMMAND
# FIXME: replace with --install
${CMAKE_COMMAND} -E copy_if_different
${CMAKE_CURRENT_BINARY_DIR}/iwasm-build/src/iwasm-build/build/iwasm
${CMAKE_CURRENT_BINARY_DIR}/iwasm
)
################ wamrc ################
ExternalProject_Add(wamrc
PREFIX
wamrc-build
BUILD_ALWAYS
YES
SOURCE_DIR
${CMAKE_CURRENT_SOURCE_DIR}/../../wamr-compiler
CONFIGURE_COMMAND
${CMAKE_COMMAND} -S ${CMAKE_CURRENT_SOURCE_DIR}/../../wamr-compiler -B build
BUILD_COMMAND
${CMAKE_COMMAND} --build build --parallel 4
INSTALL_COMMAND
# FIXME: replace with --install
${CMAKE_COMMAND} -E copy_if_different
${CMAKE_CURRENT_BINARY_DIR}/wamrc-build/src/wamrc-build/build/wamrc
${CMAKE_CURRENT_BINARY_DIR}/wamrc
)
################ .aot ################
add_custom_target(
bwa_to_aot
ALL
DEPENDS
bwa wamrc
COMMAND
./wamrc -o bwa.aot ./bwa/bwa.wasm
WORKING_DIRECTORY
${CMAKE_CURRENT_BINARY_DIR}
)
add_custom_target(
codecbench_to_aot
ALL
DEPENDS
codecbench wamrc
COMMAND
./wamrc -o codecbench.aot ./meshoptimizer/codecbench.wasm
WORKING_DIRECTORY
${CMAKE_CURRENT_BINARY_DIR}
)
add_custom_target(
av1_to_aot
ALL
DEPENDS
av1 wamrc
COMMAND
./wamrc -o testavx.aot ./wasm-av1/testavx.opt.wasm
WORKING_DIRECTORY
${CMAKE_CURRENT_BINARY_DIR}
)
################ smoking test ################
include(CTest)
add_test(
NAME
run_bwa
COMMAND
./iwasm --dir=. ./bwa.aot index ./bwa/hs38DH-extra.fa
WORKING_DIRECTORY
${CMAKE_CURRENT_BINARY_DIR}
)
add_test(
NAME
run_codecbench
COMMAND
./iwasm codecbench.aot
WORKING_DIRECTORY
${CMAKE_CURRENT_BINARY_DIR}
)
add_test(
NAME
run_av1
COMMAND
./iwasm --dir=. testavx.aot ./wasm-av1/elephants_dream_480p24.ivf
WORKING_DIRECTORY
${CMAKE_CURRENT_BINARY_DIR}
)