From 0452dfb0aa84f24a1cbbf356840cd5256d10da7b Mon Sep 17 00:00:00 2001 From: Gioele Cantoni Date: Wed, 6 Aug 2025 11:28:25 +0200 Subject: [PATCH 1/4] Update Makefile: adjust linker flags for Linux and test target --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 0f85c20..056ec10 100644 --- a/Makefile +++ b/Makefile @@ -64,7 +64,7 @@ else ifeq ($(PLATFORM),isim) CFLAGS += -arch x86_64 -arch arm64 $(SDK) else # linux TARGET := $(DIST_DIR)/js.so - LDFLAGS := -shared + LDFLAGS := -lm -shared endif # Object files @@ -131,7 +131,7 @@ endif # Compile test target $(TEST_TARGET): $(TEST_FILES) $(TARGET) - $(CC) $(INCLUDES) $^ -lm -o $@ libs/sqlite3.c -DSQLITE_CORE + $(CC) $(INCLUDES) $^ -o $@ libs/sqlite3.c -DSQLITE_CORE # Testing the extension test: $(TARGET) $(TEST_TARGET) From 57429542ca1d1e5ffecb7954249cabde4d639ac5 Mon Sep 17 00:00:00 2001 From: Gioele Cantoni Date: Wed, 6 Aug 2025 11:30:58 +0200 Subject: [PATCH 2/4] fix(workflow): always run it but release only in the main branch --- .github/workflows/release.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 5bb8a82..a477230 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,8 +1,6 @@ name: release sqlite-js on: push: - branches: - - main permissions: contents: write @@ -121,6 +119,7 @@ jobs: runs-on: ubuntu-latest name: release needs: build + if: github.ref == 'refs/heads/main' env: GH_TOKEN: ${{ github.token }} From 1f4a36303d709027205cb4d347dcc25a116bb438 Mon Sep 17 00:00:00 2001 From: Gioele Cantoni Date: Wed, 6 Aug 2025 11:35:49 +0200 Subject: [PATCH 3/4] fix(Makefile): add math library flag to test target compilation --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 056ec10..6486a6b 100644 --- a/Makefile +++ b/Makefile @@ -131,7 +131,7 @@ endif # Compile test target $(TEST_TARGET): $(TEST_FILES) $(TARGET) - $(CC) $(INCLUDES) $^ -o $@ libs/sqlite3.c -DSQLITE_CORE + $(CC) $(INCLUDES) $^ -lm -o $@ libs/sqlite3.c -DSQLITE_CORE # Testing the extension test: $(TARGET) $(TEST_TARGET) From fac7677062774ce48039697171580708f30ebb57 Mon Sep 17 00:00:00 2001 From: Gioele Cantoni Date: Wed, 6 Aug 2025 12:12:19 +0200 Subject: [PATCH 4/4] fix(Makefile): correct order of arguments in linking and test target compilation --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 6486a6b..018a298 100644 --- a/Makefile +++ b/Makefile @@ -78,7 +78,7 @@ all: $(TARGET) # Link the final target $(TARGET): $(OBJ_FILES) $(DEF_FILE) - $(CC) $(LDFLAGS) -o $@ $^ + $(CC) -o $@ $^ $(LDFLAGS) ifeq ($(PLATFORM),windows) # Generate import library for Windows dlltool -D $@ -d $(DEF_FILE) -l $(DIST_DIR)/js.lib @@ -131,7 +131,7 @@ endif # Compile test target $(TEST_TARGET): $(TEST_FILES) $(TARGET) - $(CC) $(INCLUDES) $^ -lm -o $@ libs/sqlite3.c -DSQLITE_CORE + $(CC) $(INCLUDES) $^ -o $@ libs/sqlite3.c -DSQLITE_CORE # Testing the extension test: $(TARGET) $(TEST_TARGET)