1 |
import os |
2 |
import inspect |
3 |
import glob |
4 |
|
5 |
# try to import an environment first |
6 |
try: |
7 |
Import('env') |
8 |
except: |
9 |
exec open("../../build/build-env.py") |
10 |
env = Environment() |
11 |
|
12 |
# on mac we have to tell the linker to link against the C++ library |
13 |
if env['PLATFORM'] == "darwin": |
14 |
env.Append(LINKFLAGS = "-lstdc++") |
15 |
|
16 |
# find all .cus & .cpps in the current directory |
17 |
sources = [] |
18 |
directories = ['.'] |
19 |
extensions = ['*.cu', '*.cpp'] |
20 |
for dir in directories: |
21 |
for ext in extensions: |
22 |
regexp = os.path.join(dir, ext) |
23 |
#sources.extend(env.Glob(regexp, strings = True)) |
24 |
sources.extend(glob.glob(regexp)) |
25 |
|
26 |
# compile examples |
27 |
for src in sources: |
28 |
env.Program(src) |
29 |
|