pull/39/head
Ciro 2022-11-03 18:04:17 -03:00
commit d63a35098a
3 zmienionych plików z 54 dodań i 16 usunięć

22
.github/workflows/c-cpp.yml vendored 100644
Wyświetl plik

@ -0,0 +1,22 @@
name: Build
on: workflow_dispatch
jobs:
build-linux:
runs-on: ubuntu-latest
name: Build on amd64
steps:
- name: Update binaries
run: |
sudo apt update || true
sudo apt install -y g++-aarch64-linux-gnu || true
git clone -b workflows-test --recursive https://github.com/cirospaciari/socketify.py.git
cd socketify.py/src/socketify/native
make linux
cd ../
git add libsocketify_linux_amd64.so
git config --global user.email "ciro.spaciari@gmail.com"
git config --global user.name "Ciro Spaciari"
git commit -a -m "[GitHub Actions] Updated linux-amd64 binaries" || true
git push "https://cirospaciari:${{ secrets.BUILDTOKEN }}@github.com/cirospaciari/socketify.py.git" workflows-test

Wyświetl plik

@ -0,0 +1,26 @@
@REM #download dependences
vcpkg install libuv zlib --triplet x64-windows
vcpkg install zlib:x64-windows-static
vcpkg install libevent:x64-windows-static
vcpkg integrate install
cp C:\vcpkg\installed\x64-windows\bin\uv.dll ..\uv.dll
@REM # build boringssl
cd ../uWebSockets/uSockets/boringssl
mkdir amd64
cd amd64
cmake -DCMAKE_BUILD_TYPE=Release -GNinja .. && ninja crypto ssl
cd ../../lsquic
@REM # build lsquic
cmake -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DBORINGSSL_DIR=../boringssl -DCMAKE_BUILD_TYPE=Release -DLSQUIC_BIN=Off . && msbuild ALL_BUILD.vcxproj
cd ../../../native
@REM # build uWebSockets
cd ../uWebSockets/uSockets
clang -Wpedantic -Wall -Wextra -Wsign-conversion -Wconversion -D WIN32_LEAN_AND_MEAN -I lsquic/wincompat -I C:/vcpkg/packages/libuv_x64-windows/include -I src -I lsquic/include -I boringssl/include -DUWS_WITH_PROXY -DLIBUS_USE_OPENSSL -DLIBUS_USE_LIBUV -DLIBUS_USE_QUIC -pthread -std=c11 -O3 -c src/*.c src/eventing/*.c src/crypto/*.c -L C:/vcpkg/packages/libuv_x64-windows/lib
clang++ -Wpedantic -Wall -Wextra -Wsign-conversion -Wconversion -D WIN32_LEAN_AND_MEAN -I lsquic/wincompat -I C:/vcpkg/packages/libuv_x64-windows/include -I boringssl/include -DUWS_WITH_PROXY -DLIBUS_USE_OPENSSL -DLIBUS_USE_LIBUV -DLIBUS_USE_QUIC -pthread -std=c++2a -O3 -c src/crypto/*.cpp -L C:/vcpkg/packages/zlib_x64-windows/lib
ar rvs uSockets_windows_amd64.a *.o
cd ../../native
@REM # build CAPI + libsocketify
clang++ -Wpedantic -Wall -Wextra -Wsign-conversion -Wconversion -D WIN32_LEAN_AND_MEAN -I C:/vcpkg/packages/zlib_x64-windows/include -I C:/vcpkg/packages/libuv_x64-windows/include -I ./src -I ../uWebSockets/src -I ../uWebSockets/uSockets/src -I ../uWebSockets/capi -I ../uWebSockets/uSockets/lsquic/wincompat -I ../uWebSockets/uSockets/lsquic/include -I ../uWebSockets/uSockets/boringssl/include -pthread -std=c++2a -c -O3 ./src/libsocketify.cpp -L C:/vcpkg/packages/libuv_x64-windows/lib
clang++ -Wpedantic -Wall -Wextra -Wsign-conversion -Wconversion -shared -o ../libsocketify_windows_amd64.so libsocketify.o ../uWebSockets/uSockets/uSockets_windows_amd64.a ../uWebSockets/uSockets/boringssl/amd64/ssl/ssl.lib ../uWebSockets/uSockets/boringssl/amd64/crypto/crypto.lib C:/vcpkg/packages/zlib_x64-windows/lib/zlib.lib ../uWebSockets/uSockets/lsquic/src/liblsquic/Debug/lsquic.lib -luv -L C:/vcpkg/packages/libuv_x64-windows/lib

Wyświetl plik

@ -12,22 +12,12 @@ ifeq ($(PLATFORM), arm)
endif endif
clean: clean:
cd ../uWebSockets/uSockets && rm -f *.o *.a *.so cd ../uWebSockets/uSockets && rm -f *.o *.a *.so *.obj *.lib *.dll
cd ../uWebSockets/ && rm -f *.o *.a *.so cd ../uWebSockets/ && rm -f *.o *.a *.so *.obj *.lib *.dll
rm -f *.o *.a *.so *.dll rm -f *.o *.a *.so *.dll *.obj *.lib
# rm -rf ../uWebSockets/uSockets/boringssl/amd64 rm -rf ../uWebSockets/uSockets/boringssl/amd64
# rm -rf ../uWebSockets/uSockets/boringssl/arm64 rm -rf ../uWebSockets/uSockets/boringssl/vcpkg
rm -rf ../uWebSockets/uSockets/boringssl/arm64
windows:
$(MAKE) clean
# build boringssl
cd ../uWebSockets/uSockets/boringssl && mkdir -p amd64 && cd amd64 && cmake -DCMAKE_BUILD_TYPE=Release -GNinja .. && ninja crypto ssl
# build lsquic
cd ../uWebSockets/uSockets/lsquic && cmake -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DBORINGSSL_DIR=../boringssl -DCMAKE_BUILD_TYPE=Release -DLSQUIC_BIN=Off . && msbuild ALL_BUILD.vcxproj
# build windows
cl /MD /W3 /D WIN32_LEAN_AND_MEAN /D \"UWS_WITH_PROXY\" /D \"LIBUS_USE_LIBUV\" /D \"LIBUS_USE_QUIC\" /I ../uWebSockets/uSockets/lsquic/include /I ../uWebSockets/uSockets/lsquic/wincompat /I ../uWebSockets/uSockets/boringssl/include /D \"LIBUS_USE_OPENSSL\" /std:c++17 /I ../uWebSockets/uSockets/src ../uWebSockets/uSockets/src/*.c ../uWebSockets/uSockets/src/crypto/sni_tree.cpp ../uWebSockets/uSockets/src/eventing/*.c ../uWebSockets/uSockets/src/crypto/*.c /I ../uWebSockets/src /EHsc /Ox /LD /Fe../$(LIBRARY_NAME)_windows_amd64.so ./src/$(LIBRARY_NAME).cpp advapi32.lib ../uWebSockets/uSockets/boringssl/amd64/ssl/ssl.lib ../uWebSockets/uSockets/boringssl/amd64/crypto/crypto.lib ../uWebSockets/uSockets/lsquic/src/liblsquic/Debug/lsquic.lib
macos: macos:
$(MAKE) clean $(MAKE) clean