Skip to content

Commit

Permalink
Fix Mac OS binary
Browse files Browse the repository at this point in the history
  • Loading branch information
mindreframer committed Oct 14, 2021
1 parent 8a56bc7 commit 76e01a0
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 14 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ jobs:
name: sqlite-sources
path: src
- name: Compile sources
run: bin/compile-mac.sh
run: bin/compile-macos.sh
- name: Upload binaries to release
uses: svenstaro/upload-release-action@v2
with:
Expand Down
5 changes: 3 additions & 2 deletions bin/compile-linux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,9 @@ gcc \
-DSQLITE_INTROSPECTION_PRAGMAS=1 \
-DSQLITE_LIKE_DOESNT_MATCH_BLOBS=1 \
-DSQLITE_OMIT_DEPRECATED=1 \
-DSQLITE_THREADSAFE=1 \
-DSQLITE_THREADSAFE=0 \
-DSQLITE_USE_URI=1 \
src/shell.c src/sqlite3.c -o dist/sqlite3-ubuntu \
-ldl -lz -lm -lreadline -lncurses
chmod +x dist/sqlite3-ubuntu
chmod +x dist/sqlite3-ubuntu
ls -la dist/
7 changes: 4 additions & 3 deletions bin/compile-mac.sh → bin/compile-macos.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,9 @@ gcc \
-DSQLITE_INTROSPECTION_PRAGMAS=1 \
-DSQLITE_LIKE_DOESNT_MATCH_BLOBS=1 \
-DSQLITE_OMIT_DEPRECATED=1 \
-DSQLITE_THREADSAFE=1 \
-DSQLITE_THREADSAFE=0 \
-DSQLITE_USE_URI=1 \
src/shell.c src/sqlite3.c -o dist/sqlite3-mac \
src/shell.c src/sqlite3.c -o dist/sqlite3-macos \
-ldl -lz -lm -lreadline -lncurses
chmod +x dist/sqlite3-mac
chmod +x dist/sqlite3-macos
ls -la dist/
2 changes: 1 addition & 1 deletion bin/compile-windows.sh
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,6 @@ gcc \
-DSQLITE_INTROSPECTION_PRAGMAS=1 \
-DSQLITE_LIKE_DOESNT_MATCH_BLOBS=1 \
-DSQLITE_OMIT_DEPRECATED=1 \
-DSQLITE_THREADSAFE=1 \
-DSQLITE_THREADSAFE=0 \
-DSQLITE_USE_URI=1 \
-I. src/shell.c src/sqlite3.c -o dist/sqlite3.exe
14 changes: 7 additions & 7 deletions gen/genBins.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ const flags = [
class Generator extends GenBase {
run() {
this.genLinux();
this.genMac();
this.genMacos();
this.genWindows();
}

Expand Down Expand Up @@ -64,15 +64,15 @@ class Generator extends GenBase {
this.push("ls -la dist/");
}

genMac() {
let path = "bin/compile-mac.sh";
genMacos() {
let path = "bin/compile-macos.sh";
this.lines = [];
this.macContent();
this.macosContent();
fs.writeFileSync(path, this.content, "utf-8");
fs.chmodSync(path, 0o755);
}

macContent() {
macosContent() {
this.push("#!/usr/bin/env bash");
this.push("mkdir dist");
this.push("gcc \\");
Expand All @@ -81,11 +81,11 @@ class Generator extends GenBase {
this.push(`-${flag} \\`);
});

this.push("src/shell.c src/sqlite3.c -o dist/sqlite3-mac \\");
this.push("src/shell.c src/sqlite3.c -o dist/sqlite3-macos \\");
this.push("-ldl -lz -lm -lreadline -lncurses");
});

this.push(`chmod +x dist/sqlite3-mac`);
this.push(`chmod +x dist/sqlite3-macos`);
this.push("ls -la dist/");
}

Expand Down

0 comments on commit 76e01a0

Please sign in to comment.