xwm: fix memory leak in invisible screen window
[luccawm.git] / SConstruct
blobebca3b25b8a42595224c91b3b448b69ab8c75452
1 # Copyright (c) 2008 Vincent Povirk
3 # Permission is hereby granted, free of charge, to any person
4 # obtaining a copy of this software and associated documentation
5 # files (the "Software"), to deal in the Software without
6 # restriction, including without limitation the rights to use,
7 # copy, modify, merge, publish, distribute, sublicense, and/or sell
8 # copies of the Software, and to permit persons to whom the
9 # Software is furnished to do so, subject to the following
10 # conditions:
12 # The above copyright notice and this permission notice shall be
13 # included in all copies or substantial portions of the Software.
15 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16 # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
17 # OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18 # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
19 # HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
20 # WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21 # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22 # OTHER DEALINGS IN THE SOFTWARE.
24 import subprocess
26 project_env = Environment()
27 Export('project_env')
29 if ARGUMENTS.get('debug', 1) not in [0, '0']:
30 project_env.MergeFlags('-g -DLUCCA_DEBUG')
31 debug = True
32 else:
33 project_env.MergeFlags('-O')
34 debug = False
35 Export('debug')
37 if ARGUMENTS.get('usegnome', 1) not in [0, '0']:
38 usegnome = True
39 else:
40 usegnome = False
41 Export('usegnome')
43 project_env.MergeFlags('-Wall -Wno-unused-function -Werror')
45 def pkgconfig(env, package):
46 #this is annoying; because ParseConfig doesn't like arguments that contain spaces, I have to do this manually
47 pc = subprocess.Popen(['pkg-config', package, '--cflags', '--libs'], stdout=subprocess.PIPE)
48 flags = pc.stdout.read()
49 if pc.wait() == 0: #pkg-config exited successfully
50 env.MergeFlags(flags)
51 else: #pkg-config failed and printed an error message
52 Exit(1)
53 Export('pkgconfig')
55 Mkdir('include')
56 project_include = Dir('include') #directory for this project's headers
57 project_env.Prepend(CPPPATH=project_include)
58 Export('project_include')
60 #bin module
61 bin_files, bin_config = SConscript('bin/SConscript')
62 Export('bin_files bin_config')
64 #Layout module
65 layout_files, layout_config = SConscript('layout/SConscript')
66 Export('layout_files layout_config')
68 #X Window Management module
69 display_files, display_config = SConscript('xwm/SConscript')
70 Export('display_files display_config')
72 if debug:
73 #crashcatcher
74 cc_files, cc_config = SConscript('crashcatcher/SConscript')
75 Export('cc_files cc_config')
77 #Core module
78 core_files, core_config = SConscript('core/SConscript')
79 Export('core_files core_config')
81 #loader program
82 main_program = SConscript('loader/SConscript')
83 main_program = project_env.Install('.', main_program)
84 Default(main_program)
86 if ARGUMENTS.get('test', 1) not in [0, '0']:
87 #test programs
88 SConscript('layout/test/SConscript')
89 SConscript('xwm/test/SConscript')