-
Notifications
You must be signed in to change notification settings - Fork 0
/
project.lace
43 lines (34 loc) · 1.41 KB
/
project.lace
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
@project.name = 'spidr'
module_search_path 'modules'
module_search_path 'modules/game-base'
import 'compiler'
import 'sdl'
import 'gl'
! sources/*.cpp
! assets/level*.svg LEVEL
! assets/sfx.txt SFX
! assets/objects.svg OBJECTS
add_global_path :cpp_include_dir, 'sources/.'
define_compiler(MultiFileCompiler, :name => 'level converter', :input_pattern => tag('.svg') & tag('LEVEL'), :output_name => 'gen_src/levels.cpp') do
def compile(files)
if Helpers::newer?(files.map {|f| f.path}, output_name)
sh Helpers::ruby_exe, @path + 'converters/level_converter', output_name, files.map {|f| f.path }
end
end
end
define_compiler(SingleFileCompiler, :name => 'sfx_converter', :input_pattern => tag('.txt') & tag('SFX'), :output_name => 'gen_src/%.cpp') do
def compile(infile, outfile)
if Helpers::newer?(infile.path, outfile)
sh Helpers::ruby_exe, @path + 'converters/sfx_converter', infile.path, outfile.to_s.sub(/\.cpp$/, '')
end
@project.global_context.add_attribute(:cpp_include_dir, @output_path)
end
end
define_compiler(SingleFileCompiler, :name => 'gfx_converter', :input_pattern => tag('.svg') & tag('OBJECTS'), :output_name => 'gen_src/%.cpp') do
def compile(infile, outfile)
if Helpers::newer?(infile.path, outfile)
sh Helpers::ruby_exe, @path + 'converters/gfx_converter', infile.path, outfile.to_s.sub(/\.cpp$/, '')
end
@project.global_context.add_attribute(:cpp_include_dir, @output_path)
end
end