Skip to content

Commit

Permalink
Dont rename libs for packaging (#233)
Browse files Browse the repository at this point in the history
* try this

* dont rename binaries

* Include static libs
  • Loading branch information
almarklein authored Jan 12, 2023
1 parent 9bc89cb commit f523fb7
Showing 1 changed file with 3 additions and 12 deletions.
15 changes: 3 additions & 12 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ FFI_DIR:=ffi
BUILD_DIR:=build
CREATE_BUILD_DIR:=
OUTPUT_DIR:=
FINAL_LIB_NAME:=libwgpu


WILDCARD_SOURCE:=$(wildcard src/*.rs)

Expand Down Expand Up @@ -38,18 +36,13 @@ else
endif

ifeq ($(OS),Windows_NT)
LIB_NAME=libwgpu
LIB_EXTENSION=dll
OS_NAME=windows
else
UNAME_S:=$(shell uname -s)
LIB_NAME=libwgpu
ifeq ($(UNAME_S),Linux)
LIB_EXTENSION=so
OS_NAME=linux
endif
ifeq ($(UNAME_S),Darwin)
LIB_EXTENSION=dylib
OS_NAME=macos
endif
endif
Expand All @@ -66,15 +59,13 @@ package: lib-native lib-native-release
echo "$(GIT_TAG_FULL)" > dist/commit-sha
for RELEASE in debug release; do \
ARCHIVE=$(ARCHIVE_NAME)-$$RELEASE.zip; \
LIBDIR=$(TARGET_DIR)/$$RELEASE; \
rm -f dist/$$ARCHIVE; \
sed 's/webgpu-headers\///' ffi/wgpu.h > wgpu.h ;\
if [ $(OS_NAME) = windows ]; then \
mv $(TARGET_DIR)/$$RELEASE/$(LIB_NAME).dll $(TARGET_DIR)/$$RELEASE/$(FINAL_LIB_NAME).dll; \
mv $(TARGET_DIR)/$$RELEASE/$(LIB_NAME).dll.lib $(TARGET_DIR)/$$RELEASE/$(FINAL_LIB_NAME).lib; \
7z a -tzip dist/$$ARCHIVE ./$(TARGET_DIR)/$$RELEASE/$(FINAL_LIB_NAME).$(LIB_EXTENSION) ./$(TARGET_DIR)/$$RELEASE/$(FINAL_LIB_NAME).lib ./ffi/webgpu-headers/*.h ./wgpu.h ./dist/commit-sha; \
7z a -tzip dist/$$ARCHIVE ./$$LIBDIR/wgpu_native.dll ./$$LIBDIR/wgpu_native.lib ./ffi/webgpu-headers/*.h ./wgpu.h ./dist/commit-sha; \
else \
mv $(TARGET_DIR)/$$RELEASE/$(LIB_NAME).$(LIB_EXTENSION) $(TARGET_DIR)/$$RELEASE/$(FINAL_LIB_NAME).$(LIB_EXTENSION); \
zip -j dist/$$ARCHIVE $(TARGET_DIR)/$$RELEASE/$(FINAL_LIB_NAME).$(LIB_EXTENSION) ./ffi/webgpu-headers/*.h ./wgpu.h ./dist/commit-sha; \
zip -j dist/$$ARCHIVE ./$$LIBDIR/libwgpu_native.so ./$$LIBDIR/libwgpu_native.dylib ./$$LIBDIR/libwgpu_native.a ./ffi/webgpu-headers/*.h ./wgpu.h ./dist/commit-sha; \
fi; \
rm wgpu.h ;\
done
Expand Down

0 comments on commit f523fb7

Please sign in to comment.