add Obj2D builder, skeleton obj2d.rb script

This commit is contained in:
Josh Holtrop 2013-11-13 22:50:20 -05:00
parent 89e38af910
commit 52d37bbb46
2 changed files with 19 additions and 0 deletions

View File

@ -6,9 +6,17 @@ rescue Bundler::BundlerError => e
end end
require "rscons" require "rscons"
class Obj2D < Rscons::Builder
def run(target, sources, cache, env, vars)
command = ["ruby", "obj2d.rb", sources.first, target]
standard_build("Obj2D #{target}", target, command, sources + ["obj2d.rb"], env, cache)
end
end
desc "Build ScreenSaver" desc "Build ScreenSaver"
task :default do task :default do
Rscons::Environment.new do |env| Rscons::Environment.new do |env|
env.add_builder(Obj2D.new)
sources = [] sources = []
dirs = [ dirs = [
"src", "src",
@ -20,16 +28,19 @@ task :default do
].each do |dir| ].each do |dir|
sources += Dir["#{dir}/**/*.d"] sources += Dir["#{dir}/**/*.d"]
end end
sources << "build/obj2d/logo.d"
env["D_IMPORT_PATH"] += [ env["D_IMPORT_PATH"] += [
"modules/DerelictUtil/source", "modules/DerelictUtil/source",
"modules/DerelictSDL2/source", "modules/DerelictSDL2/source",
"modules/DerelictGL3/source", "modules/DerelictGL3/source",
"modules/gl3n", "modules/gl3n",
"modules/glamour", "modules/glamour",
"build/obj2d",
] ]
env["DFLAGS"] += ["-fversion=Derelict3", "-fversion=gl3n", "-fversion=SDLImage"] env["DFLAGS"] += ["-fversion=Derelict3", "-fversion=gl3n", "-fversion=SDLImage"]
env["LDFLAGS"] += ["-static-libgcc"] env["LDFLAGS"] += ["-static-libgcc"]
env.build_root = "build" env.build_root = "build"
env.Obj2D("build/obj2d/logo.d", "model/gentex-logo.obj")
env.Program("gss", sources) env.Program("gss", sources)
end end
end end

8
obj2d.rb Normal file
View File

@ -0,0 +1,8 @@
#!/usr/bin/env ruby
def main(obj_fname, d_fname)
File.open(d_fname, "w") do |fh|
end
end
main(*ARGV)