aboutsummaryrefslogtreecommitdiffstats
path: root/googletest/CMakeLists.txt
diff options
context:
space:
mode:
authorDominic Meiser <dmeiser@txcorp.com>2015-10-05 18:02:02 -0400
committerDominic Meiser <dmeiser@txcorp.com>2015-10-29 21:56:02 -0600
commit580378d522d579bcaca24a90ccb31abafa157a8d (patch)
tree17cb3ab92eb460283f0c97b3f360de0dcbfab953 /googletest/CMakeLists.txt
parentbb5c92f9d1f0b26c79978e92f38a0e5fbcc8c9bf (diff)
downloadgoogletest-580378d522d579bcaca24a90ccb31abafa157a8d.tar.gz
googletest-580378d522d579bcaca24a90ccb31abafa157a8d.tar.bz2
googletest-580378d522d579bcaca24a90ccb31abafa157a8d.zip
Add an option to enable building with -fvisibility=hidden.
When this option is set gtest itself is built with -fvisibility=hidden with gcc and clang. This replicates MSVC's default behaviour with gcc and clang.
Diffstat (limited to 'googletest/CMakeLists.txt')
-rw-r--r--googletest/CMakeLists.txt10
1 files changed, 10 insertions, 0 deletions
diff --git a/googletest/CMakeLists.txt b/googletest/CMakeLists.txt
index bd78cfe6..961672aa 100644
--- a/googletest/CMakeLists.txt
+++ b/googletest/CMakeLists.txt
@@ -22,6 +22,11 @@ option(gtest_build_samples "Build gtest's sample programs." OFF)
option(gtest_disable_pthreads "Disable uses of pthreads in gtest." OFF)
+option(
+ gtest_hide_internal_symbols
+ "Build gtest with internal symbols hidden in shared libraries."
+ OFF)
+
# Defines pre_project_set_up_hermetic_build() and set_up_hermetic_build().
include(cmake/hermetic_build.cmake OPTIONAL)
@@ -46,6 +51,11 @@ if (COMMAND set_up_hermetic_build)
set_up_hermetic_build()
endif()
+if (gtest_hide_internal_symbols)
+ set(CMAKE_CXX_VISIBILITY_PRESET hidden)
+ set(CMAKE_VISIBILITY_INLINES_HIDDEN 1)
+endif()
+
# Define helper functions and macros used by Google Test.
include(cmake/internal_utils.cmake)