Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix meson build_type #4489

Merged
merged 2 commits into from
Feb 11, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion conans/client/build/meson.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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")
Expand All @@ -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:
Expand Down
11 changes: 8 additions & 3 deletions conans/test/unittests/client/build/meson_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'
}

Expand Down Expand Up @@ -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' \
Expand Down