-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild-in-container.sh
More file actions
executable file
·51 lines (45 loc) · 1.81 KB
/
Copy pathbuild-in-container.sh
File metadata and controls
executable file
·51 lines (45 loc) · 1.81 KB
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
#!/bin/sh
set -e
echo "--> Cloning and building SmartPianoEngine..."
rm -rf /tmp/engine /tmp/engine-install
git clone https://github.com/ProjetISIE/SmartPianoEngine.git /tmp/engine
cd /tmp/engine
cmake -B build -DCMAKE_BUILD_TYPE=Release \
-DBUILD_TESTING=OFF \
-DCOVERAGE=OFF \
-DCMAKE_SYSTEM_NAME=Linux \
-DCMAKE_SYSTEM_PROCESSOR=aarch64 \
-DCMAKE_CXX_COMPILER=clang++-18 \
-DCMAKE_CXX_COMPILER_TARGET=aarch64-linux-gnu \
-DCMAKE_CXX_FLAGS="-stdlib=libc++" \
-DCMAKE_EXE_LINKER_FLAGS="-stdlib=libc++ -static-libstdc++ -fuse-ld=lld-18 -lasound -lpthread"
cmake --build build -j"$(nproc)"
# Engine's CMake install target is missing headers and libraries!
mkdir -p /tmp/engine-install/bin
mkdir -p /tmp/engine-install/include
mkdir -p /tmp/engine-install/lib
cp -r include/* /tmp/engine-install/include/
find build -name "*.a" -exec cp {} /tmp/engine-install/lib/ \;
cp build/src/main /tmp/engine-install/bin/engine
echo "--> Building SmartPianoLightUI..."
cd /workspace
cmake -B build-cross -DCMAKE_BUILD_TYPE=Release \
-DENGINE_PATH=/tmp/engine-install \
-DENGINE_INCLUDE_DIR=/tmp/engine-install/include \
-DENGINE_LIBRARY=/tmp/engine-install/lib/libenginecomm.a \
-DCMAKE_PREFIX_PATH=/usr/aarch64-linux-gnu \
-DBUILD_TESTING=OFF \
-DCMAKE_SYSTEM_NAME=Linux \
-DCMAKE_SYSTEM_PROCESSOR=aarch64 \
-DCMAKE_CXX_COMPILER=clang++-18 \
-DCMAKE_CXX_COMPILER_TARGET=aarch64-linux-gnu \
-DCMAKE_CXX_FLAGS="-stdlib=libc++" \
-DCMAKE_EXE_LINKER_FLAGS="-stdlib=libc++ -static-libstdc++ -fuse-ld=lld-18 -lasound -lpthread"
cmake --build build-cross -j"$(nproc)"
echo "--> Packaging binaries..."
mkdir -p deploy
cp build-cross/src/main deploy/smart-piano-ui
cp /tmp/engine-install/bin/engine deploy/engine
cp GClef.png deploy/GClef.png || true
cp logo.png deploy/logo.png || true
chmod 777 deploy/smart-piano-ui deploy/engine