"googlemock/git@developer.sourcefind.cn:yangql/googletest.git" did not exist on "633488a76325ad22c622a68cd7a20e556be96f5b"
Commit 580378d5 authored by Dominic Meiser's avatar Dominic Meiser
Browse files

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.
parent bb5c92f9
...@@ -22,6 +22,11 @@ option(gtest_build_samples "Build gtest's sample programs." OFF) ...@@ -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_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(). # Defines pre_project_set_up_hermetic_build() and set_up_hermetic_build().
include(cmake/hermetic_build.cmake OPTIONAL) include(cmake/hermetic_build.cmake OPTIONAL)
...@@ -46,6 +51,11 @@ if (COMMAND set_up_hermetic_build) ...@@ -46,6 +51,11 @@ if (COMMAND set_up_hermetic_build)
set_up_hermetic_build() set_up_hermetic_build()
endif() 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. # Define helper functions and macros used by Google Test.
include(cmake/internal_utils.cmake) include(cmake/internal_utils.cmake)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment