catchorg / catchorg/Catch2

Unable to compile Catch2 using meson

Open
#2,697 1 comment 0 reactions 0 assignees View on GitHub
Building and Packaging Help wanted
Dominant language
C++
Stars
21.5k
Forks
3.5k
Avg merge
3d 16h
Merged PRs (30d)
2

Description

Now that Catch2 has its own Meson.build file for integration, I am filing this here too, this bug might lie with meson (see: [Here](https://github.com/mesonbuild/meson/issues/11304?ts=4) for a similar issue ) but i have only been able to reproduce it with Catch2.

**Describe the bug**
When attempting to compile a project using meson, consuming clang as a dependency via the subproject or wrapper functionality of meson, it gives the following compiler error:
![image](https://github.com/catchorg/Catch2/assets/47298483/d2c3744f-fff1-4b51-abc1-e1fd6e71bc9d)
Somehow, the paths for Catch2's libraries seem to contain mixed slashes and do not get resolved correctly.

**Expected behaviour**
Catch2 has the correct paths and compiles like expected.

**Reproduction steps**
catch2.wrap:
```
[wrap-git]
url = https://github.com/catchorg/Catch2.git
revision = devel
depth = 1

[provide]
catch2 = catch2_dep
catch2-with-main = catch2_with_main_dep
```

Meson.build:
```
project('testcatch2', 'cpp')
catch2_dep = dependency('catch2-with-main', version: '>=3')
```

repro.bat:
```
set CXX=clang++
meson setup build
meson compile -C build
```

**Platform information:**

- Windows 10, 21H2 10.0.19044
- Clang++ version 15.0.1
- Python version 3.9.13
- Meson version 0.62.1
- Ninja version 1.10.2
- Catch version: Devel commit 0631b607ee2bbc07c7c238f0b15b23ef21926960

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.