You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
CMake allows setting compile args on specific source files. This is very useful in some circumstances. For example, I have a case where I want a file using a JSON header-only library to be optimized with -O3 and my other files to be optimized according to the debug mode. Or I have a huge file I don't want debug info for. Or I have a couple of ugly defines intended for a specific source file that can otherwise be hidden from other compile commands.
I think the closest thing in meson would be to split off a static lib with the files you want to specialize on, and provide the flags only to it. But this has the downside of requiring more targets.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
CMake allows setting compile args on specific source files. This is very useful in some circumstances. For example, I have a case where I want a file using a JSON header-only library to be optimized with
-O3
and my other files to be optimized according to the debug mode. Or I have a huge file I don't want debug info for. Or I have a couple of ugly defines intended for a specific source file that can otherwise be hidden from other compile commands.I think the closest thing in meson would be to split off a static lib with the files you want to specialize on, and provide the flags only to it. But this has the downside of requiring more targets.
Beta Was this translation helpful? Give feedback.
All reactions