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

external-project: Add devenv support #13827

Merged
merged 2 commits into from
Oct 28, 2024
Merged

Conversation

xclaesse
Copy link
Member

No description provided.

@MaxandreOgeret
Copy link

MaxandreOgeret commented Oct 27, 2024

Solves the issue I had when dynamically linking against a library built in an "external-project":

subproject meson.build:

project('ctemplate', 'cpp',
        meson_version : '>=0.56.0',
)

mod = import('unstable-external_project')

run_command('sh', './autogen.sh', check : true)

p = mod.add_project('configure',
                    configure_options : ['--prefix=@PREFIX@',
                                         '--libdir=@PREFIX@/@LIBDIR@',
                    ],
)

lib_dir = join_paths(meson.current_build_dir(), 'lib')
ctemplate_dep = p.dependency('ctemplate')
meson.override_dependency('ctemplate', ctemplate_dep)

Main project meson.build:

project('CTemplateTest', 'cpp',
        version : '1.0.0',
        default_options : ['warning_level=3', 'cpp_std=c++20'])

ctemplate_proj = subproject('ctemplate')
ctemplate_dep = dependency('ctemplate')

CTemplateTest = executable('CTemplateTest', 'main.cpp',
                           dependencies : [ctemplate_dep],
                           install : true)

Copy link
Member

@dcbaker dcbaker left a comment

Choose a reason for hiding this comment

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

One teeny nit, otherwise this looks fine to me.

mesonbuild/environment.py Outdated Show resolved Hide resolved
@xclaesse xclaesse merged commit 1840bb0 into mesonbuild:master Oct 28, 2024
34 checks passed
@xclaesse xclaesse deleted the ep-devenv branch October 28, 2024 13:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants