Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compile Windows CI with dependencies build by kiwix-build #845

Closed
wants to merge 10 commits into from
47 changes: 35 additions & 12 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,11 @@ jobs:
- name: Install python modules
run: pip3 install meson pytest

- name: Install deps
shell: bash
run: |
ARCHIVE_NAME=deps2_macos_${{matrix.target}}_libzim.tar.xz
wget -O- http://tmp.kiwix.org/ci/${ARCHIVE_NAME} | tar -xJ -C $HOME
- name: Install dependences
uses: kiwix/kiwix-build/actions/dl_deps_archive@download_deps_action
with:
os_name: macos
target_platform: ${{ matrix.target }}

- name: Compile
shell: bash
Expand Down Expand Up @@ -69,7 +69,7 @@ jobs:
WAIT_TIME_FACTOR_TEST: 10

Windows:
runs-on: windows-2019
runs-on: windows-latest

steps:
- name: Checkout code
Expand All @@ -82,14 +82,37 @@ jobs:

- name: Install packages
run:
choco install ninja
choco install ninja pkgconfiglite

- name: Install python modules
run: pip3 install meson

- name: Setup MSVC compiler
uses: bus1/cabuild/action/msdevshell@v1
with:
architecture: x64

- name: Install dependences
uses: kiwix/kiwix-build/actions/dl_deps_archive@download_deps_action
with:
os_name: windows
target_platform: native_mixed

- name: debgu
run: |
dir ${{ github.workspace }}\BUILD_native_static\INSTALL\lib\pkgconfig

- name: Compile
shell: cmd
run: .github\script\build_libzim.cmd
env:
PKG_CONFIG_PATH: ${{ github.workspace }}\BUILD_native_mixed\INSTALL\lib\pkgconfig;${{ github.workspace }}\BUILD_native_static\INSTALL\lib\pkgconfig
CC: cl.exe
CXX: cl.exe
run: |
mkdir build
cd build
meson.exe setup . .. -Ddefault_library=static
type meson-logs/meson-log.txt
meson.exe compile --verbose

- name: Test
shell: cmd
Expand Down Expand Up @@ -154,9 +177,9 @@ jobs:
steps:
- name: Install dependences
if: false == startsWith(matrix.target, 'alpine_')
run: |
ARCHIVE_NAME=deps2_${OS_NAME}_${{matrix.target}}_libzim.tar.xz
wget -O- http://tmp.kiwix.org/ci/${ARCHIVE_NAME} | tar -xJ -C ${{env.HOME}}
uses: kiwix/kiwix-build/actions/dl_deps_archive@download_deps_action
with:
target_platform: ${{ matrix.target }}

- name: Retrieve source code
uses: actions/checkout@v3
Expand Down
8 changes: 5 additions & 3 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,9 @@ static_linkage = static_linkage or get_option('default_library')=='static'
lzma_dep = dependency('liblzma', static:static_linkage)
if static_linkage
add_project_arguments('-DLZMA_API_STATIC', language: 'cpp')
else
endif

if get_option('default_library') != 'static'
public_conf.set('LIBZIM_EXPORT_DLL', true)
endif

Expand All @@ -57,8 +59,8 @@ public_conf.set('LIBZIM_WITH_XAPIAN', xapian_dep.found())

pkg_requires = ['liblzma', 'libzstd']
if build_machine.system() == 'windows'
extra_link_args = ['-lRpcrt4', '-lWs2_32', '-lwinmm', '-licuuc', '-licuin']
extra_cpp_args = ['-DSORTPP_PASS']
extra_link_args = ['-lRpcrt4', '-lWs2_32', '-lwinmm', '-licuuc', '-licuin', '-LD:\\a\\libzim\\libzim\\BUILD_native_static\\INSTALL\\lib']
extra_cpp_args = ['-DSORTPP_PASS', '-ID:\\a\\libzim\\libzim\\BUILD_native_static\\INSTALL\\include']
else
extra_link_args = []
extra_cpp_args = []
Expand Down
Loading