From e3291bde56b0ba3a8b53ef6436e361d1b01974eb Mon Sep 17 00:00:00 2001 From: Daniel Burrows Date: Sat, 24 Apr 2010 23:09:09 -0700 Subject: If the GTK+ frontend is being built, make sure to build its sources and link them into aptitude, and make the glade file available. Since aptitude will actually run from the build directory, its glade file needs to be available there, not just in the source directory. --- src/SConscript | 27 ++++++++++++++++++++++----- 1 file changed, 22 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/SConscript b/src/SConscript index 97d9fcbe..3123f8bc 100644 --- a/src/SConscript +++ b/src/SConscript @@ -95,13 +95,30 @@ toplevel_srcs = [ sub_srcs = SConscript(dirs = [ 'cmdline', 'generic', - #'gtk', 'mine', ]) -all_srcs = Flatten([toplevel_srcs, sub_srcs]) +# Note: always load the GTK+ sources (for dist, etc) even if we aren't +# building that variant. +gtk_srcs = SConscript(dirs = [ + 'gtk' + ]) + +if programs_env.IsVariantActive('gtk'): + aptitude_srcs = Flatten([toplevel_srcs, gtk_srcs, sub_srcs]) +else: + aptitude_srcs = Flatten([toplevel_srcs, sub_srcs]) + +aptitude = programs_env.Program(target = 'aptitude', source = NonHeaders(aptitude_srcs)) + +if programs_env.IsVariantActive('gtk'): + # Force the .glade file to be copied to the build directory. Note + # the use of Requires to ensure that the glade is available for + # aptitude, without forcing aptitude to be relinked because it + # changed. + aptitude_glade = programs_env.Command('gtk/aptitude.glade', + '#/src/gtk/aptitude.glade', + Copy('$TARGET', '$SOURCE')) + programs_env.Requires(aptitude, aptitude_glade) -# TODO: add nodes for all variants (debug vs release, gtk vs no-gtk), -# in separate build directories. -aptitude = programs_env.Program(target = 'aptitude', source = NonHeaders(all_srcs)) Return('aptitude') -- cgit v1.2.3