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

add small github actions script for a windows build #1113

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions .github/workflows/windows_build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Native Windows CI

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

jobs:
build:
# https://github.com/actions/virtual-environments/blob/main/images/win/Windows2019-Readme.md
runs-on: windows-latest

steps:
- uses: actions/checkout@v2

- name: Install pkg-config through chocolatey
run: choco install pkgconfiglite

- name: Download & build eigen lib
env:
THIRD_PARTY: packaging\win32_3rdparty
run: |
$third_party_path = "$env:GITHUB_WORKSPACE\packaging\win32_3rdparty"
Invoke-WebRequest -OutFile eigen.zip https://gitlab.com/libeigen/eigen/-/archive/3.3.8/eigen-3.3.8.zip
Expand-Archive -LiteralPath eigen.zip -DestinationPath $env:THIRD_PARTY
Set-Location -Path $env:THIRD_PARTY\eigen*
New-Item -ItemType "directory" -Path .\build
sl build
cmake -DCMAKE_INSTALL_PREFIX="${third_party_path}\" -DEIGEN_BUILD_PKGCONFIG=ON -Wno-dev ..
cmake --install .
md "${third_party_path}\lib\pkgconfig\"
cp "${third_party_path}\share\pkgconfig\eigen3.pc" -Destination "${third_party_path}\lib\pkgconfig\"
dir "${third_party_path}\lib\pkgconfig\"

- name: Configure build
run: |
python -X utf8 waf configure
15 changes: 9 additions & 6 deletions wscript
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,8 @@ def configure(ctx):
# in gcc) instead of 387 floating point (used for 32-bit in gcc) to avoid
# numerical differences between 32/64-bit builds
# (see https://github.com/MTG/essentia/issues/179)
if (not ctx.options.EMSCRIPTEN and
not ctx.options.CROSS_COMPILE_ANDROID and
if (not ctx.options.EMSCRIPTEN and
not ctx.options.CROSS_COMPILE_ANDROID and
not ctx.options.CROSS_COMPILE_IOS and
not ctx.options.NO_MSSE and
sys.platform != 'win32' and
Expand Down Expand Up @@ -200,7 +200,10 @@ def configure(ctx):
ctx.env.LINKFLAGS += ['-pthread']

elif sys.platform == 'win32':
print ("Building on win32")
print ("→ Building on win32: search for pre-built dependencies in 'packaging/win32_3rdparty'")

os.environ["PKG_CONFIG_PATH"] = 'packaging/win32_3rdparty/lib/pkgconfig'
os.environ["PKG_CONFIG_LIBDIR"] = os.environ["PKG_CONFIG_PATH"]

"""
# compile libgcc and libstd statically when using MinGW
Expand All @@ -225,7 +228,7 @@ def configure(ctx):
# force the use of mingw gcc compiler instead of msvc
#ctx.env.CC = 'gcc'
#ctx.env.CXX = 'g++'

import distutils.dir_util

print("copying pkgconfig ...")
Expand Down Expand Up @@ -296,11 +299,11 @@ def configure(ctx):
if ctx.env.STATIC_DEPENDENCIES \
and (sys.platform.startswith('linux') or sys.platform == 'darwin') \
and not ctx.options.CROSS_COMPILE_MINGW32:

if not ctx.env.ONLY_PYTHON:
print ("→ Building with static dependencies on Linux/OSX")
os.environ["PKG_CONFIG_PATH"] = 'packaging/debian_3rdparty/lib/pkgconfig'

# flags required for linking to static ffmpeg libs
# -Bsymbolic flag is not available on clang
if ctx.env.CXX_NAME != "clang":
Expand Down