Мой код meson.build:
.
Код: Выделить всё
project('meson_test', 'cpp',
version : '1.0.0',
default_options : ['warning_level=3', 'cpp_std=c++17'])
pkg_config_path = 'C:\Program Files\pkg-config'
sfml_dep = dependency('sfml', 'pkg-config')
imgui_dep = dependency('imgui-sfml')
pkg = import('pkgconfig')
lib = library('sfml', dependencies : [sfml])
pkg.generate(lib)
executable('meson_test', 'main.cpp',
install : true,
win_subsystem : 'windows',
dependencies : [sfml_dep, imgui_dep])
Код: Выделить всё
The Meson build system
Version: 1.6.1
Source dir: C:\Users\username\CLionProjects\meson_test
Build dir: C:\Users\username\CLionProjects\meson_test\buildDir
Build type: native build
Project name: meson_test
Project version: 1.0.0
C++ compiler for the host machine: c++ (gcc 6.3.0 "c++ (MinGW.org GCC-6.3.0-1) 6.3.0")
C++ linker for the host machine: c++ ld.bfd 2.28
Host machine cpu family: x86
Host machine cpu: x86
Did not find pkg-config by name 'pkg-config'
Found pkg-config: NO
Found CMake: C:\Program Files\CMake\bin\cmake.EXE (3.30.0)
Run-time dependency sfml found: NO (tried pkgconfig and cmake)
Run-time dependency pkg-config found: NO (tried pkgconfig and cmake)
Looking for a fallback subproject for the dependency sfml
Executing subproject sfml
sfml| Project name: sfml
sfml| Project version: 2.6.2
sfml| C++ compiler for the host machine: c++ (gcc 6.3.0 "c++ (MinGW.org GCC-6.3.0-1) 6.3.0")
sfml| C++ linker for the host machine: c++ ld.bfd 2.28
sfml| Run-time dependency openal found: NO (tried cmake)
subprojects\SFML-2.6.2\meson.build:14:13: ERROR: Dependency lookup for openal with method 'pkgconfig' failed: Pkg-config for machine host machine not found. Giving up.
Я пробовал различные способы загрузив pkg-config на свой компьютер с Windows, я добавил pkg-config в PATH и даже создал специальную переменную env под названием «pkg-config», которая ссылается на нее, и я все еще не могу заставить Meson ее найти. Я не могу найти никаких решений этой проблемы или кого-либо еще с этой конкретной проблемой. Честно говоря, учитывая простое переключение на CMAKE на этом этапе, выяснение этого в Meson, похоже, не стоит заморачиваться, поскольку у меня нет таких же проблем при использовании SFML с CMAKE. Я хочу попытаться заставить это работать в Meson, поэтому, если у кого-то есть какие-либо идеи, я был бы очень признателен за помощь.
Также попробовал это альтернативное решение:
Код: Выделить всё
project('meson_test', 'cpp',
version : '1.0.0',
default_options : ['warning_level=3', 'cpp_std=c++17'])
cpp = meson.get_compiler('cpp')
sfml_lib = cpp.find_library('sfml')
pkg_config_path = 'C:\Program Files\pkg-config'
sfml_dep = dependency('sfml', 'pkg-config')
imgui_dep = dependency('imgui-sfml')
pkg = import('pkgconfig')
lib = library('sfml', dependencies : [sfml])
pkg.generate(lib)
executable('meson_test', 'main.cpp',
install : true,
win_subsystem : 'windows',
link_with: sfml_lib,
include_directories : 'C:\Program Files',
dependencies : [sfml_dep, imgui_dep])
Код: Выделить всё
The Meson build system
Version: 1.6.1
Source dir: C:\Users\username\CLionProjects\meson_test
Build dir: C:\Users\username\CLionProjects\meson_test\buildDir
Build type: native build
Project name: meson_test
Project version: 1.0.0
C++ compiler for the host machine: c++ (gcc 6.3.0 "c++ (MinGW.org GCC-6.3.0-1) 6.3.0")
C++ linker for the host machine: c++ ld.bfd 2.28
Host machine cpu family: x86
Host machine cpu: x86
meson.build:6:15: ERROR: C++ prefer_static library 'sfml' not found
Подробнее здесь: https://stackoverflow.com/questions/793 ... to-use-the
Мобильная версия