From 2bee323ef76036d6977f7b5375f13e7120e9dec0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20=C5=A0tancl?= Date: Thu, 2 Jan 2025 08:16:45 +0100 Subject: [PATCH] ci: try using clang on windows --- .github/workflows/extensions.yml | 4 ++++ extensions/Makefile | 11 ++++------- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/.github/workflows/extensions.yml b/.github/workflows/extensions.yml index 11109846..b40560f6 100644 --- a/.github/workflows/extensions.yml +++ b/.github/workflows/extensions.yml @@ -45,6 +45,10 @@ jobs: - name: Debug PATH if: runner.os == 'Windows' run: | + where gcc + gcc --version + where clang + clang --versino & "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat" echo $env:PATH where cl diff --git a/extensions/Makefile b/extensions/Makefile index b4995917..1290cd1e 100644 --- a/extensions/Makefile +++ b/extensions/Makefile @@ -1,11 +1,12 @@ .PHONY: all headers -OUTPUT := - ifeq ($(OS),Windows_NT) OUTPUT = lib/noattach.dll + CCFLAGS = -shared + CC = clang else UNAME := $(shell uname) + CCFLAGS = -fPIC -Os -shared ifeq ($(UNAME),Darwin) ifeq ($(shell uname -m),arm64) OUTPUT = lib/arm/noattach.dylib @@ -32,9 +33,5 @@ headers: cp sqlite-amalgamation-3470200/*.h . $(OUTPUT): noattach.c -ifeq ($(OS),Windows_NT) - cl /LD /Fe:$(OUTPUT) $< -else # We don't link against libsqlite3 since PHP statically links its own libsqlite3. - $(CC) -fPIC -Os -shared -o $@ $< -endif + $(CC) $(CCFLAGS) -o $@ $<