Skip to content

Commit cea2676

Browse files
hmeldertriplef
authored andcommitted
Add libcurl phase
1 parent 6284bed commit cea2676

File tree

3 files changed

+49
-2
lines changed

3 files changed

+49
-2
lines changed

README.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ This project comprises a collection of scripts to build a modern GNUstep toolcha
88

99
## Libraries
1010

11-
The toolchain currently consists of the following libraries:
11+
The toolchain consists of the following libraries:
1212

1313
- [GNUstep Base Library](https://github.com/gnustep/libs-base) (Foundation)
1414
- [GNUstep CoreBase Library](https://github.com/gnustep/libs-corebase) (CoreFoundation)
@@ -18,6 +18,7 @@ The toolchain currently consists of the following libraries:
1818
- [libiconv](https://github.com/kiyolee/libiconv-win-build)
1919
- [libxml2](https://github.com/GNOME/libxml2)
2020
- [libxslt](https://github.com/GNOME/libxslt)
21+
- [libcurl](https://github.com/curl/curl)
2122
- [ICU](https://docs.microsoft.com/en-us/windows/win32/intl/international-components-for-unicode--icu-) (using system-provided DLL on Windows 10 version 1903 or later)
2223

2324

phases/19-libcurl.bat

+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
@echo off
2+
setlocal
3+
4+
set PROJECT=libcurl
5+
set GITHUB_REPO=curl/curl
6+
7+
:: get the latest release tag from GitHub
8+
cd %~dp0
9+
for /f "usebackq delims=" %%i in (`call %BASH% '../scripts/get-latest-github-release-tag.sh %GITHUB_REPO% curl-'`) do (
10+
set TAG=%%i
11+
)
12+
13+
:: load environment and prepare project
14+
call "%~dp0\..\scripts\common.bat" prepare_project || exit /b 1
15+
16+
cd "%SRCROOT%\%PROJECT%" || exit \b 1
17+
18+
:: generate build config
19+
call "buildconf.bat" || exit \b 1
20+
21+
set BUILD_DIR="%SRCROOT%\%PROJECT%\build-%ARCH%-%BUILD_TYPE%"
22+
if exist "%BUILD_DIR%" (rmdir /S /Q "%BUILD_DIR%" || exit /b 1)
23+
mkdir "%BUILD_DIR%" || exit /b 1
24+
cd "%BUILD_DIR%" || exit /b 1
25+
26+
echo.
27+
echo ### Running cmake
28+
cmake .. %CMAKE_OPTIONS% ^
29+
-D BUILD_SHARED_LIBS=YES ^
30+
-D CURL_USE_SCHANNEL=YES ^
31+
-D BUILD_CURL_EXE=NO ^
32+
|| exit /b 1
33+
34+
echo.
35+
echo ### Building
36+
ninja || exit /b 1
37+
38+
echo.
39+
echo ### Installing
40+
ninja install || exit /b 1
41+
42+
:: install PDB file
43+
xcopy /Y /F lib\libcurl*.pdb "%INSTALL_PREFIX%\bin\" || exit /b 1
44+
45+
:: rename libcurl-d_imp.lib to curl.lib to allow linking using -lcurl
46+
move /y "%INSTALL_PREFIX%\lib\libcurl*.lib" "%INSTALL_PREFIX%\lib\curl.lib" || exit /b 1

scripts/common.bat

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ exit /b %errorlevel%
4949
echo.
5050
:: check out tag/branch if any
5151
if not "%TAG%" == "" (
52-
echo ### Checking out %TAG%
52+
echo ### Checking out "%TAG%"
5353
git fetch --tags || exit /b 1
5454
git checkout -q %TAG% || exit /b 1
5555
)

0 commit comments

Comments
 (0)