Skip to content

Commit

Permalink
Add libcurl phase
Browse files Browse the repository at this point in the history
  • Loading branch information
hmelder authored and triplef committed Feb 22, 2023
1 parent 6284bed commit 7bbca5a
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 2 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ This project comprises a collection of scripts to build a modern GNUstep toolcha

## Libraries

The toolchain currently consists of the following libraries:
The toolchain consists of the following libraries:

- [GNUstep Base Library](https://github.com/gnustep/libs-base) (Foundation)
- [GNUstep CoreBase Library](https://github.com/gnustep/libs-corebase) (CoreFoundation)
Expand All @@ -18,6 +18,7 @@ The toolchain currently consists of the following libraries:
- [libiconv](https://github.com/kiyolee/libiconv-win-build)
- [libxml2](https://github.com/GNOME/libxml2)
- [libxslt](https://github.com/GNOME/libxslt)
- [libcurl](https://github.com/curl/curl)
- [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)


Expand Down
46 changes: 46 additions & 0 deletions phases/19-libcurl.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
@echo off
setlocal

set PROJECT=libcurl
set GITHUB_REPO=curl/curl

:: get the latest release tag from GitHub
cd %~dp0
for /f "usebackq delims=" %%i in (`call %BASH% '../scripts/get-latest-github-release-tag.sh %GITHUB_REPO% curl-'`) do (
set TAG=%%i
)

:: load environment and prepare project
call "%~dp0\..\scripts\common.bat" prepare_project || exit /b 1

cd "%SRCROOT%\%PROJECT%" || exit \b 1

:: generate build config
call "buildconf.bat" || exit \b 1

set BUILD_DIR="%SRCROOT%\%PROJECT%\build-%ARCH%-%BUILD_TYPE%"
if exist "%BUILD_DIR%" (rmdir /S /Q "%BUILD_DIR%" || exit /b 1)
mkdir "%BUILD_DIR%" || exit /b 1
cd "%BUILD_DIR%" || exit /b 1

echo.
echo ### Running cmake
cmake .. %CMAKE_OPTIONS% ^
-D BUILD_SHARED_LIBS=YES ^
-D CURL_USE_SCHANNEL=YES ^
-D BUILD_CURL_EXE=NO ^
|| exit /b 1

echo.
echo ### Building
ninja || exit /b 1

echo.
echo ### Installing
ninja install || exit /b 1

:: install PDB file
xcopy /Y /F lib\libcurl*.pdb "%INSTALL_PREFIX%\bin\" || exit /b 1

:: rename libcurl-d_imp.lib to curl.lib to allow linking using -lcurl
move /y "%INSTALL_PREFIX%\lib\libcurl*.lib" "%INSTALL_PREFIX%\lib\curl.lib" || exit /b 1
2 changes: 1 addition & 1 deletion scripts/common.bat
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ exit /b %errorlevel%
echo.
:: check out tag/branch if any
if not "%TAG%" == "" (
echo ### Checking out %TAG%
echo ### Checking out "%TAG%"
git fetch --tags || exit /b 1
git checkout -q %TAG% || exit /b 1
)
Expand Down

0 comments on commit 7bbca5a

Please sign in to comment.