catchorg/Catch2

Unable to compile Catch2 using meson

Open

#2697 aperta il 1 giu 2023

Vedi su GitHub
 (1 commento) (0 reazioni) (0 assegnatari)C++ (3228 fork)batch import
Building and PackagingHelp wanted

Metriche repository

Star
 (20.381 star)
Metriche merge PR
 (Merge medio 4g 16h) (2 PR mergiate in 30 g)

Descrizione

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 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 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

Guida contributor