Misleading OpenMP warning on MacOS when building with Meson

### Describe the bug

Compiling on MacOS with openmp works the old way, see https://scikit-learn.org/dev/developers/advanced_installation.html#macos:
- `brew install libomp`
- ```
  export CC=/usr/bin/clang
  export CXX=/usr/bin/clang++
  export CPPFLAGS="$CPPFLAGS -Xpreprocessor -fopenmp"
  export CFLAGS="$CFLAGS -I/usr/local/opt/libomp/include"
  export CXXFLAGS="$CXXFLAGS -I/usr/local/opt/libomp/include"
  export LDFLAGS="$LDFLAGS -Wl,-rpath,/usr/local/opt/libomp/lib -L/usr/local/opt/libomp/lib -lomp"
  ```
- Build `make in`

With the new meson build system, a warning is raised and scikit-learn is built without openmp:
- same as above, just the last commant is `make dev-meson` instead of `make in`.

### Steps/Code to Reproduce

```
% make dev-meson
```

### Expected Results

No warning and it compiles with openmp enabled.

### Actual Results

```
Run-time dependency OpenMP for c found: NO (tried system)
  ../../sklearn/meson.build:63: WARNING:
                  ***********
                  * WARNING *
                  ***********

  It seems that scikit-learn cannot be built with OpenMP.

  - Make sure you have followed the installation instructions:

      https://scikit-learn.org/dev/developers/advanced_installation.html

  - If your compiler supports OpenMP but you still see this
    message, please submit a bug report at:

      https://github.com/scikit-learn/scikit-learn/issues

  - The build will continue with OpenMP-based parallelism
    disabled. Note however that some estimators will run in
    sequential mode instead of leveraging thread-based
    parallelism.

                      ***
```

### Versions

```shell
System:
    python: 3.11.7 (main, Dec  4 2023, 18:10:11) [Clang 15.0.0 (clang-1500.1.0.2.5)]
executable: /Users/lorentzen/github/python3_sklearn/bin/python
   machine: macOS-14.4-x86_64-i386-64bit

Python dependencies:
      sklearn: 1.5.dev0
          pip: 24.0
   setuptools: 68.0.0
        numpy: 1.26.0
        scipy: 1.11.3
       Cython: 3.0.9
       pandas: 2.1.1
   matplotlib: 3.8.0
       joblib: 1.3.2
threadpoolctl: 3.2.0

Built with OpenMP: True

threadpoolctl info:
       user_api: openmp
   internal_api: openmp
    num_threads: 8
         prefix: libomp
       filepath: /usr/local/Cellar/libomp/17.0.6/lib/libomp.dylib
        version: None

       user_api: blas
   internal_api: openblas
    num_threads: 4
         prefix: libopenblas
       filepath: /Users/lorentzen/github/python3_sklearn/lib/python3.11/site-packages/numpy/.dylibs/libopenblas64_.0.dylib
        version: 0.3.23.dev
threading_layer: pthreads
   architecture: Haswell

       user_api: blas
   internal_api: openblas
    num_threads: 4
         prefix: libopenblas
       filepath: /Users/lorentzen/github/python3_sklearn/lib/python3.11/site-packages/scipy/.dylibs/libopenblas.0.dylib
        version: 0.3.21.dev
threading_layer: pthreads
   architecture: Haswell
```

COMMENT:
cc @eli-schwartz in case you have any advice on this: what is the recommended way to define an OpenMP dependency on macOS? The system clang does not support OpenMP but you can still compile with OpenMP, for example by doing `brew install libomp` and set environment variables like `CC` , `CFLAGS` and `LDFLAGS`.

https://github.com/mesonbuild/meson/issues/7435 seems to be related.

More details:
- this is how we currently define the OpenMP dependency in our `meson.build` file: https://github.com/scikit-learn/scikit-learn/blob/5033adf927c64d4f743ec98b98ffe0abf307d75d/sklearn/meson.build#L60-L87
- OpenMP is optional in scikit-learn, you can build without OpenMP but some scikit-learn algorithms will be slower
- we want a warning at the beginning of the build if OpenMP is not found, because this impacts peformance and is generally a sign that the build is not configured correctly. At the same time, we don't want a spurious warning saying that OpenMP is not found if in the end through settings the right combination of environment variables `CC`, `CFLAGS`, etc ... actually works.

I found this recent [PR in dipy](https://github.com/dipy/dipy/pull/3061) that has some logic that is brew-specific. So that would not help in the CI case as in https://github.com/scikit-learn/scikit-learn/issues/28710#issuecomment-2025191722.

I guess we could try to do as we were doing with setuptools, i.e. compile a test program, except that my understanding of https://mesonbuild.com/Reference-manual_returned_compiler.html is that by design you don't have access to environment variable inside `meson.build` like `CC`, `CFLAGS` etc (see https://github.com/mesonbuild/meson/issues/9 for more details) .... you can run a python script from meson.build that has access to environment variables but it seems a bit like going against the Meson flow.

Labels: Bug, Build / CI