diff options
author | zhanyong.wan <zhanyong.wan@861a406c-534a-0410-8894-cb66d6ee9925> | 2010-09-28 21:28:24 (GMT) |
---|---|---|
committer | zhanyong.wan <zhanyong.wan@861a406c-534a-0410-8894-cb66d6ee9925> | 2010-09-28 21:28:24 (GMT) |
commit | e5974e3f43b4f84d2cd9640a607800ae3447b4f4 (patch) | |
tree | 1737d6ea9032d5745863ea067e0d60ad227dea87 /README | |
parent | 2d1835b086e69570e4c3e0ad6197da509bd0a957 (diff) | |
download | googletest-e5974e3f43b4f84d2cd9640a607800ae3447b4f4.zip googletest-e5974e3f43b4f84d2cd9640a607800ae3447b4f4.tar.gz googletest-e5974e3f43b4f84d2cd9640a607800ae3447b4f4.tar.bz2 |
Clarifies how to use gtest as a shared library in README.
Diffstat (limited to 'README')
-rw-r--r-- | README | 12 |
1 files changed, 10 insertions, 2 deletions
@@ -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 |