Skip to content

Commit 3a69d87

Browse files
committed
build: Implement building multithreaded for windows.
1 parent 04d273f commit 3a69d87

File tree

5 files changed

+12
-9
lines changed

5 files changed

+12
-9
lines changed

.github/workflows/release.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,17 +97,17 @@ jobs:
9797
sudo docker run --rm dockcross/windows-x64 > dockcross-windows-x64
9898
cat dockcross-windows-x64
9999
chmod +x dockcross-windows-x64
100-
wget https://curl.haxx.se/download/curl-7.69.1.tar.gz
100+
wget https://curl.haxx.se/download/curl-7.80.0.tar.gz
101101
tar xzf curl-*
102102
CURL_SRC=curl-*
103-
./dockcross-windows-x64 bash -c 'cd '"$CURL_SRC"' && ./configure --prefix="/work/deps/curl" --host=x86_64-w64-mingw32.static --with-winssl --disable-dependency-tracking --disable-pthreads --disable-pthreads --enable-threaded-resolver'
103+
./dockcross-windows-x64 bash -c 'cd '"$CURL_SRC"' && ./configure --prefix="/work/deps/curl" --host=x86_64-w64-mingw32.static --with-schannel --disable-dependency-tracking --enable-threaded-resolver --disable-imap --disable-pop3 --disable-smtp --disable-ldap --disable-mqtt --disable-smb'
104104
./dockcross-windows-x64 bash -c 'cd '"$CURL_SRC"' && make'
105105
./dockcross-windows-x64 bash -c 'cd '"$CURL_SRC"' && make install'
106106
107107
- name: Build Release
108108
run: |
109109
mkdir -p build/bin
110-
./dockcross-windows-x64 make install NO_PTHREADS=1 STATIC=true EXE=true PREFIX=build
110+
./dockcross-windows-x64 make install STATIC=true EXE=true PREFIX=build
111111
112112
- uses: actions/upload-artifact@v1
113113
with:

.github/workflows/tests.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,13 @@ jobs:
4343
sudo docker run --rm dockcross/windows-x64 > dockcross-windows-x64
4444
cat dockcross-windows-x64
4545
chmod +x dockcross-windows-x64
46-
wget https://curl.haxx.se/download/curl-7.69.1.tar.gz
46+
wget https://curl.haxx.se/download/curl-7.80.0.tar.gz
4747
tar xzf curl-*
4848
CURL_SRC=curl-*
49-
./dockcross-windows-x64 bash -c 'cd '"$CURL_SRC"' && ./configure --prefix="/work/deps/curl" --host=x86_64-w64-mingw32.static --with-winssl --disable-dependency-tracking --disable-pthreads --disable-pthreads --enable-threaded-resolver'
49+
./dockcross-windows-x64 bash -c 'cd '"$CURL_SRC"' && ./configure --prefix="/work/deps/curl" --host=x86_64-w64-mingw32.static --with-schannel --disable-dependency-tracking --enable-threaded-resolver --disable-imap --disable-pop3 --disable-smtp --disable-ldap --disable-mqtt --disable-smb'
5050
./dockcross-windows-x64 bash -c 'cd '"$CURL_SRC"' && make'
5151
./dockcross-windows-x64 bash -c 'cd '"$CURL_SRC"' && make install'
5252
- name: Run Tests
5353
run: |
5454
## if builds pass then its passing for now
55-
./dockcross-windows-x64 make all NO_PTHREADS=1 STATIC=true EXE=true
55+
./dockcross-windows-x64 make all STATIC=true EXE=true

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
clib
33
clib-install
44
clib-search
5+
*.exe
56
*.o
67
*.d
78
tmp/

Makefile

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,13 @@ MAKEFILES = $(wildcard deps/*/Makefile)
2222

2323
export CC
2424

25+
CFLAGS += -std=c99 -Ideps -Wall -Wno-unused-function -U__STRICT_ANSI__
26+
2527
ifdef STATIC
26-
CFLAGS += -DCURL_STATICLIB -std=c99 -Ideps -Wall -Wno-unused-function -U__STRICT_ANSI__ $(shell deps/curl/bin/curl-config --cflags)
28+
CFLAGS += -DCURL_STATICLIB $(shell deps/curl/bin/curl-config --cflags)
2729
LDFLAGS += -static $(shell deps/curl/bin/curl-config --static-libs)
2830
else
29-
CFLAGS += -std=c99 -Ideps -Wall -Wno-unused-function -U__STRICT_ANSI__ $(shell curl-config --cflags)
31+
CFLAGS += $(shell curl-config --cflags)
3032
LDFLAGS += $(shell curl-config --libs)
3133
endif
3234

scripts/feature-test-pthreads

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@
44
echo '#include <pthread.h>' &&
55
echo 'void *f(void *a) { return 0; }' &&
66
echo 'int main(void) { pthread_t t; return pthread_create(&t, 0, f, 0); }';
7-
} | ${CC:-cc} -o /dev/null -xc -pthread - 2>/dev/null
7+
} | ${CC:-cc} -o pthread_test -xc -pthread - 2>/dev/null && rm pthread_test
88
exit $?

0 commit comments

Comments
 (0)