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

[bug] MesonToolchain ignores tools.build:defines ... and tc.preprocess_definitions quote problems #16169

Closed
paulharris opened this issue Apr 29, 2024 · 3 comments · Fixed by #16172
Assignees
Labels
Milestone

Comments

@paulharris
Copy link
Contributor

paulharris commented Apr 29, 2024

Describe the bug

Windows, MSVC, conan 2.2.3

I'm building a project with MSVC and Debug mode.
I want to set _ITERATOR_DEBUG_LEVEL=0 across ALL dependencies. This is required for linking.

I added to the profile:

[conf]
tools.build:defines=["_ITERATOR_DEBUG_LEVEL=0"]

harfbuzz is a problem. It is a Meson recipe, and it appears Meson ignores tools.build:defines
I am not sure why, it has tc.preprocessor_definitions just like the CMakeToolchain, why would conan not pass these onto Meson as well?

Additionally, I tried to test by adjusting harfbuzz's recipe, by adding to def configure(self):
tc.preprocessor_definitions["_ITERATOR_DEBUG_LEVEL"] = 0

But Meson then builds with this command line (which fails with a cl.exe fatal error):

"cl" "-Isrc\libharfbuzz.a.p" "-Isrc" "-I..\src\src" "-I." "-I..\src" "-IM:/cocache4/cache/b/freet0508e9d7e6575/p/include" "-IM:/cocache4/cache/b/freet0508e9d7e6575/p/include/freetype2" "-IM:/cocache4/cache/b/libpn2b1716cb8fc8a/p/include" "-IM:/cocache4/cache/b/brotla8ae8b1cc3ea9/p/include" "-IM:/cocache4/cache/b/brotla8ae8b1cc3ea9/p/include/brotli" "-IM:/cocache4/cache/b/zlibaa051031a3f1a/p/include" "-IM:/cocache4/cache/b/bzip21d1b3a8fb9846/p/include" "-IM:/cocache4/cache/b/glib797de4fd80358/p/include" "-IM:/cocache4/cache/b/glib797de4fd80358/p/include/glib-2.0" "-IM:/cocache4/cache/b/glib797de4fd80358/p/lib/glib-2.0/include" "-IM:/cocache4/cache/b/pcre2002bf79de5d67/p/include" "-IM:/cocache4/cache/b/libgee81b73e14585e/p/include" "-IM:/cocache4/cache/b/libic07bd529a5ac88/p/include" "/MDd" "/nologo" "/showIncludes" "/utf-8" "/Zc:__cplusplus" "/W2" "/EHs-c-" "/std:c++20" "/Od" "/Zi" "/wd4244" "/utf-8" "-DHAVE_CONFIG_H" "-D_ITERATOR_DEBUG_LEVEL=\"0\"" "-DPCRE2_STATIC" "/Fdsrc\libharfbuzz.a.p\hb-ot-map.cc.pdb" /Fosrc/libharfbuzz.a.p/hb-ot-map.cc.obj "/c" ../src/src/hb-ot-map.cc

Note this command line parameter: "-D_ITERATOR_DEBUG_LEVEL=\"0\""
It should simply read: "-D_ITERATOR_DEBUG_LEVEL=0"

I can't even hack the recipe to get where I need to go ...

@paulharris
Copy link
Contributor Author

It appears to work if I add to the profile:

tools.build:cflags=["-D_ITERATOR_DEBUG_LEVEL=0"]
tools.build:cxxflags=["-D_ITERATOR_DEBUG_LEVEL=0"]

Why aren't tools.build:defines supported for MesonToolchain?

@franramirez688
Copy link
Contributor

Hi @paulharris

You're right, thanks a lot for reporting 👍 Working on fixing this.

@paulharris
Copy link
Contributor Author

Please also see my comment in the PR re docs,
#16172 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants