Add Windows Autobuild CI (#244)

* Add Windows x64 CI

* Add missing dependency

* Fix rapidjson build

* Add Windows build to Travis CI

Add Windows x86 build to GitHub Actions

* Fix mingw32-make not found

* Fix subsystem on Actions

Fix install prefix on Travis CI.

* Use MINGW_PREFIX instead of /usr

* Clean up scripts

Add Windows x86 build to Travis CI.
This commit is contained in:
Tindy X
2020-09-07 20:08:19 +08:00
committed by GitHub
parent 10c3d2f35e
commit abe03cebeb
4 changed files with 154 additions and 2 deletions

View File

@@ -6,7 +6,7 @@ apk add mbedtls-dev mbedtls-static zlib-dev rapidjson-dev libevent-dev libevent-
git clone https://github.com/curl/curl --depth=1
cd curl
cmake -DCMAKE_USE_MBEDTLS=ON -DHTTP_ONLY=ON -DBUILD_TESTING=OFF -DBUILD_SHARED_LIBS=OFF -DCMAKE_USE_LIBSSH2=OFF . > /dev/null
cmake -DCMAKE_USE_MBEDTLS=ON -DHTTP_ONLY=ON -DBUILD_TESTING=OFF -DBUILD_SHARED_LIBS=OFF -DCMAKE_USE_LIBSSH2=OFF -DBUILD_CURL_EXE=OFF . > /dev/null
make install -j2 > /dev/null
cd ..

View File

@@ -0,0 +1,41 @@
#!/bin/bash
set -xe
git clone https://github.com/curl/curl --depth=1
cd curl
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_USE_LIBSSH2=OFF -DHTTP_ONLY=ON -DCMAKE_USE_SCHANNEL=ON -DBUILD_SHARED_LIBS=OFF -DBUILD_CURL_EXE=OFF -DCMAKE_INSTALL_PREFIX=$MINGW_PREFIX -G "Unix Makefiles" .
make install -j4
cd ..
git clone https://github.com/jbeder/yaml-cpp --depth=1
cd yaml-cpp
cmake -DCMAKE_BUILD_TYPE=Release -DYAML_CPP_BUILD_TESTS=OFF -DYAML_CPP_BUILD_TOOLS=OFF -DCMAKE_INSTALL_PREFIX=$MINGW_PREFIX -G "Unix Makefiles" .
make install -j4
cd ..
git clone https://github.com/svaarala/duktape --depth=1
cd duktape
pip2 install PyYAML
mkdir dist
python2 util/dist.py
cd dist/source/src
gcc -c -O3 -o duktape.o duktape.c
gcc -c -O3 -o duk_module_node.o -I. ../extras/module-node/duk_module_node.c
ar cr libduktape.a duktape.o
ar cr libduktape_module.a duk_module_node.o
install -m0644 ./*.a $MINGW_PREFIX/lib
install -m0644 ./duk*.h $MINGW_PREFIX/include
install -m0644 ../extras/module-node/duk_module_node.h $MINGW_PREFIX/include
cd ../../../..
git clone https://github.com/Tencent/rapidjson --depth=1
cd rapidjson
cmake -DRAPIDJSON_BUILD_DOC=OFF -DRAPIDJSON_BUILD_EXAMPLES=OFF -DRAPIDJSON_BUILD_TESTS=OFF -DCMAKE_INSTALL_PREFIX=$MINGW_PREFIX -G "Unix Makefiles" .
make install -j4
cd ..
cmake -DCMAKE_BUILD_TYPE=Release -G "Unix Makefiles" .
make -j4
rm subconverter.exe
g++ $(find CMakeFiles/subconverter.dir/src -name "*.obj") curl/lib/libcurl.a -o base/subconverter.exe -static -levent -lpcre2-8 -lduktape -lduktape_module -lyaml-cpp -lcrypt32 -lws2_32 -lwsock32 -lz -s
mv base subconverter