File tree Expand file tree Collapse file tree 1 file changed +13
-12
lines changed Expand file tree Collapse file tree 1 file changed +13
-12
lines changed Original file line number Diff line number Diff line change 1
1
#! /bin/bash -e
2
2
3
- [ -z " $CXX " ] && exit 255
4
- export CC=false # don't need it actually
5
-
6
- variant=win32
7
- [[ " $( basename " $CXX " ) " == " x86_64-" * ]] && variant=win64
8
-
9
3
# ######
10
- # this expects unpacked libraries similar to what Luanti's buildbot uses
11
- # $extradlls will typically point to the DLLs for libgcc, libstdc++ and libpng
4
+ # this expects unpacked libraries and a toolchain file like Luanti's buildbot uses
5
+ # $extradlls will typically contain the compiler-specific DLLs and libpng
6
+ toolchain_file=
12
7
libgd_dir=
13
8
zlib_dir=
14
9
zstd_dir=
15
10
sqlite_dir=
16
11
leveldb_dir=
17
- extradlls=()
12
+ extradlls=(
13
+ )
18
14
# ######
19
15
20
- [ -f ./CMakeLists.txt ] || exit 1
16
+ [ -f " $toolchain_file " ] || exit 1
17
+ variant=win32
18
+ grep -q ' CX?X?_COMPILER.*x86_64-' $toolchain_file && variant=win64
19
+ echo " Detected target $variant "
20
+
21
+ [ -f ./CMakeLists.txt ] || { echo " run from root folder" >&2 ; exit 1; }
21
22
22
23
cmake -S . -B build \
23
- -DCMAKE_SYSTEM_NAME=Windows \
24
+ -DCMAKE_TOOLCHAIN_FILE= " $toolchain_file " \
24
25
-DCMAKE_EXE_LINKER_FLAGS=" -s" \
25
26
\
26
27
-DENABLE_LEVELDB=1 \
@@ -34,7 +35,7 @@ cmake -S . -B build \
34
35
-DZLIB_INCLUDE_DIR=$zlib_dir /include \
35
36
-DZLIB_LIBRARY=$zlib_dir /lib/libz.dll.a \
36
37
-DZSTD_INCLUDE_DIR=$zstd_dir /include \
37
- -DZSTD_LIBRARY=$zstd_dir /lib/libzstd.dll.a \
38
+ -DZSTD_LIBRARY=$zstd_dir /lib/libzstd.dll.a
38
39
39
40
make -C build -j4
40
41
You can’t perform that action at this time.
0 commit comments