Skip to content

Commit

Permalink
build: Implement building multithreaded for windows.
Browse files Browse the repository at this point in the history
  • Loading branch information
nouwaarom committed Dec 26, 2021
1 parent 04d273f commit 3a69d87
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 9 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,17 +97,17 @@ jobs:
sudo docker run --rm dockcross/windows-x64 > dockcross-windows-x64
cat dockcross-windows-x64
chmod +x dockcross-windows-x64
wget https://curl.haxx.se/download/curl-7.69.1.tar.gz
wget https://curl.haxx.se/download/curl-7.80.0.tar.gz
tar xzf curl-*
CURL_SRC=curl-*
./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'
./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'
./dockcross-windows-x64 bash -c 'cd '"$CURL_SRC"' && make'
./dockcross-windows-x64 bash -c 'cd '"$CURL_SRC"' && make install'
- name: Build Release
run: |
mkdir -p build/bin
./dockcross-windows-x64 make install NO_PTHREADS=1 STATIC=true EXE=true PREFIX=build
./dockcross-windows-x64 make install STATIC=true EXE=true PREFIX=build
- uses: actions/upload-artifact@v1
with:
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,13 @@ jobs:
sudo docker run --rm dockcross/windows-x64 > dockcross-windows-x64
cat dockcross-windows-x64
chmod +x dockcross-windows-x64
wget https://curl.haxx.se/download/curl-7.69.1.tar.gz
wget https://curl.haxx.se/download/curl-7.80.0.tar.gz
tar xzf curl-*
CURL_SRC=curl-*
./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'
./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'
./dockcross-windows-x64 bash -c 'cd '"$CURL_SRC"' && make'
./dockcross-windows-x64 bash -c 'cd '"$CURL_SRC"' && make install'
- name: Run Tests
run: |
## if builds pass then its passing for now
./dockcross-windows-x64 make all NO_PTHREADS=1 STATIC=true EXE=true
./dockcross-windows-x64 make all STATIC=true EXE=true
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
clib
clib-install
clib-search
*.exe
*.o
*.d
tmp/
Expand Down
6 changes: 4 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,13 @@ MAKEFILES = $(wildcard deps/*/Makefile)

export CC

CFLAGS += -std=c99 -Ideps -Wall -Wno-unused-function -U__STRICT_ANSI__

ifdef STATIC
CFLAGS += -DCURL_STATICLIB -std=c99 -Ideps -Wall -Wno-unused-function -U__STRICT_ANSI__ $(shell deps/curl/bin/curl-config --cflags)
CFLAGS += -DCURL_STATICLIB $(shell deps/curl/bin/curl-config --cflags)
LDFLAGS += -static $(shell deps/curl/bin/curl-config --static-libs)
else
CFLAGS += -std=c99 -Ideps -Wall -Wno-unused-function -U__STRICT_ANSI__ $(shell curl-config --cflags)
CFLAGS += $(shell curl-config --cflags)
LDFLAGS += $(shell curl-config --libs)
endif

Expand Down
2 changes: 1 addition & 1 deletion scripts/feature-test-pthreads
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@
echo '#include <pthread.h>' &&
echo 'void *f(void *a) { return 0; }' &&
echo 'int main(void) { pthread_t t; return pthread_create(&t, 0, f, 0); }';
} | ${CC:-cc} -o /dev/null -xc -pthread - 2>/dev/null
} | ${CC:-cc} -o pthread_test -xc -pthread - 2>/dev/null && rm pthread_test
exit $?

0 comments on commit 3a69d87

Please sign in to comment.