Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Build all targets in a directory specific to the build configuration.

Invoke each subsidiary SConscript with a variant_dir argument.
Simplify the top-level .gitignore given the new build targets directory.
  • Loading branch information...
commit 58bf26889536595d2fc86260013019b4856e08f6 1 parent 545be1a
Jared Hoberock jaredhoberock authored
7 .gitignore
View
@@ -1,12 +1,7 @@
+targets/
*.pyc
*.bak
-*.o
-*.so
*.swp
-*.linkinfo
*.sconsign.dblite
*.pgm
*~
-nvcc_options_file.txt
-print_sm_version
-tester
18 SConstruct
View
@@ -334,11 +334,17 @@ env.Append(LIBPATH = lib_paths())
env.Append(LIBS = libs(env.subst('$CXX'), env['host_backend'], env['device_backend']))
-# make the build environment available to SConscripts
-Export('env')
+# make the build environment available to all subsidiary SConscripts
+env.Export('env')
-SConscript('SConscript')
-SConscript('examples/SConscript')
-SConscript('testing/SConscript')
-SConscript('performance/SConscript')
+# assemble the name of this configuration's targets directory
+targets_dir = 'targets/{0}_host_{1}_device_{2}'.format(env['host_backend'], env['device_backend'], env['mode'])
+
+# invoke each SConscript with a variant directory
+env.SConscript('examples/SConscript', variant_dir = 'examples/' + targets_dir, duplicate = 0)
+env.SConscript('testing/SConscript', variant_dir = 'testing/' + targets_dir, duplicate = 0)
+env.SConscript('performance/SConscript', variant_dir = 'performance/' + targets_dir, duplicate = 0)
+
+# the top-level SConscript doesn't need a variant directory as it just builds zipfiles
+env.SConscript('SConscript')
10 performance/SConscript
View
@@ -1,6 +1,12 @@
-import os
+import sys
+
+# enable python to find the module
+module_path = Dir('#/performance').abspath
+sys.path.append(module_path)
from build.perftest import compile_test
+import os
+
Import('env')
my_env = env.Clone()
@@ -19,7 +25,7 @@ report_builder = Builder(action = os.path.join('"' + str(my_env.Dir('.')), '$SOU
src_suffix = my_env['PROGSUFFIX'])
my_env.Append(BUILDERS = {'Report' : report_builder})
-my_env.Append(CPPPATH = [Dir('.'), Dir('../testing/')])
+my_env.Append(CPPPATH = [Dir('#/performance'), Dir('#/testing')])
cu_list = []
program_list = []
2  testing/SConscript
View
@@ -19,7 +19,7 @@ if my_env.subst('$CXX') == 'cl':
my_env.Append(CPPFLAGS = '/bigobj')
# #include the current directory
-my_env.Append(CPPPATH = Dir('.'))
+my_env.Append(CPPPATH = Dir('#/testing'))
# find all .cus & .cpps
sources = []
Please sign in to comment.
Something went wrong with that request. Please try again.