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
e5974e3f
Commit
e5974e3f
authored
Sep 28, 2010
by
zhanyong.wan
Browse files
Clarifies how to use gtest as a shared library in README.
parent
2d1835b0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
2 deletions
+10
-2
README
README
+10
-2
No files found.
README
View file @
e5974e3f
...
...
@@ -288,7 +288,7 @@ Google Test is compact, so most users can build and link it as a
static library for the simplicity. You can choose to use Google Test
as a shared library (known as a DLL on Windows) if you prefer.
To compile gtest as a shared library, add
To compile
*
gtest
*
as a shared library, add
-DGTEST_CREATE_SHARED_LIBRARY=1
...
...
@@ -296,12 +296,20 @@ to the compiler flags. You'll also need to tell the linker to produce
a
shared
library
instead
-
consult
your
linker
's manual for how to do
it.
To compile your tests that use the gtest shared library, add
To compile your
*
tests
*
that use the gtest shared library, add
-DGTEST_LINKED_AS_SHARED_LIBRARY=1
to the compiler flags.
Note: while the above steps aren'
t
technically
necessary
today
when
using
some
compilers
(
e
.
g
.
GCC
),
they
may
become
necessary
in
the
future
,
if
we
decide
to
improve
the
speed
of
loading
the
library
(
see
http
://
gcc
.
gnu
.
org
/
wiki
/
Visibility
for
details
).
Therefore
you
are
recommended
to
always
add
the
above
flags
when
using
Google
Test
as
a
shared
library
.
Otherwise
a
future
release
of
Google
Test
may
break
your
build
script
.
###
Avoiding
Macro
Name
Clashes
###
In
C
++,
macros
don
't obey namespaces. Therefore two libraries that
...
...
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