From 532bede01f02bf755e9e8d085cbbd58082477d45 Mon Sep 17 00:00:00 2001 From: "Michael D. Lowis" Date: Tue, 23 Sep 2014 22:48:43 -0400 Subject: [PATCH] Added build scripts --- .gitmodules | 3 +++ Rakefile | 49 +++++++++++-------------------------------------- build-system | 1 + 3 files changed, 15 insertions(+), 38 deletions(-) create mode 100644 .gitmodules create mode 160000 build-system diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..22d2a64 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "build-system"] + path = build-system + url = https://github.com/mikedlowis/build-system.git diff --git a/Rakefile b/Rakefile index 894833d..2be993b 100644 --- a/Rakefile +++ b/Rakefile @@ -1,19 +1,19 @@ -#------------------------------------------------------------------------------ -# Bundler Setup -#------------------------------------------------------------------------------ -require "bundler" -begin - Bundler.setup(:default, :development) -rescue Bundler::BundlerError => e - raise LoadError.new("Unable to Bundler.setup(): You probably need to run `bundle install`: #{e.message}") -end -require 'rscons' -require 'rbconfig' +require './build-system/setup' def windows? RbConfig::CONFIG['host_os'] =~ /mswin|msys|mingw|cygwin|bccwin|wince|emc/ end +#------------------------------------------------------------------------------ +# Envrionment Definitions +#------------------------------------------------------------------------------ +# Define the compiler environment +BaseEnv = BuildEnv.new(echo: :command) do |env| + env.build_dir('source','build/obj/source') + env.set_toolset(:clang) + env["CFLAGS"] += ['-Wall', '-Wextra' ]#, '-Werror'] +end + #------------------------------------------------------------------------------ # Clang Toolchain Targets #------------------------------------------------------------------------------ @@ -42,33 +42,6 @@ task :clang => ["#{CLANG_BIN_DIR}/#{CLANG_BIN_NAME}"] do ENV['PATH'] = "#{CLANG_BIN_DIR}#{windows? ? ';':':'}#{ENV['PATH']}" end -#------------------------------------------------------------------------------ -# Envrionment Definitions -#------------------------------------------------------------------------------ -class Environment < Rscons::Environment - @@environments = [] - def initialize(args,&block) - super(args,&block) - @@environments << self - end - - def self.process_all() - @@environments.each {|e| e.process } - end -end - -# Process all environments so we actually build the targets -at_exit { Environment.process_all } - -# Define the compiler environment -BaseEnv = Environment.new(echo: :command) do |env| - env.build_dir('source','build/obj/source') - env['CC'] = 'clang' - env['CXX'] = 'clang' - env['LD'] = 'clang' - env["CFLAGS"] += ['-Wall', '-Wextra' ]#, '-Werror'] -end - #------------------------------------------------------------------------------ # Rscons Build Targets #------------------------------------------------------------------------------ diff --git a/build-system b/build-system new file mode 160000 index 0000000..81f2a99 --- /dev/null +++ b/build-system @@ -0,0 +1 @@ +Subproject commit 81f2a99521abae709ccdeea0640f382908d20b64 -- 2.52.0