-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild_mingw_dummy.sh
More file actions
53 lines (30 loc) · 1.05 KB
/
build_mingw_dummy.sh
File metadata and controls
53 lines (30 loc) · 1.05 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
52
53
# Start of MSYS2 shell script
## Dependencies
if [[ " $@ " =~ " --dependencies " ]]; then
# no dependencies (except build tools)
pacman -S --needed base-devel gcc
fi
## Prepare
# construct version string
BUILD="HUI-mingw-$(uname -m)-dummy"
# create target directory
mkdir -p $BUILD
cd $BUILD
## Build
# build with simple g++
g++ -shared -fPIC -o ./libHUI.dll ../hui_webview__dummy.cc -I..
## Deploy
if [[ " $@ " =~ " --deploy " ]]; then
# copy all non-system libraries (makes the build self-contained)
ldd ./libHUI.dll | grep -vE /c/WINDOWS\|System32\|SYSTEM32 | awk '{print $3}' | xargs -I {} sh -c '[ -f {} ] && cp {} .'
fi
## Tests
if [[ " $@ " =~ " --tests " ]]; then
# build and deploy (the first ldd command can be omitted since it works recursively)
#g++ -o <your_executable> <your_source> -L. -lHUI
#ldd <your_executable> | grep -vE /c/WINDOWS\|System32\|SYSTEM32 | awk '{print $3}' | xargs -I {} sh -c '[ -f {} ] && cp {} .'
# build tests
g++ -o test_webview_js_api.exe ../tests/test_webview_js_api.cc -I.. -L. -lHUI
fi
## Notes
cd ..