snitch icon indicating copy to clipboard operation
snitch copied to clipboard

Update meson build scripts to align with CMake scripts

Open cschreib opened this issue 2 years ago • 3 comments

As of https://github.com/cschreib/snitch/pull/115, the CMake scripts were updated to provide better support for building snitch as a shared library. The meson scripts were updated in the process, but only minimally since I don't know enough of meson... Here is what is still missing:

  • If compiling the library with GCC or clang, we should set -fvisibility=hidden -fvisibility-inlines-hidden (only when building the library, not when consuming it). Done in https://github.com/snitch-org/snitch/pull/138.
  • This one I'm less sure; maybe it's not "the meson way". I think the script should only build one of [shared, static, header-only]. Currently the scripts can build any combination of these, which is probably OK if building [static, header-only], but [shared, static] or [shared, header-only] is likely not to work as expected since snitch_config.hpp needs to be different in both cases. If the snitch_config.hpp can be re-generated for each target, then that's fine, but it seems to me it would just complicate the build script.

cschreib avatar Sep 01 '23 14:09 cschreib

@willwray Since you contributed the original meson scripts, I was wondering if you were interested in updating this. It might not be hard, but I haven't yet climbed the learning curve on that one :)

cschreib avatar Sep 01 '23 14:09 cschreib

I'll take a look at the weekend, and use my 'ask a friend' on the meson matrix channel if needed.

willwray avatar Sep 01 '23 23:09 willwray

Thank you @topazus for contributing the changes to implement the first item in the list. This leaves us with the second item (whether to limit the scripts to build one type of target at a time, or support building all possible types of target at once). Any opinions?

cschreib avatar Nov 07 '23 07:11 cschreib