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

Failed to innclude as subproject using meson #72

Closed
jamabr opened this issue Dec 7, 2020 · 4 comments
Closed

Failed to innclude as subproject using meson #72

jamabr opened this issue Dec 7, 2020 · 4 comments
Assignees
Labels
bug Something isn't working

Comments

@jamabr
Copy link

jamabr commented Dec 7, 2020

Dear Mark,

thanks for your nice lib! After sucessfully testing the implementation I started to add it as a submodule in meson and I experienced the issue below. There is a tiny problem with the add_global_arguments call in the context of a subproject.

Environment

toml++ version and/or commit hash:

d95ff4c

Compiler:

g++

C++ standard mode (e.g. 17, 20, 'latest'):
17

Target arch (e.g. x64):
x64

Library configuration overrides:

Relevant compilation flags:

Describe the bug

When trying to include the current version as subproject in the meson bulid system, meson fails with:

ERROR: Function 'add_global_arguments' cannot be used in subprojects because there is no way to make that reliable.
Please only call this if is_subproject() returns false. Alternatively, define a variable that
contains your language-specific arguments and add it to the appropriate *_args kwarg in each target.

Steps to reproduce (or a small repro code sample)

Just inserted toml++ as a subproject in meson (0.54.2)

tomlpluspplus_proj = subproject('tomlplusplus')
tomlplusplus_dep = tomlpluspplus_proj.get_variable('tomlplusplus_dep')

Additional information

Meson suggested fix successfully works, but I am not sure about the consequences.

if compiler_supports_float128 and is_gcc
        if not is_subproject
               add_global_arguments('-fext-numeric-literals', language : 'cpp')
        endif
endif

Cheers,
Jan Martin

@jamabr jamabr added the bug Something isn't working label Dec 7, 2020
@marzer
Copy link
Owner

marzer commented Dec 7, 2020

Ah, thanks for letting me know. To be honest I'm not sure if that part of the configuration is even necessary any longer; it was only ever meant to be used when compiling the tests. I'll try to refactor this out.

@jamabr
Copy link
Author

jamabr commented Dec 7, 2020

Thanks for the quick reply. Great.

@marzer marzer closed this as completed in 9ea4438 Dec 9, 2020
@marzer
Copy link
Owner

marzer commented Dec 9, 2020

Fixed in master. Thanks @jamabr!

@jamabr
Copy link
Author

jamabr commented Dec 9, 2020

Great, thanks for the quick action!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants