On Tue, Jan 17, 2023 at 2:28 PM Till Hofmann <thofmann(a)fedoraproject.org> wrote:
Hi all,
Someone (rightfully) suggested that we should build glfw twice, once
with wayland support and once without:
https://bugzilla.redhat.com/show_bug.cgi?id=2152319
Is there any best practice how to build the same package in two
different flavors, in this case cmake-based? I vaguely remember seeing a
spec file that did that, but I don't remember where.
Thanks for any pointers!
Kind regards,
Till
I don't know about best practices, but it seems like you could do
something like this:
%build
%cmake <first set of options>
%cmake_build
mv %{_vpath_builddir} build-first
%cmake <second set of options>
%cmake_build
mv %{_vpath_builddir} build-second
%install
mv build-first %{_vpath_builddir}
%cmake_install
mv %{_vpath_builddir} build-first
mv build-second %{_vpath_builddir}
%cmake_install
mv %{_vpath_builddir} build-second
%check
mv build-first %{_vpath_builddir}
%ctest
mv %{_vpath_builddir} build-first
mv build-second %{_vpath_builddir}
%ctest
mv %{_vpath_builddir} build-second
I made that up off the top of my head and haven't tried it, so it may
have some fatal flaw. Take with a large grain of salt.
--
Jerry James
http://www.jamezone.org/