]> git.mdlowis.com Git - proto/sclpl.git/commitdiff
Switched from trollop to optparse
authorMichael D. Lowis <mike@mdlowis.com>
Mon, 3 Nov 2014 02:07:42 +0000 (21:07 -0500)
committerMichael D. Lowis <mike@mdlowis.com>
Mon, 3 Nov 2014 02:07:42 +0000 (21:07 -0500)
build-system
build.rb

index c783ad99f85abdf01610bb05d531e13e35e250cd..bc9ed182ee184b60a88d0325bef8877fd9912a69 160000 (submodule)
@@ -1 +1 @@
-Subproject commit c783ad99f85abdf01610bb05d531e13e35e250cd
+Subproject commit bc9ed182ee184b60a88d0325bef8877fd9912a69
index 60872918ea98b3c472e0e6b54189ba9b5c3694e7..5f9c42123297db0f567978f430caec57f5a7e4ce 100755 (executable)
--- a/build.rb
+++ b/build.rb
@@ -14,9 +14,6 @@ base_env = BuildEnv.new do |env|
   env.build_dir('source','build/obj/source')
   env.build_dir('modules','build/obj/modules')
 
-  # Use gcc toolchain
-  env.set_toolset(:gcc)
-
   # Add a builder for creating a CMake project
   env.add_builder :CMake do |target, sources, cache, env, vars|
     target_dir = File.dirname(target)
@@ -30,6 +27,7 @@ base_env = BuildEnv.new do |env|
     target if File.exists? target
   end
 
+  # Add a builder for building a project with Make
   env.add_builder :Make do |target, sources, cache, env, vars|
     working_dir = File.dirname(sources.first)
     cmd = env.expand_varref("${MAKE_CMD}", vars)
@@ -64,21 +62,24 @@ test_env = base_env.clone do |env|
   # Move the object files to the build dir
   env.build_dir('source','build/obj_test/source')
   env.build_dir('modules','build/obj_test/modules')
-  env['CFLAGS'] +=  ['-O0', '--coverage']
-  env['LDFLAGS'] += ['--coverage']
+  env['CFLAGS'] +=  ['-O0']
+  if Opts[:profile].include? "coverage"
+    env['CFLAGS']  << '--coverage'
+    env['LDFLAGS'] << '--coverage'
+  end
 end
 
 #------------------------------------------------------------------------------
 # Clang Toolchain Targets
 #------------------------------------------------------------------------------
-main_env.CMake('build/llvm/Makefile',
-               Dir['source/vendor/llvm-3.4.2/CMakeLists.txt',
-                   'source/vendor/llvm-3.4.2/cmake/**/*/'])
-main_env.Make("build/llvm/bin/clang#{windows? ? '.exe':''}",
-              ['build/llvm/Makefile'] + Dir['source/vendor/llvm-3.4.2/tools/**/*.*'])
+#main_env.CMake('build/llvm/Makefile',
+#               Dir['source/vendor/llvm-3.4.2/CMakeLists.txt',
+#                   'source/vendor/llvm-3.4.2/cmake/**/*/'])
+#main_env.Make("build/llvm/bin/clang#{windows? ? '.exe':''}",
+#              ['build/llvm/Makefile'] + Dir['source/vendor/llvm-3.4.2/tools/**/*.*'])
 
 # Register clang with the environment
-ENV['PATH'] = "build/llvm/bin/#{windows? ? ';':':'}#{ENV['PATH']}"
+#ENV['PATH'] = "build/llvm/bin/#{windows? ? ';':':'}#{ENV['PATH']}"
 
 #------------------------------------------------------------------------------
 # Release Build Targets
@@ -91,8 +92,9 @@ main_env.Program('build/bin/sclpl',
 #------------------------------------------------------------------------------
 # Test Build Targets
 #------------------------------------------------------------------------------
-test_env.Program('build/bin/sclpl-test',
-  FileList['source/sclpl/*.c', 'build/lib/libopts.a', 'build/lib/libcds.a'])
-test_env.Command('RSpec', [], 'CMD' => [
-    'rspec', '--pattern', 'spec/**{,/*/**}/*_spec.rb', '--format', 'documentation'])
-
+if Opts[:profile].include? "test"
+  test_env.Program('build/bin/sclpl-test',
+    FileList['source/sclpl/*.c', 'build/lib/libopts.a', 'build/lib/libcds.a'])
+  test_env.Command('RSpec', [], 'CMD' => [
+      'rspec', '--pattern', 'spec/**{,/*/**}/*_spec.rb', '--format', 'documentation'])
+end