catchorg/Catch2

Unable to compile Catch2 using meson

Open

#2,697 opened on 2023年6月1日

GitHub で見る
 (1 comment) (0 reactions) (0 assignees)C++ (3,228 forks)batch import
Building and PackagingHelp wanted

Repository metrics

Stars
 (20,381 stars)
PR merge metrics
 (平均マージ 4d 16h) (30d で 2 merged PRs)

説明

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

コントリビューターガイド