Skip to content

Commit

Permalink
Add Windows amd64 support
Browse files Browse the repository at this point in the history
  • Loading branch information
marcboeker committed Dec 23, 2023
1 parent 0e038fa commit c9f516c
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 1 deletion.
21 changes: 20 additions & 1 deletion .github/workflows/deps.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,23 @@ jobs:
name: linux_arm64
path: deps/linux_arm64/libduckdb.a
retention-days: 1
windows_amd64:
needs: prepare
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
with:
ref: ${{ github.head_ref }}
- shell: bash
run: make deps.windows.amd64
- uses: actions/upload-artifact@v3
with:
name: windows_amd64
path: deps/windows_amd64/libduckdb.a
retention-days: 1
commit:
runs-on: ubuntu-latest
needs: [darwin_amd64, darwin_arm64, linux_amd64, linux_arm64]
needs: [darwin_amd64, darwin_arm64, linux_amd64, linux_arm64, windows_amd64]
steps:
- uses: actions/checkout@v3
with:
Expand All @@ -96,6 +110,7 @@ jobs:
rm -f deps/darwin_arm64/libduckdb.a
rm -f deps/linux_amd64/libduckdb.a
rm -f deps/linux_arm64/libduckdb.a
rm -f deps/windows_amd64/libduckdb.a
rm -f duckdb.h
- uses: actions/download-artifact@v3
with:
Expand All @@ -117,6 +132,10 @@ jobs:
with:
name: linux_arm64
path: deps/linux_arm64
- uses: actions/download-artifact@v3
with:
name: windows_amd64
path: deps/windows_amd64
- name: Push static libraries
uses: stefanzweifel/git-auto-commit-action@v4
with:
Expand Down
35 changes: 35 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -76,3 +76,38 @@ deps.linux.arm64:
ar rvs ../libduckdb.a *.o && \
cd .. && \
mv libduckdb.a ../deps/linux_arm64/libduckdb.a

.PHONY: deps.windows.amd64
deps.windows.amd64:
if [ "$(shell uname -s | tr '[:upper:]' '[:lower:]')" != "windows" ]; then echo "Error: must run build on Windows"; false; fi

git clone -b v${DUCKDB_VERSION} --depth 1 https://github.com/duckdb/duckdb.git
cd duckdb && \
mkdir -p build && \
cmake -G "MinGW Makefiles" \
-DENABLE_EXTENSION_AUTOLOADING=1 \
-DENABLE_EXTENSION_AUTOINSTALL=1 \
-DBUILD_EXTENSIONS=parquet \
-DDUCKDB_EXTENSION_CONFIGS="./.github/config/bundled_extensions.cmake" \
-DBUILD_SHELL=0 \
-DBUILD_BENCHMARK=0 \
-DBUILD_JDBC=0 \
-DBUILD_TPCH=0 \
-DBUILD_TPCDS=0 \
-DBUILD_ODBC=0 \
-DBUILD_PYTHON=0 \
-DDISABLE_UNITY=1 \
-DBUILD_AUTOCOMPLETE=1 \
-DBUILD_HTTPFS=1 \
-DBUILD_JSON=1 \
-DBUILD_INET=1 \
-DBUILD_FTS=1 \
-DCMAKE_BUILD_TYPE=Release -B build && \
cd build && \
MAKEFLAGS=-j2 cmake --build . --config Release && \
cd .. && \
mkdir -p lib && \
find ./build -name '*.obj' | xargs cp {} -t ./lib && \
cd lib && \
gcc-ar rvs libduckdb.a *.obj
mv libduckdb.a ../../deps/windows_amd64/libduckdb.a
3 changes: 3 additions & 0 deletions deps/windows_amd64/vendor.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// Package windows_amd64 is required to provide support for vendoring modules
// DO NOT REMOVE
package windows_amd64

0 comments on commit c9f516c

Please sign in to comment.