osmith has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-dev/+/43614?usp=email )
Change subject: gen_makefile: allow passing opts to cmake, meson ......................................................................
gen_makefile: allow passing opts to cmake, meson
We need to always build the cmake program onomondo-ipa with a specific option when building it through testenv with osmo-dev. Extend gen_makefile so we can pass options not only to autotools based projects, but also to cmake and while at it meson too. For example usage, see the related patch.
Related: osmo-ttcn3-hacks I6e9dfb6baf9cd0d760f0ea3d18983b56ed64f9be Change-Id: I2572ae781dd4d57e614813c90f5ed8bc76caf033 --- M gen_makefile.py 1 file changed, 11 insertions(+), 3 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-dev refs/changes/14/43614/1
diff --git a/gen_makefile.py b/gen_makefile.py index 203c7f5..9457804 100755 --- a/gen_makefile.py +++ b/gen_makefile.py @@ -378,7 +378,8 @@ -rm -rf {build_proj} mkdir -p {build_proj} cd {build_proj}; {cflags}meson setup {build_to_src} . \ - --prefix {shlex.quote(args.install_prefix)} + --prefix {shlex.quote(args.install_prefix)} \ + {configure_opts} touch $@ ''' elif buildsystem == "cmake": @@ -389,7 +390,8 @@ -rm -rf {build_proj} mkdir -p {build_proj} cd {build_proj}; cmake -S {build_to_src} -B . \ - -DCMAKE_INSTALL_PREFIX={shlex.quote(args.install_prefix)} + -DCMAKE_INSTALL_PREFIX={shlex.quote(args.install_prefix)} \ + {configure_opts} touch $@ ''' elif buildsystem in ["erlang", "python"]: @@ -753,9 +755,15 @@ content += 'all-install: \\n\t' + ' \\n\t'.join([ '.make.%s.install' % p for p, d in projects_deps.items() ]) + '\n\n'
for proj, deps in projects_deps.items(): + # Build a project-specific list of configure optons all_config_opts = [] - all_config_opts.extend(configure_opts.get('ALL') or []) + if projects_buildsystems.get(proj, "autotools") == "autotools": + # Options for ALL are only applied to projects with the autotools build + # system. When applying unknown options to ./configure, they simply get + # ignored whereas other build systems will fail. + all_config_opts.extend(configure_opts.get('ALL') or []) all_config_opts.extend(configure_opts.get(proj) or []) + content += gen_make(proj, deps, all_config_opts, make_dir, src_dir, build_dir)
# Replace spaces with tabs to avoid the common pitfall of inserting spaces