Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
googletest
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Chen Yisong
googletest
Commits
5f7c33d3
Commit
5f7c33d3
authored
Apr 02, 2009
by
zhanyong.wan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixes the scons script to build gtest-death-test_test on Linux.
parent
6a26383e
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
13 deletions
+20
-13
SConscript
scons/SConscript
+20
-13
No files found.
scons/SConscript
View file @
5f7c33d3
...
@@ -99,8 +99,8 @@ env = env.Clone()
...
@@ -99,8 +99,8 @@ env = env.Clone()
# Include paths to gtest headers are relative to either the gtest
# Include paths to gtest headers are relative to either the gtest
# directory or the 'include' subdirectory of it, and this SConscript
# directory or the 'include' subdirectory of it, and this SConscript
# file is one directory deeper than the gtest directory.
# file is one directory deeper than the gtest directory.
env
.
Prepend
(
CPPPATH
=
[
'..'
,
env
.
Prepend
(
CPPPATH
=
[
'
#/
..'
,
'../include'
])
'
#/
../include'
])
# Sources used by base library and library that includes main.
# Sources used by base library and library that includes main.
gtest_source
=
'../src/gtest-all.cc'
gtest_source
=
'../src/gtest-all.cc'
...
@@ -117,8 +117,7 @@ gtest_main = env.StaticLibrary(target='gtest_main',
...
@@ -117,8 +117,7 @@ gtest_main = env.StaticLibrary(target='gtest_main',
source
=
[
gtest_source
,
gtest_main_source
])
source
=
[
gtest_source
,
gtest_main_source
])
env_with_exceptions
=
env
.
Clone
()
env_with_exceptions
=
env
.
Clone
()
platform
=
env_with_exceptions
[
'PLATFORM'
]
if
env_with_exceptions
[
'PLATFORM'
]
==
'win32'
:
if
platform
==
'win32'
:
env_with_exceptions
.
Append
(
CCFLAGS
=
[
'/EHsc'
])
env_with_exceptions
.
Append
(
CCFLAGS
=
[
'/EHsc'
])
env_with_exceptions
.
Append
(
CPPDEFINES
=
'_HAS_EXCEPTIONS=1'
)
env_with_exceptions
.
Append
(
CPPDEFINES
=
'_HAS_EXCEPTIONS=1'
)
# Undoes the _TYPEINFO_ hack, which is unnecessary and only creates
# Undoes the _TYPEINFO_ hack, which is unnecessary and only creates
...
@@ -205,7 +204,14 @@ GtestUnitTest(env, 'gtest_output_test_', gtest)
...
@@ -205,7 +204,14 @@ GtestUnitTest(env, 'gtest_output_test_', gtest)
GtestUnitTest
(
env
,
'gtest_color_test_'
,
gtest
)
GtestUnitTest
(
env
,
'gtest_color_test_'
,
gtest
)
GtestUnitTest
(
env
,
'gtest-linked_ptr_test'
,
gtest_main
)
GtestUnitTest
(
env
,
'gtest-linked_ptr_test'
,
gtest_main
)
GtestUnitTest
(
env
,
'gtest-port_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
(
gtest_unittest_ex_obj
=
env_with_exceptions
.
Object
(
target
=
'gtest_unittest_ex'
,
target
=
'gtest_unittest_ex'
,
...
@@ -226,16 +232,17 @@ GtestBinary(env_with_exceptions,
...
@@ -226,16 +232,17 @@ GtestBinary(env_with_exceptions,
# - gtest_xml_outfile2_test_
# - gtest_xml_outfile2_test_
# - gtest_xml_output_unittest_
# - gtest_xml_output_unittest_
# We need to disable some optimization flags for a couple of tests,
# We need to disable some optimization flags for some tests on
# otherwise the redirection of stdout does not work (apparently
# Windows; otherwise the redirection of stdout does not work
# because of a compiler bug).
# (apparently because of a compiler bug).
special_env
=
env
.
Clone
()
env_with_less_optimization
=
env
.
Clone
()
linker_flags
=
special_env
[
'LINKFLAGS'
]
if
env_with_less_optimization
[
'PLATFORM'
]
==
'win32'
:
for
flag
in
[
"/O1"
,
"/Os"
,
"/Og"
,
"/Oy"
]:
linker_flags
=
env_with_less_optimization
[
'LINKFLAGS'
]
for
flag
in
[
"/O1"
,
"/Os"
,
"/Og"
,
"/Oy"
]:
if
flag
in
linker_flags
:
if
flag
in
linker_flags
:
linker_flags
.
remove
(
flag
)
linker_flags
.
remove
(
flag
)
GtestUnitTest
(
special_env
,
'gtest_env_var_test_'
,
gtest
)
GtestUnitTest
(
env_with_less_optimization
,
'gtest_env_var_test_'
,
gtest
)
GtestUnitTest
(
special_env
,
'gtest_uninitialized_test_'
,
gtest
)
GtestUnitTest
(
env_with_less_optimization
,
'gtest_uninitialized_test_'
,
gtest
)
def
GtestSample
(
env
,
target
,
gtest_lib
,
additional_sources
=
None
):
def
GtestSample
(
env
,
target
,
gtest_lib
,
additional_sources
=
None
):
"""Helper to create gtest samples.
"""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