Skip to content

Commit

Permalink
Merge #111
Browse files Browse the repository at this point in the history
111: Fix path flattening in makefile r=kvark a=almarklein

I should have tested it properly in #110, sorry.

The flattening now happens like this: `sed` is used to replace "webgpu-headers/" with nothing. The resulting changed file is saved as `wgpu.h` (rather than `ffi/wgpu.h`), and this file is included in the zipfile.

I moved away from `sed -i` (inplace) because that API differs between Linux and MacOS:/

Co-authored-by: Almar Klein <[email protected]>
  • Loading branch information
bors[bot] and almarklein authored Jun 4, 2021
2 parents a5ce139 + e9cca50 commit 66a4139
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,13 @@ package: lib-native lib-native-release
for RELEASE in debug release; do \
ARCHIVE=wgpu-$$RELEASE-$(OS_NAME)-$(GIT_TAG).zip; \
rm -f dist/$$ARCHIVE; \
sed -i 's/webgpu-headers\/webgpu\.h/webgpu.h/' ffi/wgpu.h
sed 's/webgpu-headers\///' ffi/wgpu.h > wgpu.h ;\
if [ $(OS_NAME) = windows ]; then \
7z a -tzip dist/$$ARCHIVE ./target/$$RELEASE/$(LIB_NAME).$(LIB_EXTENSION) ./target/$$RELEASE/$(LIB_NAME).$(LIB_EXTENSION).lib ./ffi/*.h ./ffi/webgpu-headers/*.h ./dist/commit-sha; \
7z a -tzip dist/$$ARCHIVE ./target/$$RELEASE/$(LIB_NAME).$(LIB_EXTENSION) ./target/$$RELEASE/$(LIB_NAME).$(LIB_EXTENSION).lib ./ffi/webgpu-headers/*.h ./wgpu.h ./dist/commit-sha; \
else \
zip -j dist/$$ARCHIVE target/$$RELEASE/lib$(LIB_NAME).$(LIB_EXTENSION) ffi/*.h ./ffi/webgpu-headers/*.h dist/commit-sha; \
zip -j dist/$$ARCHIVE target/$$RELEASE/lib$(LIB_NAME).$(LIB_EXTENSION) ./ffi/webgpu-headers/*.h ./wgpu.h ./dist/commit-sha; \
fi; \
sed -i 's/webgpu\.h/webgpu-headers\/webgpu.h/' ffi/wgpu.h
rm wgpu.h ;\
done

clean:
Expand Down

0 comments on commit 66a4139

Please sign in to comment.