build with rscons

This commit is contained in:
Josh Holtrop 2013-10-30 09:38:26 -04:00
parent b9f405aa64
commit d24335b424
3 changed files with 40 additions and 7 deletions

5
.gitignore vendored
View File

@ -1,2 +1,3 @@
/.dub /.rsconscache
/d-dub-derelict-sdl2-gl3-demo /app
/app.exe

View File

@ -1,6 +1,4 @@
TARGET := d-dub-derelict-sdl2-gl3-demo default:
SOURCES := source/*.d /usr/local/src/d/derelict/sdl2/*.d /usr/local/src/d/derelict/opengl3/*.d /usr/local/src/d/gl3n/*.d /usr/local/src/d/gl3n/ext/*.d /usr/local/src/d/glamour/*.d
DFLAGS := -I/usr/local/src/d -fversion=Derelict3 -fversion=gl3n -fversion=SDLImage -L/usr/local/lib -lDerelictUtil -ldl
$(TARGET): $(SOURCES) %:
gdc -o $@ $(DFLAGS) $(SOURCES) rake $@

34
Rakefile Normal file
View File

@ -0,0 +1,34 @@
require "bundler"
begin
Bundler.setup(:default, :development)
rescue Bundler::BundlerError => e
raise "Unable to Bundler.setup(): You probably need to run `bundle install`: " + e.message
end
require "rscons"
task :default do
Rscons::Environment.new(echo: :short) do |env|
sources = []
dirs = [
"source",
"modules/DerelictUtil/source",
"modules/DerelictSDL2/source",
"modules/DerelictGL3/source",
"modules/gl3n/gl3n",
"modules/glamour/glamour",
].each do |dir|
sources += Dir["#{dir}/**/*.d"]
end
env["D_IMPORT_PATH"] += [
"modules/DerelictUtil/source",
"modules/DerelictSDL2/source",
"modules/DerelictGL3/source",
"modules/gl3n",
"modules/glamour",
]
env["DFLAGS"] += ["-fversion=Derelict3", "-fversion=gl3n", "-fversion=SDLImage"]
env.build_dir("source", "build")
env.build_dir("modules", "build")
env.Program("app", sources)
end
end