Skip to content

Instantly share code, notes, and snippets.

@marcmo
Created April 21, 2010 11:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save marcmo/373737 to your computer and use it in GitHub Desktop.
Save marcmo/373737 to your computer and use it in GitHub Desktop.
# # usage
# require 'cxxproject'
#
# cxx_configuration "Test" do
# exe "bla", :source => FileList[*.arxml]
# lib "lib1", :source => "xxx/azzz/"
# end
CxxConfigs = []
def cxx_configuration(*args, &block)
c = EvalContext.new
c.configuration(*args, &block)
end
class EvalContext
def configuration(*args, &block)
name = args[0]
raise "no name given" unless name.is_a?(String) && !name.strip.empty?
hash = args[1]
raise "not a hash" unless hask.is_a?(Hash)
@config = Configuration.new(name, hash[:source])
@configs << @config
instance_eval(&block)
end
def exe(*args)
exe = Exe.new
@config.addExe(exe)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment