Install a getopt library on Windows.

Yes, getopt is posix and is not present by default on Windows.
https://github.com/takamin/win-c seems a pretty functional getopt_long
implementation.
This commit is contained in:
Matthieu Gautier 2019-06-26 16:02:04 +02:00
parent e87c429555
commit b2ae9587e7
3 changed files with 17 additions and 1 deletions

View File

@ -52,6 +52,7 @@ build_script:
- IF "%USE_CACHE%" NEQ "1" appveyor\install_aria2.cmd
- IF "%USE_CACHE%" NEQ "1" appveyor\install_mustache.cmd
- IF "%USE_CACHE%" NEQ "1" appveyor\install_libmicrohttpd.cmd
- IF "%USE_CACHE%" NEQ "1" appveyor\install_getopt.cmd
- IF "%USE_CACHE%" NEQ "1" %MINGW64_RUN% "cd /c/projects/kiwix-build && appveyor/create_cache.sh"
- appveyor\install_libzim.cmd
- appveyor\install_kiwix-lib.cmd

View File

@ -0,0 +1,15 @@
REM ========================================================
REM Install getopt
curl -fsSL -O https://github.com/takamin/win-c/archive/v1.0.zip || exit /b 1
7z x v1.0.zip -o. || exit /b 1
cd win-c-1.0
mkdir build
cd build
cmake -G"NMake Makefiles" -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=%EXTRA_DIR% .. || exit /b 1
dir
nmake install || exit /b 1
copy ..\include\getopt.h %EXTRA_DIR%\include
cd ..\..
dir %EXTRA_DIR%\include
dir %EXTRA_DIR%\lib

View File

@ -3,7 +3,7 @@ REM Install kiwix-lib
git clone https://github.com/kiwix/kiwix-tools.git || exit /b 1
cd kiwix-tools
set "CPPFLAGS=-I%EXTRA_DIR%/include"
set "LDFLAGS=-lshlwapi -lwinmm"
set "LDFLAGS=-lshlwapi -lwinmm -llibwinc"
meson . build --prefix %EXTRA_DIR% -Dstatic-linkage=true --buildtype release || exit /b 1
cd build
ninja || exit /b 1