Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
yangql
googletest
Commits
5f7c33d3
Commit
5f7c33d3
authored
Apr 02, 2009
by
zhanyong.wan
Browse files
Fixes the scons script to build gtest-death-test_test on Linux.
parent
6a26383e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
15 deletions
+22
-15
scons/SConscript
scons/SConscript
+22
-15
No files found.
scons/SConscript
View file @
5f7c33d3
...
...
@@ -99,8 +99,8 @@ env = env.Clone()
# Include paths to gtest headers are relative to either the gtest
# directory or the 'include' subdirectory of it, and this SConscript
# file is one directory deeper than the gtest directory.
env
.
Prepend
(
CPPPATH
=
[
'..'
,
'../include'
])
env
.
Prepend
(
CPPPATH
=
[
'
#/
..'
,
'
#/
../include'
])
# Sources used by base library and library that includes main.
gtest_source
=
'../src/gtest-all.cc'
...
...
@@ -117,8 +117,7 @@ gtest_main = env.StaticLibrary(target='gtest_main',
source
=
[
gtest_source
,
gtest_main_source
])
env_with_exceptions
=
env
.
Clone
()
platform
=
env_with_exceptions
[
'PLATFORM'
]
if
platform
==
'win32'
:
if
env_with_exceptions
[
'PLATFORM'
]
==
'win32'
:
env_with_exceptions
.
Append
(
CCFLAGS
=
[
'/EHsc'
])
env_with_exceptions
.
Append
(
CPPDEFINES
=
'_HAS_EXCEPTIONS=1'
)
# Undoes the _TYPEINFO_ hack, which is unnecessary and only creates
...
...
@@ -205,7 +204,14 @@ GtestUnitTest(env, 'gtest_output_test_', gtest)
GtestUnitTest
(
env
,
'gtest_color_test_'
,
gtest
)
GtestUnitTest
(
env
,
'gtest-linked_ptr_test'
,
gtest_main
)
GtestUnitTest
(
env
,
'gtest-port_test'
,
gtest_main
)
GtestUnitTest
(
env
,
'gtest-death-test_test'
,
gtest_main
)
env_with_pthread
=
env
.
Clone
()
if
env_with_pthread
[
'PLATFORM'
]
not
in
[
'win32'
,
'darwin'
]:
# Assuming POSIX-like environment with GCC.
env_with_pthread
.
Append
(
CCFLAGS
=
[
'-pthread'
])
env_with_pthread
.
Append
(
LINKFLAGS
=
[
'-pthread'
])
GtestUnitTest
(
env_with_pthread
,
'gtest-death-test_test'
,
gtest_main
)
gtest_unittest_ex_obj
=
env_with_exceptions
.
Object
(
target
=
'gtest_unittest_ex'
,
...
...
@@ -226,16 +232,17 @@ GtestBinary(env_with_exceptions,
# - gtest_xml_outfile2_test_
# - gtest_xml_output_unittest_
# We need to disable some optimization flags for a couple of tests,
# otherwise the redirection of stdout does not work (apparently
# because of a compiler bug).
special_env
=
env
.
Clone
()
linker_flags
=
special_env
[
'LINKFLAGS'
]
for
flag
in
[
"/O1"
,
"/Os"
,
"/Og"
,
"/Oy"
]:
if
flag
in
linker_flags
:
linker_flags
.
remove
(
flag
)
GtestUnitTest
(
special_env
,
'gtest_env_var_test_'
,
gtest
)
GtestUnitTest
(
special_env
,
'gtest_uninitialized_test_'
,
gtest
)
# We need to disable some optimization flags for some tests on
# Windows; otherwise the redirection of stdout does not work
# (apparently because of a compiler bug).
env_with_less_optimization
=
env
.
Clone
()
if
env_with_less_optimization
[
'PLATFORM'
]
==
'win32'
:
linker_flags
=
env_with_less_optimization
[
'LINKFLAGS'
]
for
flag
in
[
"/O1"
,
"/Os"
,
"/Og"
,
"/Oy"
]:
if
flag
in
linker_flags
:
linker_flags
.
remove
(
flag
)
GtestUnitTest
(
env_with_less_optimization
,
'gtest_env_var_test_'
,
gtest
)
GtestUnitTest
(
env_with_less_optimization
,
'gtest_uninitialized_test_'
,
gtest
)
def
GtestSample
(
env
,
target
,
gtest_lib
,
additional_sources
=
None
):
"""Helper to create gtest samples.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment