xwm, core: implement and use lucca_window_withdraw
[luccawm.git] / SConstruct
blob399b8b9cc5de4d9e9d4fd3d08957c680ae232a57
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', 0):
30 project_env.MergeFlags('-g')
31 else:
32 project_env.MergeFlags('-O')
34 project_env.MergeFlags('-Wall -Wno-unused-function -Werror')
36 def pkgconfig(env, package):
37 #this is annoying; because ParseConfig doesn't like arguments that contain spaces, I have to do this manually
38 pc = subprocess.Popen(['pkg-config', package, '--cflags', '--libs'], stdout=subprocess.PIPE)
39 flags = pc.stdout.read()
40 if pc.wait() == 0: #pkg-config exited successfully
41 env.MergeFlags(flags)
42 else: #pkg-config failed and printed an error message
43 Exit(1)
44 Export('pkgconfig')
46 Mkdir('include')
47 project_include = Dir('include') #directory for this project's headers
48 project_env.Prepend(CPPPATH=project_include)
49 Export('project_include')
51 #bin module
52 bin_files, bin_config = SConscript('bin/SConscript')
53 Export('bin_files bin_config')
55 #Layout module
56 layout_files, layout_config = SConscript('layout/SConscript')
57 Export('layout_files layout_config')
59 #X Window Management module
60 display_files, display_config = SConscript('xwm/SConscript')
61 Export('display_files display_config')
63 #Core module
64 core_files, core_config = SConscript('core/SConscript')
65 Export('core_files core_config')
67 #loader program
68 SConscript('loader/SConscript')
70 #test programs
71 SConscript('layout/test/SConscript')
72 SConscript('xwm/test/SConscript')