From 2db76fa280487e96ecfccbb1089866e2b8eb4d31 Mon Sep 17 00:00:00 2001 From: Ciro Date: Thu, 24 Nov 2022 11:21:32 -0300 Subject: [PATCH] add cmake test --- .github/workflows/macos_arm64_libuv-cmake.yml | 11 ++++++++++- src/socketify/native/Makefile | 15 +++++++++++++++ 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/.github/workflows/macos_arm64_libuv-cmake.yml b/.github/workflows/macos_arm64_libuv-cmake.yml index 607273f..3b593ed 100644 --- a/.github/workflows/macos_arm64_libuv-cmake.yml +++ b/.github/workflows/macos_arm64_libuv-cmake.yml @@ -12,4 +12,13 @@ jobs: cd libuv cmake . -DCMAKE_OSX_ARCHITECTURES=arm64 cmake --build . - ls * \ No newline at end of file + cd ../ + git clone --recursive https://github.com/cirospaciari/socketify.py.git + cd socketify.py/src/socketify/native + make macos-arm64-libuv-static-cmake + cd ../ + git add libsocketify_darwin_arm64.so + git config --global user.email "ciro.spaciari@gmail.com" + git config --global user.name "Ciro Spaciari" + git commit -m "[GitHub Actions] Updated darwin-arm64 binaries" || true + git push "https://cirospaciari:${{ secrets.BUILDTOKEN }}@github.com/cirospaciari/socketify.py.git" \ No newline at end of file diff --git a/src/socketify/native/Makefile b/src/socketify/native/Makefile index 0a98d65..6bc5803 100644 --- a/src/socketify/native/Makefile +++ b/src/socketify/native/Makefile @@ -23,6 +23,21 @@ clean: rm -rf ../uWebSockets/uSockets/boringssl/arm64 +macos-arm64-libuv-static-cmake: + $(MAKE) clean + # build boringssl for arm64 (cross compile) + cd ../uWebSockets/uSockets/boringssl && mkdir -p arm64 && cd arm64 && cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_OSX_ARCHITECTURES=arm64 .. && make crypto ssl + + # build uWebSockets for arm64 (cross compile) + cd ../uWebSockets/uSockets && $(CC) -target arm64-apple-macos11 -I src -I boringssl/include -DUWS_WITH_PROXY -DLIBUS_USE_OPENSSL -DLIBUS_USE_LIBUV -pthread -fPIC -std=c11 -O3 -c src/*.c src/eventing/*.c src/crypto/*.c + cd ../uWebSockets/uSockets && $(CXX) -stdlib=libc++ -target arm64-apple-macos11 -I boringssl/include -DUWS_WITH_PROXY -DLIBUS_USE_OPENSSL -DLIBUS_USE_LIBUV -pthread -fPIC -std=c++17 -O3 -c src/crypto/*.cpp + cd ../uWebSockets/uSockets && $(AR) rvs uSockets_darwin_arm64.a *.o + + # build CAPI + libsocketify for arm64 (cross compile) + $(CXX) -stdlib=libc++ -target arm64-apple-macos11 -I ../../../../libuv/include -I ./src -I ../uWebSockets/src -I ../uWebSockets/uSockets/src -I ../uWebSockets/capi -I ../uWebSockets/uSockets/boringssl/include -DUWS_WITH_PROXY -pthread -fPIC -std=c++17 -c -O3 ./src/$(LIBRARY_NAME).cpp + $(CXX) -stdlib=libc++ -target arm64-apple-macos11 -shared -undefined dynamic_lookup -o ../$(LIBRARY_NAME)_darwin_arm64.so $(LIBRARY_NAME).o ../uWebSockets/uSockets/uSockets_darwin_arm64.a ../uWebSockets/uSockets/boringssl/arm64/ssl/libssl.a ../uWebSockets/uSockets/boringssl/arm64/crypto/libcrypto.a ../../../../libuv/libuv_a.a -flto -fPIC -lz + + macos-arm64-libuv-static: $(MAKE) clean # build boringssl for arm64 (cross compile)