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_layout #10600

Merged
merged 1 commit into from Feb 16, 2022
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 4 additions & 0 deletions conan/tools/meson/layout.py
@@ -1,4 +1,8 @@
import os


def meson_layout(conanfile):
conanfile.folders.build = "build-{}".format(str(conanfile.settings.build_type).lower())
conanfile.folders.generators = os.path.join(conanfile.folders.build, "conan")
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing this was hiding in test the fact that shared libs doesn't work, because dll was in "lib" folder, not in "bin"

conanfile.cpp.build.bindirs = ["."]
conanfile.cpp.build.libdirs = ["."]
10 changes: 8 additions & 2 deletions conans/assets/templates/new_v2_meson.py
@@ -1,8 +1,9 @@
from conans.assets.templates.new_v2_cmake import source_cpp, source_h, test_main

conanfile_sources_v2 = """from conan import ConanFile
conanfile_sources_v2 = """import os
from conan import ConanFile
from conan.tools.meson import MesonToolchain, Meson, meson_layout

from conan.tools.files import copy

class {package_name}Conan(ConanFile):
name = "{name}"
Expand Down Expand Up @@ -35,6 +36,11 @@ def build(self):
def package(self):
meson = Meson(self)
meson.install()
# Meson cannot install dll/so in "bin" and .a/.lib in "lib"
lib = os.path.join(self.package_folder, "lib")
bin = os.path.join(self.package_folder, "bin")
copy(self, "*.so", lib, bin)
copy(self, "*.dll", lib, bin)

def package_info(self):
self.cpp_info.libs = ["{name}"]
Expand Down