From 3eeb59c7303ac7829d5ff814afb4b807e5e1bfdb Mon Sep 17 00:00:00 2001 From: Bomme <13520622+Bomme@users.noreply.github.com> Date: Wed, 24 Feb 2021 09:35:54 +0100 Subject: [PATCH 1/2] add small github actions script for a windows build This is a short working example that only builds eigen lib and configures the windows build --- .github/workflows/windows_build.yml | 41 +++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 .github/workflows/windows_build.yml diff --git a/.github/workflows/windows_build.yml b/.github/workflows/windows_build.yml new file mode 100644 index 000000000..500d12976 --- /dev/null +++ b/.github/workflows/windows_build.yml @@ -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 From 7e5d862313b7fed8cf60871a1317d14ca4513e99 Mon Sep 17 00:00:00 2001 From: Bomme <13520622+Bomme@users.noreply.github.com> Date: Wed, 24 Feb 2021 09:52:04 +0100 Subject: [PATCH 2/2] set PKG_CONFIG_PATH in wscript for windows build --- wscript | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/wscript b/wscript index 6613d45fd..44272de1d 100644 --- a/wscript +++ b/wscript @@ -129,8 +129,8 @@ def configure(ctx): # force using SSE floating point (default for 64bit in gcc) instead of # 387 floating point (used for 32bit in gcc) to avoid numerical differences # between 32 and 64bit 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'): @@ -196,7 +196,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 @@ -221,7 +224,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 ...") @@ -292,11 +295,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":