-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sh
executable file
·59 lines (51 loc) · 1.76 KB
/
build.sh
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
# Make script directory the current directory
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
cd $SCRIPT_DIR
# Download wasmer lib if necessary
if [ ! -d "wasmer" ]; then
echo "*************************"
echo Installing Wasmer libs
echo "*************************"
mkdir wasmer
cd wasmer
curl -s -L -O https://github.com/wasmerio/wasmer/releases/download/2.0.0-rc2/wasmer-linux-amd64.tar.gz
tar -xzf wasmer-linux-amd64.tar.gz
rm wasmer-linux-amd64.tar.gz
cd $SCRIPT_DIR
fi
echo
echo "*************************"
echo build with "Unix Makefiles"
echo "*************************"
cmake --no-warn-unused-cli -DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=TRUE -DCMAKE_BUILD_TYPE:STRING=Debug -H. -B./build_make -G "Unix Makefiles"
cmake --build ./build_make --config Debug --target all -j 10 --
echo
echo "*************************"
echo build with "Ninja"
echo "*************************"
cmake --no-warn-unused-cli -DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=TRUE -DCMAKE_BUILD_TYPE:STRING=Debug -H. -B./build_ninja -G "Ninja"
cmake --build ./build_ninja --config Debug --target all -j 10 --
echo
echo "*************************"
echo Show NEEDED path with "Unix Makefiles"
echo "*************************"
cd build_make/so_test_exe/
objdump -x so_test_exe | grep libwasmer.so
echo
echo "*************************"
echo Execute with "Unix Makefiles"
echo "*************************"
./so_test_exe
cd $SCRIPT_DIR
echo
echo "*************************"
echo Show NEEDED path with "Ninja"
echo "*************************"
cd build_ninja/so_test_exe/
objdump -x so_test_exe | grep libwasmer.so
echo
echo "*************************"
echo Execute with "Ninja" - WILL FAIL - SHARED LIB NOT FOUND
echo "*************************"
./so_test_exe
cd $SCRIPT_DIR