diff --git a/conans/client/build/meson.py b/conans/client/build/meson.py index 1e458690d3c..b8f3d269926 100644 --- a/conans/client/build/meson.py +++ b/conans/client/build/meson.py @@ -4,6 +4,7 @@ from conans.client import defs_to_string, join_arguments, tools from conans.client.tools.oss import args_to_string from conans.errors import ConanException +from conans.model.build_info import DEFAULT_BIN, DEFAULT_INCLUDE, DEFAULT_LIB, DEFAULT_SHARE from conans.model.version import Version from conans.util.files import decode_text, get_abs_path, mkdir @@ -30,6 +31,11 @@ def __init__(self, conanfile, backend=None, build_type=None): self.options = dict() if self._conanfile.package_folder: self.options['prefix'] = self._conanfile.package_folder + self.options['libdir'] = DEFAULT_LIB + self.options['bindir'] = DEFAULT_BIN + self.options['sbindir'] = DEFAULT_BIN + self.options['libexecdir'] = DEFAULT_BIN + self.options['includedir'] = DEFAULT_INCLUDE # C++ standard cppstd = self._ss("cppstd") @@ -45,7 +51,7 @@ def __init__(self, conanfile, backend=None, build_type=None): # shared shared = self._so("shared") - self.options['default-library'] = "shared" if shared is None or shared else "static" + self.options['default_library'] = "shared" if shared is None or shared else "static" # fpic if self._os and "Windows" not in self._os: diff --git a/conans/test/unittests/client/build/meson_test.py b/conans/test/unittests/client/build/meson_test.py index 53eccd7bc38..dde5db6b731 100644 --- a/conans/test/unittests/client/build/meson_test.py +++ b/conans/test/unittests/client/build/meson_test.py @@ -58,8 +58,13 @@ def folders_test(self): meson = Meson(conan_file) defs = { - 'default-library': 'shared', + 'default_library': 'shared', 'prefix': package_folder, + 'libdir': 'lib', + 'bindir': 'bin', + 'sbindir': 'bin', + 'libexecdir': 'bin', + 'includedir': 'include', 'cpp_std': 'none' } @@ -119,9 +124,9 @@ def folders_test(self): self._check_commands(cmd_expected, conan_file.command) args = ['--werror', '--warnlevel 3'] - defs['default-library'] = 'static' + defs['default_library'] = 'static' meson.configure(source_folder="source", build_folder="build", args=args, - defs={'default-library': 'static'}) + defs={'default_library': 'static'}) build_expected = os.path.join(self.tempdir, "my_cache_build_folder", "build") source_expected = os.path.join(self.tempdir, "my_cache_source_folder", "source") cmd_expected = 'meson "%s" "%s" --backend=ninja %s %s --buildtype=release' \