From f590e7181bd273f4cd692e7a0c635cc6348de179 Mon Sep 17 00:00:00 2001 From: Brendan O'Donoghue Date: Thu, 2 Jan 2025 17:18:00 +0000 Subject: [PATCH] add sdist_mode option --- .github/workflows/build.yml | 2 +- meson.build | 7 ++++--- meson.options | 2 ++ 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 95b32f5..742e6d7 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -155,7 +155,7 @@ jobs: submodules: true - name: Build sdist - run: pipx run build --sdist + run: pipx run build --sdist -Dsdist_mode=true - uses: actions/upload-artifact@v4 with: diff --git a/meson.build b/meson.build index 2fa6d2a..21e5722 100644 --- a/meson.build +++ b/meson.build @@ -43,9 +43,10 @@ else endif endif -# Since nothing above was required, we stop here if failed -if not blas_deps[0].found() - error('OpenBLAS or Netlib BLAS/CBLAS is required on all platforms except Windows, and was not found.') +# Since nothing above was required, we stop here if failed. +# When creating an sdist we are not compiling / linking, so don't need to fail. +if not blas_deps[0].found() and not get_option('sdist_mode'): + error('OpenBLAS or Netlib BLAS/CBLAS is required on all platforms, and was not found.') endif fs = import('fs') diff --git a/meson.options b/meson.options index ba840d4..79b5678 100644 --- a/meson.options +++ b/meson.options @@ -5,3 +5,5 @@ option('link_blas_statically', type: 'boolean', value: false, description: 'copy BLAS compiled object into SCS module(s)') option('link_mkl', type: 'boolean', value: false, description: 'link to mkl-rt library') +option('sdist_mode', type: 'boolean', value: false, + description: 'Set to true if building an sdist')