-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSConstruct
More file actions
45 lines (38 loc) · 1.15 KB
/
SConstruct
File metadata and controls
45 lines (38 loc) · 1.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#--- python mode ---
import os
import sys
import platform
env = Environment()
include_path = ['..', '../..']
lib_path = ['../../../build']
libs = ['gtest', 'gtest_main', 'cpp_util', 'pthread']
# platform for mac
if platform.system() == 'Darwin':
include_path += ['../../../gtest/gtest_64']
env.Replace(CXX='/usr/local/bin/g++-4.8')
else:
include_path += ['../../../gtest/gtest_32']
env.Replace(CXX='/usr/bin/g++')
# use gtest lib_32 or lib_64
if platform.architecture()[0] == '64bit':
lib_path += ['../../../gtest/gtest_64/lib']
else:
lib_path += ['../../../gtest/gtest_32/lib']
# set environment variables
env.Append(CPPPATH=Dir(include_path))
env.Append(LIBPATH=Dir(lib_path))
env.Append(LIBS=Dir(libs))
env.Append(CXXFLAGS='-Wall -g -O2 -fPIC -DLOGGER_LEVEL=LL_INFO')
# build
#program = env.Program(
# target='UnitTest',
# source=[''],
# LIBPATH=lib_path
#)
#
#ld_library_path_name = 'LD_LIBRARY_PATH'
#if platform.system() == 'Darwin':
# ld_library_path_name = 'DYLD_LIBRARY_PATH'
#action = '%s=.:../../../build %s' % (ld_library_path_name, program[0].abspath)
#test_alias = Alias('test', [program], action)
#AlwaysBuild(test_alias)