-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaction.yml
52 lines (47 loc) · 1.79 KB
/
action.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
name: install-swig-windows-action
description: "Install SWIG from source under Windows github runners."
author: 'Fabien Ors'
inputs:
swig-root:
description: 'SWIG installation directory'
swig-repo:
description: 'SWIG git repository (must be called "swig")'
default: "https://github.com/fabien-ors/swig"
swig-tag:
description: 'SWIG tag on the repository (TODO)'
default: "4.2.0b"
bison-version:
description: 'Version for Bison library'
default: "3.7.4"
pcre2-version:
description: 'Version for PCRE2 library'
default: "10.39.0"
generator:
description: 'Generator used to compile SWIG'
default: "Visual Studio 16 2019"
runs:
using: "composite"
steps:
- name: Create a folder for compiling SWIG and installing dependencies
shell: powershell
run: |
mkdir swig_src
- name: Install SWIG dependencies
# See nuget.yml in SWIG github repo
shell: powershell
run: |
cd swig_src
nuget install Bison -Version ${{inputs.bison-version}} -OutputDirectory .\bison
nuget install PCRE2 -Version ${{inputs.pcre2-version}} -OutputDirectory .\pcre2
- name: Compile and install [customized] SWIG
shell: powershell
# TODO : Use swig-tag variable (not the master branch)
run: |
cd swig_src
git clone ${{inputs.swig-repo}}
cd swig
$env:PATH="..\bison\Bison.${{inputs.bison-version}}\bin;" + $env:PATH
$PCRE_PATH="..\pcre2\PCRE2.${{inputs.pcre2-version}}"
cmake -Bbuild -G "${{inputs.generator}}" -DCMAKE_INSTALL_PREFIX:PATH=${{inputs.swig-root}} -DCMAKE_C_FLAGS="/DPCRE2_STATIC" -DCMAKE_CXX_FLAGS="/DPCRE2_STATIC" -DPCRE2_INCLUDE_DIR="$PCRE_PATH/include" -DPCRE2_LIBRARY="$PCRE_PATH/lib/pcre2-8-static.lib"
cmake --build build --config Release
cmake --install build --config Release