aboutsummaryrefslogtreecommitdiffstats
path: root/scons
diff options
context:
space:
mode:
authorzhanyong.wan <zhanyong.wan@861a406c-534a-0410-8894-cb66d6ee9925>2010-02-24 17:19:25 +0000
committerzhanyong.wan <zhanyong.wan@861a406c-534a-0410-8894-cb66d6ee9925>2010-02-24 17:19:25 +0000
commit3bef459eac9aa84c579f34249aebc9ff56832054 (patch)
treec91cb1205fb45e4a96889ae478afa66a0559694c /scons
parentdd280cfa8dff2247f71a1177d7c8f0c2fde9789a (diff)
downloadgoogletest-3bef459eac9aa84c579f34249aebc9ff56832054.tar.gz
googletest-3bef459eac9aa84c579f34249aebc9ff56832054.tar.bz2
googletest-3bef459eac9aa84c579f34249aebc9ff56832054.zip
Adds threading support (by Miklos Fazekas, Vlad Losev, and Chandler Carruth); adds wide InitGoogleTest to gtest.def (by Vlad Losev); updates the version number (by Zhanyong Wan); updates the release notes for 1.5.0 (by Vlad Losev); removes scons scripts from the distribution (by Zhanyong Wan); adds the cmake build script to the distribution (by Zhanyong Wan); adds fused source files to the distribution (by Vlad Losev and Chandler Carruth).
Diffstat (limited to 'scons')
-rw-r--r--scons/SConscript19
-rw-r--r--scons/SConscript.common1
-rw-r--r--scons/SConstruct.common2
3 files changed, 17 insertions, 5 deletions
diff --git a/scons/SConscript b/scons/SConscript
index df1392e1..1e19df70 100644
--- a/scons/SConscript
+++ b/scons/SConscript
@@ -128,6 +128,10 @@ env_with_exceptions = EnvCreator.Create(env_warning_ok,
EnvCreator.WithExceptions)
env_without_rtti = EnvCreator.Create(env_warning_ok, EnvCreator.NoRtti)
+env_with_exceptions_and_threads = EnvCreator.Create(env_with_threads,
+ EnvCreator.WithExceptions)
+env_with_exceptions_and_threads['OBJ_SUFFIX'] = '_with_exceptions_and_threads'
+
############################################################
# Helpers for creating build targets.
@@ -232,7 +236,11 @@ gtest, gtest_main = GtestStaticLibraries(env)
gtest_ex, gtest_main_ex = GtestStaticLibraries(env_with_exceptions)
gtest_no_rtti, gtest_main_no_rtti = GtestStaticLibraries(env_without_rtti)
gtest_use_own_tuple, gtest_main_use_own_tuple = GtestStaticLibraries(
- env_use_own_tuple)
+ env_use_own_tuple)
+gtest_with_threads, gtest_main_with_threads = GtestStaticLibraries(
+ env_with_threads)
+gtest_ex_with_threads, gtest_main_ex_with_threads = GtestStaticLibraries(
+ env_with_exceptions_and_threads)
# Install the libraries if needed.
if 'LIB_OUTPUT' in env.Dictionary():
@@ -259,7 +267,6 @@ if BUILD_TESTS:
additional_sources=['../test/gtest-param-test2_test.cc'])
GtestTest(env, 'gtest_color_test_', gtest)
GtestTest(env, 'gtest-linked_ptr_test', gtest_main)
- GtestTest(env, 'gtest-port_test', gtest_main)
GtestTest(env, 'gtest_break_on_failure_unittest_', gtest)
GtestTest(env, 'gtest_filter_unittest_', gtest)
GtestTest(env, 'gtest_help_test_', gtest_main)
@@ -275,10 +282,12 @@ if BUILD_TESTS:
############################################################
# Tests targets using custom environments.
GtestTest(env_warning_ok, 'gtest_unittest', gtest_main)
- GtestTest(env_with_exceptions, 'gtest_output_test_', gtest_ex)
+ GtestTest(env_with_exceptions_and_threads, 'gtest_output_test_',
+ gtest_ex_with_threads)
GtestTest(env_with_exceptions, 'gtest_throw_on_failure_ex_test', gtest_ex)
- GtestTest(env_with_threads, 'gtest-death-test_test', gtest_main)
- GtestTest(env_with_threads, 'gtest_stress_test', gtest)
+ GtestTest(env_with_threads, 'gtest-death-test_test', gtest_main_with_threads)
+ GtestTest(env_with_threads, 'gtest-port_test', gtest_main_with_threads)
+ GtestTest(env_with_threads, 'gtest_stress_test', gtest_with_threads)
GtestTest(env_less_optimized, 'gtest_env_var_test_', gtest)
GtestTest(env_less_optimized, 'gtest_uninitialized_test_', gtest)
GtestTest(env_use_own_tuple, 'gtest-tuple_test', gtest_main_use_own_tuple)
diff --git a/scons/SConscript.common b/scons/SConscript.common
index 7943e77c..adefa582 100644
--- a/scons/SConscript.common
+++ b/scons/SConscript.common
@@ -119,6 +119,7 @@ class EnvCreator:
# selecting on a platform.
env.Append(CCFLAGS=['-pthread'])
env.Append(LINKFLAGS=['-pthread'])
+ env.Append(CPPDEFINES='GTEST_HAS_PTHREAD=1')
WithThreads = classmethod(WithThreads)
def NoRtti(cls, env):
diff --git a/scons/SConstruct.common b/scons/SConstruct.common
index 59b8864b..6b10033b 100644
--- a/scons/SConstruct.common
+++ b/scons/SConstruct.common
@@ -200,7 +200,9 @@ class SConstructHelper:
'-Wall',
'-Werror',
'-Wshadow',
+ '-DGTEST_HAS_PTHREAD=1'
])
+ env.Append(LINKFLAGS=['-pthread'])
if optimized:
env.Append(CCFLAGS=['-O2'], CPPDEFINES=['NDEBUG', '_NDEBUG'])
else: