Skip to content

Commit ba72068

Browse files
fix sed
1 parent 21636e4 commit ba72068

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

Makefile

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,7 @@ else
194194
endif
195195

196196

197+
197198
# This hacks away a:
198199
# ```C
199200
# #define COMPILE_SQLITE_EXTENSIONS_AS_LOADABLE_MODULE=1
@@ -203,13 +204,18 @@ endif
203204
# ```C
204205
# #include "sqlite3ext.h"
205206
# ```
206-
# This results in undefined symbols during runtime when compiling the WASM with MAIN_MODULE=2.
207+
# This results in undefined symbols during runtime when `-DSQLITE_OMIT_LOAD_EXTENSION` is not used.
208+
ifeq ($(shell uname), Darwin)
209+
SED_INPLACE := sed -i ''
210+
else
211+
SED_INPLACE := sed -i
212+
endif
207213
deps/$(EXTENSION_FUNCTIONS): cache/$(EXTENSION_FUNCTIONS)
208214
mkdir -p deps
209215
bash -c "$(OPENSSL_CHECK_CMD)"
210216
bash -c "$(HASH_CHECK_CMD)"
211217
rm -rf deps/sha3 $@
212-
sed -i '' "/#define COMPILE_SQLITE_EXTENSIONS_AS_LOADABLE_MODULE/d" cache/$(EXTENSION_FUNCTIONS)
218+
$(SED_INPLACE) "/#define COMPILE_SQLITE_EXTENSIONS_AS_LOADABLE_MODULE/d" cache/$(EXTENSION_FUNCTIONS)
213219
cp cache/$(EXTENSION_FUNCTIONS) $@
214220

215221
## tmp

0 commit comments

Comments
 (0)